-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A project with custom root fails at: cli-platform-android/native_modules.gradle' line: 191 #591
Comments
I fixed the problem. I am not sure if this nuance is covered in So all I had to do, to fix this specific problem, is to specify sourceDir and packageName in the react-native.config.js
|
can anyone assist on how this would relate to a build in Azure DevOps, this is where I get the error:
|
@ldco2016 I am receiving the same error on App Center (should be same as Azure). Were you able to find a solution? |
If anyone still facing this problem when using the monorepo approach please pay attention to android/settings.gradle:
|
Cleaning gradle cache works for me Stop gradlew on Windows: Stop gradlew on Mac or Linux: Clean cache on Windows: Clean cache on Mac or Linux: |
In my case |
@vladp How do i perform PATH=$(npm bin):$PATH react-native config in windows, and where can i keep react-native.config.js in my project. and which library can add a react-native.config.js |
@cmcaboy I'm also seeing this same error in AppCenter. Did you find a solution that worked? |
Please note, that
So starting from RN 0.61 if you have RN root folder located as a sibling or underneath of a sibling of your Android app directory, the CLI will not find it and Autolinking will fail See my bug report at
on windows, just and do You do not need to this manually, as CLI's autolinking code does that. The best guide for this, unfortutely, is just to carefull follow diff report between your current version |
I deleted my build folder and it worked. |
FAILURE: Build failed with an exception.
BUILD FAILED in 7s This was the error that appear to me when I wrote this commands. |
@Cuadros99 i got this error too but in linux when i init new react-native project in react-native-cli i've faced with this error every time Could not load compiled classes for script '.../node_modules/@react-native-community/cli-platform-android/native_modules.gradle' from cache. |
@mohpezeshki, I'm also facing the same issue in RN 0.72.4 |
What worked for me at the time was put the project directory in a place where it didnt have any blank space in its path. Like in my case the path has "/┴rea de Trabalho/". |
A simple |
Can anyone suggest this how to resolve this error |
@Sushmanighthack please make sure thatn you have |
I am trying to upgrade to 60.4, and introduced the 'autolinking' capability by modifying my settings.gradle and app/build.gradle.
Platform is Linux, RN platform is android only, cli is 2.8.0.
With that change, however I cannot run any gradle commands (not even gradlew clean):
bash gradlew clean
The cli version is latest, 2.8.0
The line where it is failing, trying to parse json output from running react-native-config
Line 191:
this.packageName = json["project"]["android"]["packageName"]
When I run
PATH=$(npm bin):$PATH react-native config
I can see that in its output ["project"]["android" is indeed null.
But why, and what do I need to do to fix it?
It seems that applyNativeModulesSettingsGradle relies on it, and that's why my build completely stopped at the moment.
Additional info:
cat react-native.config.js <-- this is root of my RN code. this dir also has index.android.js
cat settings.gradle
I did not even have, initially, the react-native.config.js (because it was not noted as needed in rn-diff utility) , but even after adding it -- it did not help.
appreciate in advance any guidance.
The text was updated successfully, but these errors were encountered: