美文网首页
在andriod设备运行react native项目时遇到的问题

在andriod设备运行react native项目时遇到的问题

作者: xiaoguo16 | 来源:发表于2018-11-16 11:00 被阅读0次

首次运行react native 项目,在项目中运行react-native run-android指令时,遇到了如下两个问题:

  1. SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
    解决方法:在项目中的andriod文件夹中缺少location.properties文件,在andriod文件夹中,创建该文件,并在其中写入sdk路径:
    sdk.dir=C\:\\Users\\{username}\\AppData\\Local\\Android\\Sdk
  2. Execution failed for task ':app:installDebug'. > com.android.builder.testing.api.DeviceException: No connected devices!
    解决方法:将andriod手机断开,再重新连接电脑设备即可。

相关文章

网友评论

      本文标题:在andriod设备运行react native项目时遇到的问题

      本文链接:https://www.haomeiwen.com/subject/kfgpfqtx.html