当我尝试为react native expo应用程序构建时,我面临着以下问题。我尝试了许多解决方案,如删除笔记模块,更新博览会,不同的操作系统等。
我使用yarn eject生成我的android文件夹。
我附上了我的软件包和我在执行eas build --platform android时得到的错误
"version": "2.0.0",
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"devtools": "react-devtools"
},
"dependencies": {
"@expo/config-plugins": "^5.0.2",
"@expo/prebuild-config": "^5.0.5",
"@miblanchard/react-native-slider": "^2.1.0",
"@react-native-community/masked-view": "^0.1.11",
"@react-navigation/bottom-tabs": "^6.3.2",
"@react-navigation/native": "^6.0.11",
"@react-navigation/native-stack": "^6.7.0",
"@react-navigation/stack": "^6.2.2",
"@stripe/stripe-react-native": "0.19.0",
"axios": "^1.2.0",
"expo": "^47.0.3",
"expo-app-loading": "~2.1.1",
"expo-av": "~13.0.3",
"expo-font": "~11.0.1",
"expo-linear-gradient": "~12.0.1",
"expo-secure-store": "~12.0.0",
"expo-splash-screen": "~0.17.5",
"expo-status-bar": "~1.4.2",
"react": "18.1.0",
"react-native": "0.70.8",
"react-native-gesture-handler": "~2.8.0",
"react-native-linear-gradient": "^2.6.2",
"react-native-paper": "^4.12.4",
"react-native-reanimated": "~2.12.0",
"react-native-safe-area-context": "4.4.1",
"react-native-screens": "~3.18.0",
"react-native-shadow-2": "^7.0.8",
"react-native-svg": "13.4.0",
"react-native-toast-message": "^2.1.5",
"react-native-webview": "11.23.1",
"react-navigation": "^4.4.4"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"react-devtools": "^4.26.1"
},
"resolutions": {
"@expo/config-plugins": "~7.2.2",
"@expo/prebuild-config": "~6.2.4"
},
"private": true
}
Specified value for "android.package" in app.json is ignored because an android directory was detected in the project.
EAS Build will use the value found in the native code.
✔ Using remote Android credentials (Expo server)
✔ Using Keystore from configuration: Build Credentials tQR9RzNH8- (default)
Compressing project files and uploading to EAS Build. Learn more
✔ Compressed project files 1s (33.0 MB)
✔ Uploaded to EAS 2s
Build details: https://expo.dev/accounts/obsesie/projects/AwesomeProject/builds/2e44b25d-2f59-42ac-b0f3-59fdd7a6df73
Waiting for build to complete. You can press Ctrl+C to exit.
✖ Build failed
🤖 Android build failed:
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
[stderr]
FAILURE: Build completed with 2 failures.
[stderr]
1: Task failed with an exception.
[stderr]
-----------
[stderr]
* What went wrong:
[stderr]
Execution failed for task ':app:checkReleaseAarMetadata'.
[stderr]
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
[stderr]
> 26 issues were found when checking AAR metadata:
[stderr]
1. Dependency 'androidx.appcompat:appcompat:1.5.1' requires libraries and applications that
[stderr]
depend on it to compile against version 32 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Recommended action: Update this project to use a newer compileSdkVersion
[stderr]
of at least 32, for example 32.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
8. Dependency 'androidx.compose.animation:animation:1.2.1' requires libraries and applications that
[stderr]
depend on it to compile against version 32 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Recommended action: Update this project to use a newer compileSdkVersion
[stderr]
of at least 32, for example 32.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
9. Dependency 'androidx.compose.foundation:foundation-layout:1.3.0-beta02' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
10. Dependency 'androidx.compose.animation:animation-core:1.2.1' requires libraries and applications that
[stderr]
depend on it to compile against version 32 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Recommended action: Update this project to use a newer compileSdkVersion
[stderr]
of at least 32, for example 32.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
11. Dependency 'androidx.compose.ui:ui:1.3.0-beta02' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
12. Dependency 'androidx.compose.ui:ui-text:1.3.0-beta02' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
13. Dependency 'androidx.compose.runtime:runtime-saveable:1.3.0-beta02' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
14. Dependency 'androidx.compose.ui:ui-graphics:1.3.0-beta02' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
15. Dependency 'androidx.compose.ui:ui-unit:1.3.0-beta02' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
16. Dependency 'androidx.compose.ui:ui-geometry:1.3.0-beta02' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
17. Dependency 'androidx.compose.ui:ui-tooling-preview:1.3.0-beta02' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
18. Dependency 'androidx.compose.runtime:runtime:1.3.0-beta02' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
19. Dependency 'androidx.emoji2:emoji2-views-helper:1.2.0' requires libraries and applications that
[stderr]
depend on it to compile against version 32 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Recommended action: Update this project to use a newer compileSdkVersion
[stderr]
of at least 32, for example 32.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
20. Dependency 'androidx.emoji2:emoji2:1.2.0' requires libraries and applications that
[stderr]
depend on it to compile against version 32 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Recommended action: Update this project to use a newer compileSdkVersion
[stderr]
of at least 32, for example 32.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
21. Dependency 'androidx.customview:customview-poolingcontainer:1.0.0' requires libraries and applications that
[stderr]
depend on it to compile against version 32 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Recommended action: Update this project to use a newer compileSdkVersion
[stderr]
of at least 32, for example 32.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
22. Dependency 'androidx.core:core-ktx:1.9.0' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
23. Dependency 'androidx.core:core:1.9.0' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
24. Dependency 'androidx.profileinstaller:profileinstaller:1.2.0' requires libraries and applications that
[stderr]
depend on it to compile against version 32 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Recommended action: Update this project to use a newer compileSdkVersion
[stderr]
of at least 32, for example 32.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
25. Dependency 'androidx.compose.ui:ui-util:1.3.0-beta02' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
[stderr]
26. Dependency 'androidx.annotation:annotation-experimental:1.3.0' requires libraries and applications that
[stderr]
depend on it to compile against version 33 or later of the
[stderr]
Android APIs.
[stderr]
[stderr]
:app is currently compiled against android-31.
[stderr]
[stderr]
Also, the maximum recommended compile SDK version for Android Gradle
[stderr]
plugin 7.2.1 is 32.
[stderr]
[stderr]
Recommended action: Update this project's version of the Android Gradle
[stderr]
plugin to one that supports 33, then update this project to use
[stderr]
compileSdkVerion of at least 33.
[stderr]
[stderr]
Note that updating a library or application's compileSdkVersion (which
[stderr]
allows newer APIs to be used) can be done separately from updating
[stderr]
targetSdkVersion (which opts the app in to new runtime behavior) and
[stderr]
minSdkVersion (which determines which devices the app can be installed
[stderr]
on).
[stderr]
* Try:
[stderr]
> Run with --stacktrace option to get the stack trace.
[stderr]
> Run with --info or --debug option to get more log output.
[stderr]
> Run with --scan to get full insights.
[stderr]
==============================================================================
[stderr]
2: Task failed with an exception.
[stderr]
-----------
[stderr]
* What went wrong:
[stderr]
java.lang.StackOverflowError (no error message)
[stderr]
* Try:
[stderr]
> Run with --stacktrace option to get the stack trace.
[stderr]
> Run with --info or --debug option to get more log output.
[stderr]
> Run with --scan to get full insights.
[stderr]
==============================================================================
[stderr]
* Get more help at https://help.gradle.org
[stderr]
BUILD FAILED in 8m 24s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
457 actionable tasks: 457 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
2条答案
按热度按时间kmpatx3s1#
在
android/build.gradle
中添加以下行:确保你有:
如果这不起作用,您可以尝试:
React的新版本
PS:你应该避免使用
expo eject
,只有当你需要修改本地代码时才这样做。2eafrhcq2#
通过运行以下命令安装生成属性以更新compileSdkVersion:
npx expo install expo-build-properties
并在您的app.json文件中添加以下内容: