解决:
xcode Product->Scheme->Manage Schemes click '+' at the Target to select "React" and set the React is shared.
stackoverflow上 mark 的答案。
编译完成后,手机App上出现: Connection to http://localhost:8081/debugger-proxy?role=client xxxxxx
在电脑上启动 Packer server, npm start
RN app 连上 bundle server后,会自动打开一个 debug-ui
的页面,这个页面可用于断点调试。如果刷新这个页面则会出现这个问题。
解决方案 reload
几次. (有时候1次不能成功, stupid)
RN的debug原理:1, 2
watchman watch-del-all
rm -rf node_modules && cnpm i
npm start -- --reset-cache
Could not get BatchedBridge, make sure your bundle is packaged correctly,
failed to call function, _fbBatchedBridge is undefined
重装依赖,重置ios android项目后解决。
用 yarn 安装依赖,否则会有各种莫名其妙的问题。
rm -rf node_modules
rm -rf ios
rm -rf android
yarn install
react-native upgrade
这是RN的bug到现在都没有解决。。。。。。。。。惊呆了。 facebook/react-native#12830
facebook/react-native#21530 (comment)
Build input file cannot be found: '....../node_modules/react-native/third-party/double-conversion-1.1.6/src/strtod.cc'
$ cd node_modules/react-native/scripts && ./ios-install-third-party.sh && cd ../../../
$ cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh && cd ../../../../
清空watchman 缓存,重装依赖得到解决。
watchman watch-del-all
rm -rf node_modules
yarn install
npm start -- --reset-cache
打开应用的 悬浮窗
权限
// 删除下面这个目录,可以临时的解决问题
rm -rf node_modules/react-native/third-party
细查发现 ip.txt 没有生成。再查发现有一个 bug 虽然修复了,但是没有release。
SKIP_BUNDLING
选项本来是用于防止开发包打包的,但是他的副作用是 ip.txt 不生成了。