Mac环境下的React-Native环境配置流程(主要解决问题Could not install the app on the device)
2017-02-18 00:05
891 查看
Mac环境下的React-Native环境配置流程(主要解决问题Could not install the app on the device)
纯属记录,如有雷同纯属巧合(真不害臊~(@^_^@)~)建议搭建环境时直接到RN中文网,这里给个链接地址:
https://reactnative.cn/docs/0.41/getting-started.html#content
搭建完环境后按RN中文网的操作流程创建一个RN项目,命令如下
(1)创建项目:react-native init AwesomeProject
(2)进入根目录:cd AwesomeProject
(3)运行至Android模拟器:react-native run-android
(4)运行至IOS模拟器:react-native run-ios
这里运行react-native run-android可能会有个坑,这个坑,我折腾一下午左右的时间才搞定。。。。实际问题很简单,只是自己太笨,原因就是没有配置Android SDK环境变量。
错误如下:
这里提示你有两种解决方案:
1、在AwesomeProject/android目录下添加local.properties配置文件(不推荐,RN中文网的晴明大神指出local文件岂不是害人 他配他的 你配你的 谁下下来运行都是个错。这句话说的太对了,每个人的机子的sdk路径都不同,如果把这个local文件放到项目中,别人下载了就用不了,所以这里推荐第二种方案)。
2、在环境变量中配置,我这里也给一个配置的链接:http://blog.csdn.net/SpiderBoy_Bob/article/details/50480060
这里报的错误实在是无语了,无法连接你的模拟器,我前面以为adb没启动,原来是sdk环境变量的问题。希望你们不要走我这个弯路!
如有问题请指出,谢谢!
相关文章推荐
- ReactNative Could not install the app on the device(Mac OS环境)
- ReactNative Could not install the app on the device
- react-native 启动服务器时候报错Could not install the app on the device, read the error above for details.
- Could not install the app on the device, read the error above for details. Make sure you have an And
- Could not install the app on the device, read the error above for details. Make sure you have an And
- “The library 'aaa.jar' contains native libraries that will not run on the device.”问题解决
- react native 问题(mac系统) Could not get BatchedBridge, make sure your bundle is packaged correctly 问题解决
- Starting the application on Mac does not work(拷贝platforms到不同的位置,才能解决问题),还可设置DYLD_PRINT_LIBRARIES=1 观察动态库
- The library 'xx.jar' contains native libraries that will not run on the device解决办法
- Windows版本搭建安装React Native环境配置 count not find tools.jar问题
- 解决linux下chrome NVIDIA: could not open the device file /dev/nvidia0 Operation not permitted 问题
- mac上配置react-native环境run-ios/run-android命令遇到的问题
- The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path 问题的解决
- 04-mac中的web环境搭建tomcat7不能进行配置Could not load the Tomcat server configuration
- react-native 解决“Could not get BatchedBridge...” 的问题
- react-native 解决Could not find method android() for arguments问题
- Ubuntu Apache2重启提示could not reliably determine the server’e fully…问题解决
- 解决 Gradle 2.0后 : Could not find property 'Compile' on root project 的问题
- Oracle 10g ORA-12154: TNS: could not resolve the connect identifier specified 问题解决!
- 解决Failed to execute goal on project ***-***: Could not resolve dependencies for project com 问题