2017-02-02 187 views

回答

0

我剛剛發現,爲什麼我的react-native應用程序不會構建捆綁js,因爲守望者以及卸載了以前的守望者和安裝新的watchman.It正確工作,謝謝。
使用以下代碼。

$ 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 
6

您的屏幕截圖啓動服務器以進行反應本機調試。

調試模式下的應用程序將指向此服務器js,然後您可以更改您的代碼以便調試。

如果你要打包的包文件,你可以使用以下命令:

安卓

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

+0

謝謝兄弟,但這是由於看守。我終於修好了。 –