创建React Native项目

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lixuce1234/article/details/70240229

React native安装,配置点击打开链接

创建React native项目请点击这里 

创建React native遇到的问题点击打开链接



1.  react-native init MyTest(自己的项目名称)  

最后会显示:

To run your app on iOS:
   cd D:\Users\XXX\MyTest
   react-native run-ios
   - or -
   Open ios\MyTest.xcodeproj in Xcode
   Hit the Run button
To run your app on Android:
   cd D:\Users\XXX\MyTest
   Have an Android emulator running (quickest way to get started), or a device connected
   react-native run-android

若此时输入react-native run-android 会有Command `run-android` unrecognized. Make sure that you have run `npm install` and that you are
 inside a react-native project.的错误。

2. cd 自己项目下 然后输入 

 npm install
3.启动Android
react-native run-android
在浏览器中输入http://localhost:8081/index.android.bundle?platform=android 会显示一长串的json代码。

可能遇到的问题:

如果android系统是5.0以下

1.Could not get BatchedBridge, make sure your bundle is package correctly.

Dev Settings->Debug server host & port for device 修改IP为 充当服务器的PC的ip地址:8081(!!!)。




上面是我的微信公共号 每天都会给大家分享最新的知识点,欢迎大家的加入


猜你喜欢

转载自blog.csdn.net/lixuce1234/article/details/70240229