Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native\react.gradle' does not exist

Tags:

I created an app using react native and I am trying to generate the apk. After doing everthing in the doc of http://facebook.github.io/react-native/docs/signed-apk-android.html#content. An error occured and it says Could not read script react-native\react.gradle' as it does not exist.

Here is the error

FAILURE: Build failed with an exception.  * Where: Build file 'C:\Users\User\Desktop\Aaa\android\app\build.gradle' line: 68  * What went wrong: A problem occurred evaluating project ':app'. > Could not read script 'C    *   // override which node gets called and with what additional arguments *   nodeExecutableAndArgs: ["node"], * *   // supply additional arguments to the packager *   extraPackagerArgs: [] * ] */  apply from: "../../node_modules/react-native/react.gradle"  /**  * Set this to true to create two separate APKs instead of one:  *   - An APK that only works on ARM devices  *   - An APK that only works on x86 devices  * The advantage is the size of the APK is reduced by about 4MB.  * Upload all the APKs to the Play Store and people will download  * the correct one based on the CPU architecture of their device.  */ def enableSeparateBuildPerCPUArchitecture = false 
like image 710
orange Avatar asked Jun 08 '17 13:06

orange


People also ask

How install gradle in react native?

you can go to https://services.gradle.org/distributions/ and check that latest -all. zip version of gradle and update the same in your gradle-wrapper. properties file. When you run your react-native app the next time, your gradle will first get upgraded and then run.

What is react gradle?

A Gradle Plugin used to support development of React Native applications for Android.

Could not read script react gradle as it does not exist?

Could not read script '…/node_modules/react-native/react. gradle' as it does not exist. This happens while you cloning your project and trying to run the project. The solution is simple just run command npm install in your project folder.


2 Answers

Go to the project's root folder and run npm install and it will generate the necessary files, including react.gradle

If you don't have node.js, you can download it from here: https://nodejs.org/en/download/

like image 197
Adam Kis Avatar answered Oct 01 '22 09:10

Adam Kis


you can do npm install

and and all the problems are over.

like image 25
Herwindra Berlian Avatar answered Oct 01 '22 09:10

Herwindra Berlian