RN 0.61 Android build fails
See original GitHub issueThis likely has to do with AndroidX or other things of which I am somewhat ignorant, but here’s what I can share:
I had react-native-reanimated working fine in my RN 0.60.5 app. Today I tried to upgrade to RN 0.61, and the Android build (via react-native run-android
) stopped working. It gave an error message like this:
/.../android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:37: error: package com.swmansion.reanimated does not exist
import com.swmansion.reanimated.ReanimatedPackage;
^
/.../android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:89: error: cannot find symbol
new ReanimatedPackage(),
^
symbol: class ReanimatedPackage
location: class PackageList
2 errors
FAILURE: Build failed with an exception.
I examined the changes to the android directory of the RN template that occurred between 0.60.5 and 0.61, and this one looks relevant: https://github.com/facebook/react-native/pull/25810
When I re-add the supportLibVersion
line to my android/build.gradle, the build seems to work again. I’m not sure if this is proper or if it implies something is going wrong with the jetify process for this library.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:21 (2 by maintainers)
Top Results From Across the Web
[FIXED] Android build failures `No matching variant of ... - GitHub
This event resulted in build failures for Android on several users as they ended up downloading the wrong React Native version ( 0.71.0-rc0 ......
Read more >A failure occurred while executing com.android.build.gradle ...
The answer lies here depending on the version of your react native. Patches are available for RN version 0.63 and up.
Read more >npx react-native run-android build failed - You.com
* What went wrong: Task 'installDebug' ; * Try: Run gradlew tasks to get a list of available tasks. Run with --stacktrace option...
Read more >React Native Upgrade Helper
React Native 0.62 includes built-in integration with Flipper. ... 22, # https://developer.android.com/topic/libraries/support-library/androidx-rn.
Read more >Building React Native app for multiple environments (updated ...
Here is where iOS Build Configurations and Android Build Variants comes ... This reason for this error is because the dependency libraries ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am still facing this.
My package.json:
Command used to run:
I also get the same issue when updating
react-native-reanimated
to1.4.0
I managed to fix this by adding this into my
build.gradle
I removed the following lines from
MainApplication.java
and it worked for me!