When I try to build for production, this error comes up. I’m using React Native Firebase. This error happens on android.
Here is the error
* What went wrong:
Execution failed for task ':react-native-firebase_app:generateReleaseRFile'.
> Could not resolve all files for configuration ':react-native-firebase_app:releaseCompileClasspath'.
> Failed to transform react-native-0.71.0-rc.0-release.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-symbol-with-package-name, com.android.build.api.attributes.BuildTypeAttr=release, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}.
> Could not find react-native-0.71.0-rc.0-release.aar (com.facebook.react:react-native:0.71.0-rc.0).
Searched in the following locations:
https://repo.maven.apache.org/maven2/com/facebook/react/react-native/0.71.0-rc.0/react-native-0.71.0-rc.0-release.aar
Here are my packages
[tag: "@react-native-async-storage/async-storage": "^1.17.10",
"@react-native-firebase/analytics": "^16.4.3",
"@react-native-firebase/app": "^16.4.3",
"@react-navigation/bottom-tabs": "^6.4.0",
"@react-navigation/native": "^6.0.13",
"@react-navigation/native-stack": "^6.9.1",
"@rneui/base": "^4.0.0-rc.7",
"@rneui/themed": "^4.0.0-rc.7",
"meilisearch": "^0.29.1",
"native-base": "^3.4.21",
"picomatch": "^2.3.1",
"react": "18.1.0",
"react-native": "0.70.3",
"react-native-firebase": "^5.6.0",
"react-native-google-mobile-ads": "^8.2.1",
"react-native-navigation-bar-color": "^2.0.1",
"react-native-safe-area-context": "^4.4.1",
"react-native-screens": "^3.18.2",
"react-native-svg": "^13.5.0",
"react-native-vector-icons": "^9.2.0"]
If you can help, thanks!
I have tried everything I could find online =(
I have also tried npx jetify
6
Answers
This is a bug with react native, a fix has been released. Check https://github.com/facebook/react-native/issues/35210
as the first answer said it’s issue in maven central and react-native resolved that here https://github.com/facebook/react-native/issues/35210….
in package.json file
update react-native by replace this line
then npm install
Try this
add these lines into android/build.gradle File
Make sure that your react-native version in your app/build.gradle matches your version in the package.json:
app/build.gradle
package.json
this works for me
You can check this link to know what exactly the problem is:
No matching variant of com.facebook.react:react-native:0.71.0-rc.0 was found
Solution 1:
Just update your react native version to 0.71 and npm install.
Solution 2:
I was using react native version 0.69.4 and this code helped me to fix it by adding into my android/build.gradle file.
Hope this helps you and anyone going through this problem.
I was able to fix the issue by updating the version of react native to the latest patch.
If your react-native version is 0.70.x update it to => 0.70.5
If your react-native version is 0.69.x update it to => 0.69.7
If your react-native version is 0.68.x update it to => 0.68.5
If your react-native version is 0.67.x update it to => 0.67.5
If your react-native version is 0.66.x update it to => 0.66.5
If your react-native version is 0.65.x update it to => 0.65.3
If your react-native version is 0.64.x update it to => 0.64.4
If your react-native version is 0.63.x update it to => 0.63.5
Link to the source: https://github.com/facebook/react-native/issues/35210