Harshal Kalavadiya
Harshal Kalavadiya

Reputation: 2436

Not able to make release APK React Native Android app

i want to make release for android application in react native so when i generate build i got below error message like

Error:Execution failed for task ':app:bundleReleaseJsAndAssets'.

A problem occurred starting process 'command 'node''

see attachment also

enter image description here

any idea how can i solve this ? your all suggestions are appreciable

Upvotes: 1

Views: 6862

Answers (3)

user3880451
user3880451

Reputation: 31

Add the below following code in app/build.gradle at the end of the file.

 afterEvaluate{
    android.applicationVariants.all { variant ->
        variant.ext.bundleJsAndAssets.enabled = false
     }
   }

Upvotes: 2

omprakash8080
omprakash8080

Reputation: 1391

After spending 2 days I resolved it, Please follow the below steps:-

1) Stop Running Gradle

 $ cd RectNatoveProjectName & cd android  (Open your project and go to android folder)  
 $ ./gradlew --stop (Run this command to stop old running Gradle service )

2) Update the android app build gradle

project.ext.react = [
        nodeExecutableAndArgs : ["/usr/local/bin/node"]
];

3) Get Node details

$ which node 

> (Result will be like "/usr/username/.nvm/versions/node/v10.7.0/bin/node")

4) Link node (very imp step copy the above result in step 3)

- ln -s /usr/username/.nvm/versions/node/v10.7.0/bin/node /usr/local/bin/node

5) If Step - 4 return file exist - then to go the folder /usr/local/bin/ and delete the "node" file and perform the step -4 again.

6) If Step - 4 run successfully then this node issue will be resolved.

Upvotes: 10

Sandy.....
Sandy.....

Reputation: 2870

It can have following possible solutions:
1] You need to change the node executable path in your build.gradle(i.e android/app/build.gradle) file as follows:

project.ext.react = [
        nodeExecutableAndArgs : ["/usr/local/bin/node"]
];

Or
2] You need to close your Android Studio and need to run below command from project root directory:

cd android
./gradlew assembleRelease

Or
3] You need to simply run "./gradlew --stop" command and then run "./gradlew assembleRelease" command

Upvotes: 0

Related Questions