Could not get BatchedBridge, make sure your bundle is packaged correctly

react-native 運行android項目的時候運行成功可是模擬器上會提示:react

Could not get BatchedBridge, make sure your bundle is packaged correctly 這個錯誤,到時不能正常運行。android


在百度上搜索了這兩篇文章git

http://blog.csdn.net/b992379702b/article/details/52234479github

http://blog.csdn.net/ssksuke/article/details/52403754?locationNum=6%E3%80%81react-native

按照這兩篇文章的執行思路去執行,會出現一個問題。就是提示error: option '--entry-file' missing。(不過這兩篇文章的擦考意義比較大,要不是參考這兩篇文章我不會那麼快找到解決方法,仍是很是感謝這兩位同窗提供的方案)app

 

解決方法:curl

最後在github上了這一篇文章,運行給出的命令。android-react-native項目就能成功運行了。url

http://stackoverflow.com/questions/38870710/error-could-not-get-batchedbridge-make-sure-your-bundle-is-packaged-properly/38874952.net

切換到項目根目錄下執行以下命令:orm

react-native start > /dev/null 2>&1 & curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"

執行命令的代碼以下圖所示

相關文章
相關標籤/搜索