1

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:

enter image description here

Thanks in Advance!

3 Answers 3

10

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

Sign up to request clarification or add additional context in comments.

2 Comments

thanks bro but it is due to watchman. and i have finally fixed it.
@chajianyi Thank you so much... Just one command change my life.... I tried to solve this issue last 3-4 days. Android command will solve my problem. Thanks you so much...
4

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

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.