I get this error after building apk with ./gradlew assembleDebug. If I build apk with ./gradlew assembleRelease, I get an error on install app on mobile phone. When
Step 1: mkdir android/app/src/main/assets
Step 2: In package.json i added:
"scripts": { "bundle": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res" }
Step 3: run "npm run bundle" and in the last order
Step 4: go in android/ folder and
Step 5: run "./gradlew assembleDebug"
Weird bug, and it's still exists until now from 2015!
Here are the steps i need you to follow to solve this issue.
Delete android folder and do react-native upgrade (not react-native run-android)
create the folder in the following location.
your_app/android/app/src/main
Perform the following command in root directory. (simply copy and paste the below code)
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
Please note if you are using index.android.js then replace it in --entry-file.
and lastly
cd android && ./gradlew installDebug
Hope this solves your solution.
Try to restart node.
ps -ef | grep node | grep -v grep
and kill node processes.
It worked for me.