Source:  Twitter logo

I have used following command to run but index.android.bundle not getting.

react-native run-android 
react-native start

http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false

This is not giving me the package bundle js what to do. and It's been a couple of days i stock in this problem i could not get help.

Below is the screencast of my code:

Thanks in Advance!

Your screenshot starting the server for react native debug.

The app in the debug mode will point to this server js then you can change your code for debug easily.

If you want to package the bundle file you can use these commands:

Android:

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/

IOS:

react-native bundle --platform ios --dev false --assets-dest ./ios --entry-file index.ios.js --bundle-output ios/main.jsbundle

10 users liked answer #0dislike answer #010
chanjianyi profile pic
chanjianyi

Got Solution For me:

Go to your project directory and check if this folder exists android/app/src/main/assets

i) If it exists then delete two files viz index.android.bundle and index.android.bundle.meta

ii) If the folder assets doesn’t exist then create the assets directory there.

  1. From your root project directory do

    cd android

    ./gradlew clean

  2. Finally, navigate back to the root directory and check

i) If there is only one file i.e. index.js then run following command

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

NOTE: That is one single command.

ii) If there are two files i.e index.android.js and index.ios.js then run this:

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

This is a single command too!

  1. Now run react-native run-android

Found Solution from this url, Click here to Check

4 users liked answer #1dislike answer #14
Khushboo Tahir profile pic
Khushboo Tahir

I have just found why my react-native application is not building bundle js because of watchman and after uninstall previous watchman and installing new watchman.It working correctly thanks.
Using Following Code.

$ git clone https://github.com/facebook/watchman.git
$ cd watchman/
$ git checkout v4.7.0
$ sudo apt-get install -y autoconf automake build-essential python-dev
$ ./autogen.sh 
$ ./configure 
$ make
$ sudo make install

$ watchman --version
$ echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches  && echo 999999 | sudo tee -a  /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee  -a /proc/sys/fs/inotify/max_user_instances && watchman  shutdown-server
0 users liked answer #2dislike answer #20
Dinesh Katwal profile pic
Dinesh Katwal

Copyright © 2022 QueryThreads

All content on Query Threads is licensed under the Creative Commons Attribution-ShareAlike 3.0 license (CC BY-SA 3.0).