安卓嵌入react native 环境的步骤,Could not get BatchedBridge, make sure your bundle is packaged correctly问题的解决
2016-10-10 14:33
603 查看
条件: 安卓。
今天给原生嵌入react native的环境时突然就出现了这个错误。点击reload就直接说连不上服务器。
先说步骤吧。
1. 在app/build.gradle中加入依赖。compile'com.facebook.react:react-native:+'
2. 在项目的build.gradle中加入寻找依赖的途径,这里是为1中的依赖指明路径,类似是这样的
3. 在manifest中加入permission和注册弹框,
搞定,启动服务,运行项目,前提是你正确使用了ReactRootView,就能加载视图了。
4. 今天莫名其妙出了个Could not get BatchedBridge, make sure your bundle is packaged correctly的错误,看了网上很多答案,总结一下呢,其一可能是watchman的问题,其二呢是你真的启动服务了吗,好吧,反正我是启动了,还是报错,网上还有种说法是直接命令行将bundle输出到asset下,但是感觉上来说,好像不用自己命令行就能成功的,会自动从服务器上下载的,灵光一现想到了自己好像没有添加那一系列的permission..果然,加上就好了。
今天给原生嵌入react native的环境时突然就出现了这个错误。点击reload就直接说连不上服务器。
先说步骤吧。
1. 在app/build.gradle中加入依赖。compile'com.facebook.react:react-native:+'
2. 在项目的build.gradle中加入寻找依赖的途径,这里是为1中的依赖指明路径,类似是这样的
allprojects { repositories { jcenter() mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" //当项目和node_modules不在一起的时候可以使用绝对路径 } } }
3. 在manifest中加入permission和注册弹框,
<android:uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <android:uses-permission android:name="android.permission.READ_PHONE_STATE" /> <android:uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</pre><pre name="code" class="java"> <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
搞定,启动服务,运行项目,前提是你正确使用了ReactRootView,就能加载视图了。
4. 今天莫名其妙出了个Could not get BatchedBridge, make sure your bundle is packaged correctly的错误,看了网上很多答案,总结一下呢,其一可能是watchman的问题,其二呢是你真的启动服务了吗,好吧,反正我是启动了,还是报错,网上还有种说法是直接命令行将bundle输出到asset下,但是感觉上来说,好像不用自己命令行就能成功的,会自动从服务器上下载的,灵光一现想到了自己好像没有添加那一系列的permission..果然,加上就好了。
相关文章推荐
- react native 问题(mac系统) Could not get BatchedBridge, make sure your bundle is packaged correctly 问题解决
- Could not get BatchedBridge, make sure your bundle is packaged correctly问题解决
- Could not get BatchedBridge, make sure your bundle is packaged correctly 错误解决方法
- 红屏问题"Could not get BatchedBridge, make sure your bundle is packaged correctly"
- React Native 报错 Could not get BatchedBridge, make sure your bundle is packaged correctly.
- could not get batchedbridge, make sure your bundle is packaged correctly
- Could not get BatchedBridge, make sure your bundle is packaged correctly
- react-native 运行报Could not get BatchedBridge, make sure your bundle is packaged correctly 错误
- could not get batchedbridge, make sure your bundle is packaged correctly
- Could not get BatchedBridge, make sure your bundle is packaged correctly
- Could not get BatchedBridge, make sure your bundle is packaged correctly
- Could not get BatchedBridge, make sure your bundle is packaged correctly
- Could not get BatchedBridge, make sure your bundle is packaged correctly
- Could not get BatchedBridge, make sure your bundle is packaged correctly
- React-native 常见错误:Could not get BatchedBridge, make sure your bundle is packaged correctly
- Could not get BatchedBridge, make sure your bundle is packaged correctly
- could not get batchedbridge, make sure your bundle is packaged correctly
- Could not get BatchedBridge, make sure your bundle is packaged correctly
- Could not get BatchedBridge, make sure your bundle is packaged correctly
- React-Native:解决真机调试时候Could not get BatchedBridge, make sure your bundle is packaged properly