注意项目名称要与将来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文件进行断点调试
新闻热点
疑难解答