I've upgraded my ReactNative project from 0.59 to 0.61.2 iOS is building fine but in android i'm facing the issue in @react-native-community/cli-platform-android module.
My settings.gradle file
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
My build.gradle file
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
I get the following error while building the app.
> Task :app:generatePackageList FAILED
FAILURE: Build failed with an exception.
* Where:
Script '/Users/yashwanth_c/Documents/projects/MobileApp/node_modules/@react-native-community/cli-platform-android
/native_modules.gradle' line: 130
* What went wrong:
Execution failed for task ':app:generatePackageList'.
> ReactNativeModules$_generatePackagesFile_closure3
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 5m 21s
4 actionable tasks: 4 executed
As always i've cleaned the cache and deleted the node_module folder, tried many times but no luck. Also googled for more than a week but still not able to find a fix, any advice is appreciated.
I had same issues then i tried below command. it's worked for me. It's mean, mannually install the android cli package.
npm i @react-native-community/cli-platform-android
If anyone known another solution kindly share here.
I'm working in a monorepo. The file exists, but it was in my project root's node_modules/@react-native-community
NOT the package node_modules
.
To fix this, I updated the paths
/android/settings.gradle : Line 2
apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
/android/app/build.gradle : Line 225
apply from: file("../../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
I was facing the same issue in React Native 0.61.0. I have tried the below solution:-
./gradlew --stop (in MacOS)
./gradlew cleanBuildCache (in MacOS)
For Window:-
gradlew --stop
gradlew cleanBuildCache
Check below linking for more reference https://github.com/react-native-community/cli/issues/591
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With