React Native官方的测试程序踩坑

React Native官方的测试程序 AwesomePreject可能会出现编译失败


Could not install the app on the device, read the error above for details.

Make sure you have an Android emulator running or a device connected and have

set up your android development environment:

https://facebook.github.io/React-native/docs/android-setup.html




可能的原因有:

1.ANDROID_HOME环境变量配置有问题,或者是PATH配置错了;


2.当前使用的SDK版本太低,把

Android SDK Tool,

Android SDK Platform-tools,

Android SDK Build-tools,

Android Support Repository等升级到最高版本;


3.虚拟机(物理机)没有打开,或者没有连接,使用 adb devices命令行可以查看;

前三种可以参考 

http://reactnative.cn/docs/0.47/getting-started.html#content

https://facebook.github.io/react-native/docs/getting-started.html

https://stackoverflow.com/questions/38685267/react-native-android-build


4.文件夹AwesomeProject是只读文件,这种情况是因为在调用react-native init AwesomeProject指令初始化程序的时候,使用的是管理员权限打开的cmd,这种情况下把文件夹AwesomeProject删掉,使用普通模式打开cmd进行操作就可以顺利的运行出结果。


ps:愚蠢的我遇到的是第四种情况

欢迎大家补充遇到的问题,以及解决方法。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值