react-native遇到的问题
2017-09-05 23:12
337 查看
1、有时候设备找不到,有可能是端口占用,关掉占用端口
2、在命令行界面运行react-native run-android时出现以下问题
原因,因为我的AS也用,把AS关掉就可以了
3、android studio中导入rn项目中的android文件,运行后报错:unable to load script from assets 'index.android bundle' ,make sure your bundle is packaged correctly or youu're runing a
packager server
解决方案:
第一步:在 android/app/src/main 目录下创建一个 assets空文件夹
第二步:执行 下面这段命令
[plain] view
plain copy
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
会发现 assets文件夹下多出两个文件
第三步:重新run程序,就可以了。
这个index.android.bundle毫无疑问就是用来调用原生控件的js脚本,每次当你改变了 index.android.js,你都需要使用上面的代码片段,来及时的更新index.android.bundle,然后打包才可以把新的index.android.js应用上,所以当没有index.android.bundle文件时,RN是无法运行的.
2、在命令行界面运行react-native run-android时出现以下问题
原因,因为我的AS也用,把AS关掉就可以了
3、android studio中导入rn项目中的android文件,运行后报错:unable to load script from assets 'index.android bundle' ,make sure your bundle is packaged correctly or youu're runing a
packager server
解决方案:
第一步:在 android/app/src/main 目录下创建一个 assets空文件夹
第二步:执行 下面这段命令
[plain] view
plain copy
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
会发现 assets文件夹下多出两个文件
第三步:重新run程序,就可以了。
这个index.android.bundle毫无疑问就是用来调用原生控件的js脚本,每次当你改变了 index.android.js,你都需要使用上面的代码片段,来及时的更新index.android.bundle,然后打包才可以把新的index.android.js应用上,所以当没有index.android.bundle文件时,RN是无法运行的.
相关文章推荐
- 在react-native中引入antd-mobile遇到的问题
- React Native 之安装过程及遇到的问题
- React-native android 启动遇到的问题
- React-Native 运行demo遇到的相关问题(持续更新)
- React-Native android在windows下遇到的问题
- react native中遇到的问题
- react-native 热更新react-native-pushy集成遇到的问题
- 关于react-native 运行项目中遇到could not connect to development server的问题
- react-native android打包签名release版apk遇到的问题
- iOS ReactNative环境配置搭建安装React-Native遇到的问题
- React-Native遇到问题集锦
- react-native编写过程遇到的问题及解决方法
- react-native添加react-native-vector-icons插件android遇到的问题
- react native 嵌入原生 遇到的问题,以及解决
- react-native里TextInput遇到的一些问题及解决方案
- React Native项目遇到的问题 -> 端口号修改
- 运行react-native 可能遇到的问题
- React-native打包遇到问题:Could not get BatchedBridge
- react native 遇到的各种问题
- React Native项目遇到的问题 -> 端口号修改