无法通过USB在我的手机中运行react-native app

时间:2017-07-18 08:59:17

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

我做了以下官方链接中所解释的内容。

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中运行我的本机应用程序。

1 个答案:

答案 0 :(得分:0)

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

用于mac使用此功能 Setting ANDROID_HOME enviromental variable on Mac OS X

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