微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 React Native 0.64.0 上构建 android 失败

如何解决在 React Native 0.64.0 上构建 android 失败

我的发布版本因这些日志而失败。 不确定这里发生了什么。可能与 Android R8 或 Gradle 4.1.0 有关。 我试过删除 node_modules .gradle app/build build 我试图清理,重建,使缓存无效并重新启动。它们似乎都不起作用。

我非常感谢您的帮助。


> Task :app:minifyReleaseProductionWithR8 Failed

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.7/userguide/command_line_interface.html#sec:command_line_warnings
991 actionable tasks: 10 executed,981 up-to-date
myapp/android/app/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/releaseProduction/R.jar: R8: Type androidx.transition.R is defined multiple times: myapp/android/app/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/releaseProduction/R.jar:androidx/transition/R.class,myapp/android/app/build/intermediates/javac/releaseProduction/classes/androidx/transition/R.class

FAILURE: Build Failed with an exception.

* What went wrong:
Execution Failed for task ':app:minifyReleaseProductionWithR8'.
> com.android.tools.r8.CompilationFailedException: Compilation Failed to complete,origin: myapp/android/app/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/releaseProduction/R.jar:androidx/transition/R.class

* 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 1m 9s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command Failed: ./gradlew app:installreleaseProduction -PreactNativeDevServerPort=8081
myapp/android/app/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/releaseProduction/R.jar: R8: Type androidx.transition.R is defined multiple times: myapp/android/app/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/releaseProduction/R.jar:androidx/transition/R.class,origin: myapp/android/app/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/releaseProduction/R.jar:androidx/transition/R.class

* 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 1m 9s

    at makeError (myapp/node_modules/execa/index.js:174:9)
    at myapp/node_modules/execa/index.js:278:16
    at processticksAndRejections (internal/process/task_queues.js:97:5)
    at async runOnAllDevices (myapp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
    at async Command.handleAction (myapp/node_modules/@react-native-community/cli/build/index.js:186:9)
info Run CLI with --verbose flag for more details.
error Command Failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command Failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。