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項目就能成功運行了。
切換到項目根目錄下執行如下命令:
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"
執行命令的代碼如下圖所示