注意項目名稱要與將來android加載RN名稱一致
curl -o .flowconfig https://raw.githubusercontent.com/facebook/react-native/master/.flowconfig 在android根目錄下生成.flowconfig文件作用于flow主要用來做靜態代碼檢查。
“start”: “node node_modules/react-native/local-cli/cli.js start”
compile”com.facebook.react:react-native:+”,(+號代表使用最新版本)

在項目的根目錄下的build.gradle中修改 

按照慣例會出現如下錯誤:Could not get BatchedBridge, make sure your bundle is packaged correctly 百度會有解決辦法。 解決辦法如下,在android項目中創建assets目錄,在根目錄命令行輸入如下命令
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output cubecare4.0/src/main/assets/index.android.bundle --assets-dest cubecare4.0/src/main/res/
 會在assets目錄下生產如下文件 


在開發者菜單中點擊 Debug JS Remotely 
如果系統安裝Chrome瀏覽器會出現如下頁面

根據提示Ctrl+Shift+J打開開發者模式,在Sources中找到index.android.js文件進行斷點調試

新聞熱點
疑難解答