I am using React native 0.52.0 and react-native-cli 2.0.1 on my Windows PC for android development. Despite all the changes i have made. When I run react-native run-an
After trying @SmoggeR_js answer and still if you have the same problem try following (Assuming that you have created keys and already signed the apk)
build
inside android/app
folderbuild
inside android
folderrm -rf $HOME/.gradle/caches/
to delete cachebuild.gradle
--> android/app/build.gradle
apply from: "../../node_modules/react-native/react.gradle"
index.android.bundle
file from assets
folder ( android/app/src/main/assets/index.android.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
react-native run-android --variant=release
(you have to generate signed keys and all the keys should updated in the gradle file ref (https://s-pace.github.io/react-native/docs/signed-apk-android.html)In my case, deleting below line in gradle.properties solved it.
org.gradle.configureondemand = true
Assuming that you are in the right folder, try to do this:
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/
if you have index.android.js, do this instead:
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
Then just execute react-native run-android.
In your project directory, there is package.json file. You can add following code snippet in that json file under scripts:. After that you can run application using one command that is npm run android-windows
. To work fine you should add below code script.
"android-windows": "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 && react-native run-android"
enter image description here
Fix it in 3 steps:
Now your app automatically updating everytime you made changes to your codes.
Silly mistake by me that not to save edits of App.js. After Saving data will reflect :)