首页 > 其他 > 详细

React native开发中常见的错误

时间:2016-08-16 18:43:56      阅读:232      评论:0      收藏:0      [点我收藏+]

react native环境搭建请移步:react native环境搭建

这里说说react native创建完成之后,运行中出现的常见问题,

问题1:

java.lang.RuntimeException: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.


这个是原因是工程找不到我们的android SDK。

解决方法:在工程的根目录下的android文件下新建一个local.properties的文件(我们可以直接拷贝Android项目的local.properties的文件)。

技术分享

问题2:

A problem occurred configuring project ‘:app‘.>failed to find Build Tools revision 23.0.1

这个是因为Build Tools revision 23.0.1和我们的sdk里面的版本不一致导致的。

解决方法:这里注意build.gradle和gradle中gradle-wrapper.properties的对应关系。

技术分享

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

这个是因为未找到运行的设备

解决方法:注意在运行命令:react-native run-android之前一定要确保手机已经连接上电脑。

4,com.android.ddmlib.InstallException: Failed to establish session

这是小米手机调试的问题,我之前用魅族就没这问题

解决方法:小米手机设置里-------开发者选项---------启用MIUI优化关闭

技术分享技术分享



React native开发中常见的错误

原文:http://blog.csdn.net/xiangzhihong8/article/details/52223578

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!