亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

unable to load script from assets index.android.bundle

解決如下

unable to load script from assets index.android.bundle

This issue helped me resolve the problem in following steps.

(in project directory) mkdir android/app/src/main/assets

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

現在每次修改代碼真機上看效果都需要下面這兩步

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

怎么回事?。空l告訴下怎么解決,多謝


正在回答

2 回答

現在android項目app/src/main里建一個assets文件夾,在使用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 命令執行后的效果就是這樣,就能運行了。我是用真機調試的

https://img1.sycdn.imooc.com//5ae187fb000123f804960670.jpg?

0 回復 有任何疑惑可以回復我~
#1

楊曉龍0

在MainApplication 有這么和方法, @Override protected String getJSMainModuleName() { return "index"; } 調用js的模塊才能調用assets最新的index.android.bundle文件才能看到修改的內容
2018-04-27 回復 有任何疑惑可以回復我~

這個你初始化的代碼是不是就一個index.js

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
ReactNative入門與進階
  • 參與學習       70462    人
  • 解答問題       168    個

React Native跨平臺技術入門與進階

進入課程

unable to load script from assets index.android.bundle

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號