开发者问题收集

EAS构建-P Android失败

2022-01-12
6457

当我运行 eas build -p android 时,我收到错误 Android build failed: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.

我无法执行常规的 expo build:android ,并且在尝试命名我的 Android 包时出现了一些奇怪的错误。因此,我改为按照尝试 expo build 后出现的问题进行操作。

expo build:android has been superseded by eas build. Learn more: https://blog.expo.dev/turtle-goes-out-to-sea-d334db2a6b60

Run the following:

› npm install -g eas-cli
› eas build -p android https://docs.expo.dev/build/setup/

expo build:android will be discontinued on January 4, 2023 (357 days left). 

因此,如果我进入 expo.dev 上的日志,我会看到以下内容:

> Task :react-native-svg:packageReleaseAssets
> Task :app:mergeReleaseAssets FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeReleaseAssets'.
[stderr] > Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
[stderr]    > Could not resolve com.facebook.react:react-native:+.
[stderr]      Required by:
[stderr]          project :app
[stderr]          project :app > project :expo
[stderr]          project :app > project :react-native-gesture-handler
[stderr]          project :app > project :react-native-safe-area-context
[stderr]          project :app > project :react-native-screens
[stderr]          project :app > project :react-native-svg
[stderr]          project :app > project :expo > project :expo-modules-core
[stderr]          project :app > project :expo > project :expo-splash-screen
[stderr]          project :app > project :expo > project :expo-updates
[stderr]       > Failed to list versions for com.facebook.react:react-native.
[stderr]          > Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
[stderr]             > Could not get resource 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
[stderr]                > Could not GET 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
[stderr] * Try:
[stderr] 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.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 3m 21s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
45 actionable tasks: 45 executed
Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.

我无法发布整个日志,因为 stackoverflow 不允许我发布我的问题,因为它“看起来像垃圾邮件”,所以我只是复制了日志的错误部分。

如能提供任何帮助,我们将不胜感激。

2个回答

JCenter 目前处于关闭状态,并且需要启用 React Native 的许多依赖项 - 特别是:

com.facebook.yoga:proguard-annotations:1.14.1
com.facebook.fbjni:fbjni-java-only:0.0.3
com.facebook.flipper:flipper:0.54.0
com.facebook.flipper:flipper-network-plugin:0.54.0
com.facebook.flipper:flipper-fresco-plugin:0.54.0

https://status.expo.dev/

brentvatne
2022-01-12

这似乎是一次全球性的 JCenter 中断(时有发生)。

您可以在 此处 监控状态

Eylon Shmilovich
2024-03-09