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


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

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


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

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

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

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

 

解決方法:

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

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

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

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"

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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM