EAS/Expo/ReactNative Android 构建失败 androidx.core:core:1.15.0-alpha01

问题描述 投票:0回答:1

我正在使用 React Native 的 Expo Managed Workflow。

当我为 Android 构建时,它失败并出现以下错误: 我尝试了很多方法,但总是崩溃,我不知道是否是我的某个软件包的版本问题..

> Task :react-native-screens:buildCMakeRelWithDebInfo[arm64-v8a]
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkReleaseAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > An issue was found when checking AAR metadata:
     
       1.  Dependency 'androidx.core:core:1.15.0-alpha01' requires libraries and applications that
           depend on it to compile against version 35 or later of the
           Android APIs.
     
           :app is currently compiled against android-34.
     
           Also, the maximum recommended compile SDK version for Android Gradle
           plugin 8.2.1 is 34.
Recommended action: Update this project's version of the Android Gradle
           plugin to one that supports 35, then update this project to use
           compileSdk of at least 35.
     
           Note that updating a library or application's compileSdk (which
           allows newer APIs to be used) can be done separately from updating
           targetSdk (which opts the app in to new runtime behavior) and
           minSdk (which determines which devices the app can be installed
           on).
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 7m 32s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

这是我的 app.json 文件:

{
  "expo": {
    "name": "***",
    "slug": "***",
    "version": "1.0.24",
    "sdkVersion": "51.0.0",
    "orientation": "portrait",
    "icon": "./assets/lotyicon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/lotygif.gif",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "***",
      "buildNumber": "19",
      "infoPlist": {
        "NSLocationAlwaysAndWhenInUseUsageDescription": "Nous avons besoin de votre localisation pour afficher les boutiques autour de vous.",
        "NSLocationWhenInUseUsageDescription": "Nous avons besoin de votre localisation pour afficher les boutiques autour de vous."
      }
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/lotyicon.png",
        "backgroundColor": "#FFFFFF"
      },
      "package": "***",
      "googleServicesFile": "google-services.json",
      "versionCode": 24,
      "config": {
        "googleMaps": {
          "apiKey": "***"
        }
      }
    },
    "web": {
      "favicon": "./assets/lotyicon.png"
    },
    "extra": {
      "eas": {
        "projectId": "***"
      }
    },
    "plugins": [
      "expo-font",
      [
        "expo-camera",
        {
          "cameraPermission": "Nous avons besoin de la caméra pour scanner les QR Code des boutiques."
        }
      ],
      [
        "expo-location",
        {
          "locationAlwaysAndWhenInUsePermission": "Nous avons besoin de votre localisation pour afficher les boutiques autour de vous."
        }
      ]
    ]
  }
}

这是我的 package.json :

{
  "name": "lotyproject",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@adrianso/react-native-device-brightness": "^1.2.7",
    "@babel/runtime": "^7.24.5",
    "@expo/config-plugins": "~8.0.0",
    "@react-native-async-storage/async-storage": "1.23.1",
    "@react-native-community/datetimepicker": "8.0.1",
    "@react-native-community/geolocation": "^3.1.0",
    "@react-native-community/push-notification-ios": "^1.11.0",
    "@react-native-picker/picker": "2.7.5",
    "@react-navigation/bottom-tabs": "^6.5.5",
    "@react-navigation/material-top-tabs": "^6.6.2",
    "@react-navigation/native": "^6.1.4",
    "@react-navigation/native-stack": "^6.9.10",
    "@react-navigation/stack": "^6.3.20",
    "axios": "^1.6.2",
    "axios-auth-refresh": "^3.3.6",
    "date-fns": "^2.30.0",
    "expo": "^51.0.14",
    "expo-barcode-scanner": "~13.0.1",
    "expo-camera": "~15.0.6",
    "expo-constants": "~16.0.1",
    "expo-device": "~6.0.2",
    "expo-font": "~12.0.5",
    "expo-location": "~17.0.1",
    "expo-notifications": "~0.28.1",
    "expo-splash-screen": "~0.27.4",
    "expo-status-bar": "~1.12.1",
    "expo-updates": "~0.25.11",
    "npm-upgrade": "^2.0.4",
    "react": "18.2.0",
    "react-native": "0.74.2",
    "react-native-animated-placeholder-textinput": "^0.0.9",
    "react-native-bouncy-checkbox": "^4.0.0",
    "react-native-drop-shadow": "^1.0.0",
    "react-native-gesture-handler": "~2.16.1",
    "react-native-keychain": "^8.1.2",
    "react-native-maps": "1.14.0",
    "react-native-pager-view": "6.3.0",
    "react-native-permissions": "^3.6.1",
    "react-native-push-notification": "^8.1.1",
    "react-native-qrcode-scanner": "^1.5.5",
    "react-native-qrcode-svg": "^6.3.1",
    "react-native-reanimated-table": "^0.0.2",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "4.10.1",
    "react-native-screen-brightness": "^2.0.0-alpha",
    "react-native-screens": "3.31.1",
    "react-native-select-dropdown": "^3.3.2",
    "react-native-svg": "15.2.0",
    "react-native-tab-view": "^3.5.1",
    "react-native-table-component": "^1.2.2",
    "react-navigation": "^4.4.4",
    "typed-async-storage": "^3.1.2"
  },
  "resolutions": {
    "@expo/config-plugins": "5.0.2"
  },
  "devDependencies": {
    "@babel/core": "^7.24.0"
  },
  "private": true
}

我尝试使用 expo-build-properties 转到 SDK 35,但随后我的构建因以下错误而崩溃:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':expo-modules-core:compileReleaseKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details
android react-native gradle expo eas
1个回答
0
投票

编辑: 我删除了react-native-brightness包,我不知道为什么,但它是导致问题的原因。

© www.soinside.com 2019 - 2024. All rights reserved.