Build android failed on React Native 0.64.0

Viewed 460

My release build failed with these logs. Not sure what's happening here. Maybe it's related with Android R8 or Gradle 4.1.0. I tried delete node_modules .gradle app/build build I tried to clean, rebuild, invalidate cache & restart. None of them seem to work.

I really appreciate any help.


> 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, 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

    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.
0 Answers
Related