React-native: native_modules.gradle file is not downloading

Created on 13 Jul 2019  路  7Comments  路  Source: facebook/react-native

I have created an app in react native for my project. When I copy my projects file in the app folder then run the app it said that in node_module react-redux is not exist then I installed react-redux using npm install [email protected] in my app folder after that when I run run-android command in command prompt for this project it is telling that -
Could not read script 'E:\AppFolder\MyApp\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' as it does not exist. .

After that, I wiped the data of emulator and run run-android, but it is still giving me the same error and app is not installing in the emulator.

Here is the error which command prompt is displaying :

```info Starting JS server...
info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

  • Where:
    Settings file 'E:\AppFolder\MyApp\android\settings.gradle' line: 4

  • What went wrong:
    A problem occurred evaluating settings 'TribeBond'.

    Could not read script 'E:\AppFolder\MyAppnode_modules\@react-native-community\cli-platform-android\native_modules.gradle' as it does not exist.

  • 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

BUILD FAILED in 1m 10s
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.```

Bug Ran Commands Stale

Most helpful comment

I got similar issue when android-cli part wasn't installed.
> Could not read script 'my-code-path\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' as it does not exist.

I had to manually install the Android cli package.
npm i @react-native-community/cli-platform-android

All 7 comments


Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

馃憠 Click here if you want to take another look at the Bug Report issue template.

Task :app:transformNativeLibsWithMergeJniLibsForDebug FAILED

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.4.1/userguide/command_line_interface.html#sec:command_line_warnings
60 actionable tasks: 48 executed, 12 up-to-date
Note: E:\React_Native\List9Aug19node_modulesreact-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.

    Could not read path 'E:\React_Native\List9Aug19\android\app\build\intermediates\transforms\mergeJniLibs\debug\0\lib\arm64-v8a'.

  • 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

BUILD FAILED in 59s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: E:\React_Native\List9Aug19node_modulesreact-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.

    Could not read path 'E:\React_Native\List9Aug19\android\app\build\intermediates\transforms\mergeJniLibs\debug\0\lib\arm64-v8a'.

  • 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

BUILD FAILED in 59s

at checkExecSyncError (child_process.js:629:11)
at execFileSync (child_process.js:647:13)
at runOnAllDevices (E:\React_Native\List9Aug19\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (E:\React_Native\List9Aug19\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at then.result (E:\React_Native\List9Aug19\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12)
at process._tickCallback (internal/process/next_tick.js:68:7)

help me to solve this error

I got similar issue when android-cli part wasn't installed.
> Could not read script 'my-code-path\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' as it does not exist.

I had to manually install the Android cli package.
npm i @react-native-community/cli-platform-android

Same issue here. Freshly installed.

Same issue here when first initiating Android Studio on project:

Could not read script '/Users/danale/Projects/NFIBEngage/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' as it does not exist.

When I looked inside node_modules/@react-native-community/cli-platform-android, sure enough there was no native_modules.gradle file.

I also found I had to manually npm i @react-native-community/cli-platform-android and then it worked.

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Was this page helpful?
0 / 5 - 0 ratings