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 I run same app in virtual device with react-native run-android, app is working fine without any troubles. Any ideas?
"dependencies": {
"react": "16.2.0",
"react-native": "0.52.0",
"react-navigation": "^1.0.0-beta.27"
},
"devDependencies": {
"babel-jest": "22.1.0",
"babel-preset-react-native": "4.0.0",
"jest": "22.1.1",
"react-test-renderer": "16.2.0",
"util": "^0.10.3"
},
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.
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