react-native: [android] Plugin [id: 'com.facebook.react.settings'] was not found in any of the following sources
Description
build fail on android after upgrading from 0.74.5 to 0.75.1 caused by “/android/settings.gradle’ line: 2”
pluginManagement { includeBuild("../../../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = 'driver'
include ':app'
includeBuild('../../../node_modules/@react-native/gradle-plugin')
i’m using monorepo, i rechecked node_modules path and it is correct
Steps to reproduce
- upgrade to react-native@0.75.1
- react-native run-android
React Native Version
0.75.1
Affected Platforms
Runtime - Android
Output of npx react-native info
...
Stacktrace or Logs
FAILURE: Build failed with an exception.
* Where:
Settings file '/Users/hamoboker/Projects/shoory/shoory-mobile/apps/driver/android/settings.gradle' line: 2
* What went wrong:
Plugin [id: 'com.facebook.react.settings'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (No included builds contain this plugin)
- Plugin Repositories (plugin dependency must include a version number for this source)
Reproducer
…
Screenshots and Videos
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 31
- Comments: 97 (5 by maintainers)
check your @react-native/gradle-plugin resolution in yarn.lock/package-lock.json; if you have any lingering other than 0.75.1 (eg i have 0.74.1 left in there) you have to remove node_modules and regenerate your lock file
@HamoBoker thanks for the update, I’m closing then:
Generally doing:
should be sufficient rather than having to reboot.
Please open separate issues if you’re having similar problmes.
The real solution!!
After deeply investigated this issue, this is my verdict to fix the issue for React Native version
0.74.5.yarn react-native-clean-project.cd android && ./gradlew --stop && rm -rf ~/.gradle/caches && cd ..yarn add @react-native/gradle-plugin@0.75.1 --exact. You don’t need it.Is has everything to do with a dangling react-native/gradle-plugin in the
yarn.lockfile.If you have the
react-native-windowsdependency in yourpackage.jsonensure it has the same version as thereact-nativedependency. Fix this first before performing the next steps. If this does not fix it after performing the steps below, it has something to do with another outdated dependency in thepackages.jsonPerform the next steps from the root of your project.
yarn.lockfile. (Deleting the file will makeyarnunhappy)node_modulesyarn installcd androidgradlew cleanyarn androidThis will fix it. Happy coding! 😄
Claro! Aqui está a tradução do seu passo a passo:
Simple solution:
.gradlefoldercd androidgradlew cleanyarn androidThank me later!!
same issue
I tried everything listed above but nothing is working.
i think you need to update your @react-native/gradle-plugin by
npm install @react-native/gradle-pluginAdding it as a devDependency solved it for me
@lovegaoshi is right. Can you confirm you have
@react-native/gradle-pluginversion0.75.1installed?Seems related to: https://github.com/gradle/gradle/issues/28974
I don’t have a solution at the moment and I also cannot reproduce:
https://github.com/user-attachments/assets/62058329-2649-4e1a-9c6b-e109a4fd70f7
I would have suggested to attempt removing the
.gralde/cachesfolder which you already did. I’d like to see if other users are also having this problem or notwhen u got that error just restart damn computer
@bizIshan i got the same issue today try gradlew clean --refresh-dependencies
Does anyone have this error ?
Worked for me after installing @react-native/gradle-plugin 0.77 and upgrading distributionUrl to gradle-8.9-all.zip in gradle-wrapper.properties. My project is targeting to React Native version 0.75.3
This solution worked for me after 2 days 😃
Using react native cli ~0.75.3 and gradle version 8.8
Steps I did
yarn add @react-native/gradle-plugin@0.75.1 --exact
I struggled with the issue for 3 days, approximately around 10 to 12 hours. What worked for me was simply upgrading the react-native version.
i slove this issue C:\Users<your_username>.gradle\caches\ ./gradlew delete then install @react-native/gradle-plugin then update gradle-wrapper-propeties 8.8 to 8.9 then gradle clean and npm start then your project run properly
I am able to solve this with following steps:
Follow these steps to resolve it:
Solution Steps
Delete the Gradle Cache Folder
Remove the cached Gradle files to ensure a clean build:
Delete the
.gradleDirectory in Your ProjectNavigate to your React Native project’s Android directory and delete the
.gradlefolder:Clean the Android Build (Optional)
Open a terminal, navigate to the
androidfolder, and run:Reinstall the React Native Gradle Plugin
Ensure you have the latest React Native Gradle plugin installed by running:
After completing these steps, restart your IDE (Android Studio or VS Code) and try running your project again.
This should resolve the issue and allow you to build your React Native app successfully. 🚀
Getting this error:
https://stackoverflow.com/a/79235480/11043676
this resolve the issues without the downgrading any versions. i noticed this issue occurs due to misconfiguration of gradle files
I just ran into this issue when using expo@next and upgrading to new arch then downgrading.
My solution was was
./gradlew --stop && rm -rf ./gradle/caches && ./gradlew cleanWorth noting I also cleared node_module and deleted and prebuilt the android project to no prevail.
Currently my issue is related to gradle cache
Could not read workspace metadata from /Users/hamoboker/.gradle/caches/[GRADLE_VERSION]getting this error on GRADLE_VERSION = 8.8 and 8.6
[UPDATE]
@cortinico i solved my issue by removing
rm -rf ~/.gradle/cachesand restarting the device removing~/.gradle/cacheswithout restarting didn’t solve the problem.@devic021 can you try this and share feedback ? if issue still occur make sure you have
@react-native/gradle-plugininstalledProjects tested on react-native@0.74.5 - gradle 8.6 react-native@0.75.1 - gradle 8.8
I’ll recheck and give you feedback
For me, running the following command worked:
@react-native/gradle-plugin -DJust started the project with the latest version of React Native at first build only got this error
i tried removing gradle caches etc Nope!
Hi @V-SATHISH2109, Last couple days ago, I was facing the same errors.
Below things work for me
Recheck the installed JAVA SDK version, react-native 0.75 requires a min JAVA sdk version 17.
JAVA -- versionClean the gradle caches via below command.
cd android && ./gradlew --stop && rm -rf ~/.gradle/caches@cortinico @HamoBoker Thanks, your solution works for me.
After 12 hours working, I decided to solve the problem and made next:
After this steps I haven’t met to this problem anymore. During build I have got another errors but with ChatGPT 4o I finished it successfully.
Here is the solution
I was also facing the same problem. My react-native version was 0.75.13. I upgraded it to react-native version 0.77.0 and resolved my issue.
Steps:
You can skip 3rd step. Directly install @react-native/gradle-plugin. It should work for you.
Hi everyone, my team struggled with this issue today, and we managed to solve it in two different ways. I’m not sure if these methods will work for you, but it’s worth a try!
Solution 1 (My Case):
First, I rebuilt the entire project with the desired version of React Native:
then
Note: Using
community/cliis mandatory; the version is optional.Then, I ran:
After that, I ran:
This ensures everything is set up correctly (everything should show as checked).
Finally, the most important part:
Yes, use npm here, not yarn—I don’t know why, but it worked for me!
Solution 2 (For My Friend):
For my friend, this approach didn’t work initially, so we had to take some extra steps:
Delete the node_modules folder.
And run:
Then, run:
This worked for both of us (with a few additional steps on my friend’s machine). Just make sure that react-native doctor shows everything as checked, otherwise you may face this issue again.
Good luck, keep coding, and be blessed! 🙏
Same issue, Can any one explain what cause this issue all of sudden ?
./gradlew clean is giving this error
I didn’t try, my project was really small so it was easy for me restarting the project. Maybe combining other solutions with removing the Java plugins will help. I realised creating a new project in a clean computer that when you install Java plugins on VSC it edits some parts of android graddle folder.
thank you, this did the trick after cleaning node_modules : cd android && ./gradlew --stop && rm -rf ~/.gradle/caches
I never liked gradle and now it’s officially added to the list of crapware 😃. Would one need a file a bug for this ? I am glad it solved it, thank you!
screen-capture (1).webm
same issue
@cortinico @HamoBoker Thanks, your solution works for me. Thank you so much, you saved my day!
I had the same issue unitl I followed these step. Thank you so much issue resolved.
FAILURE: Build failed with an exception.
Where: Settings file ‘D:\delet\reactnative\android\settings.gradle’ line: 2
What went wrong: Error resolving plugin [id: ‘com.facebook.react.settings’]
still showing same error “node_modules/@react-native/gradle-plugin”: { “version”: “0.75.1”, “resolved”: “https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.75.1.tgz”, “integrity”: “sha512-a2gVjX3MB9TF9QZSKje79n1GDAnseTU94VIcFH/4DS3KjbK3yrNXsu1maxGZxDUAKmTUH7Rz4An/Rb5nkZG7dw==”, “dev”: true, “engines”: { “node”: “>=18” } },