【问题标题】:Not able to run react-native app in my mobile through usb无法通过 USB 在我的手机中运行 react-native 应用程序
【发布时间】:2017-07-18 08:59:16
【问题描述】:

我做了以下官方链接中解释过的事情。

https://facebook.github.io/react-native/docs/running-on-device.html

设备已连接并表示信任我连接的计算机。

但是当我运行 react-native run-android 时,它会说

A problem occurred configuring project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

所以,我用谷歌搜索了很多来完成它。后来一个解决方案要求我创建 local.properties 文件并粘贴sdk.dir = /home/abc/androidsdk/sdk。然后我面临这个问题。

A problem occurred configuring project ':app'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Platform 23, Android SDK Build-Tools 23.0.1].
  Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
  Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

我唯一想要的就是在我的 lenova k4 note mobile 上运行我的 react-native 应用程序。

【问题讨论】:

标签: javascript android mobile react-native facebook-android-sdk


【解决方案1】:

您遇到此问题是因为 ANDROID_HOME 变量未设置为 PATH 以设置路径变量

对于 mac 使用这个 Setting ANDROID_HOME enviromental variable on Mac OS X

适用于窗户 Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.

【讨论】:

  • 您好,我使用的是 ubuntu 14
  • 在 ubuntu 中添加环境变量或路径变量只需 google 即可获得很多帖子
猜你喜欢
  • 1970-01-01
  • 2018-06-17
  • 2023-01-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-05-06
  • 1970-01-01
  • 2016-10-04
相关资源
最近更新 更多