简体   繁体   English

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

[英]Not able to run react-native app in my mobile through usb

I did what ever explained in the below official link. 我做了以下官方链接中解释过的事情。

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

The device is connected and said to trust my connected computer. 设备已连接,并说要信任我连接的计算机。

But when I run react-native run-android it says 但是当我运行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.

So, I googled a lot to get it done. 所以,我用大量的Google搜索来完成它。 Later a solution asked me to create local.properties file and paste sdk.dir = /home/abc/androidsdk/sdk . 后来一个解决方案要求我创建local.properties文件并粘贴sdk.dir = /home/abc/androidsdk/sdk Then I am facing this issue. 然后我面对这个问题。

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

The only thing I want is, running my react-native app in my lenova k4 note mobile. 我唯一想要的就是在lenova k4 note mobile中运行我的react-native应用程序。

You are getting this issue because ANDROID_HOME variable is not set to PATH for setting path variable 您正在收到此问题,因为未将ANDROID_HOME变量设置为PATH来设置路径变量

for mac use this Setting ANDROID_HOME enviromental variable on Mac OS X 对于Mac, 在Mac OS X上使用此Setting ANDROID_HOME环境变量

for windows Error: ANDROID_HOME is not set and "android" command not in your PATH. 对于Windows 错误:未设置ANDROID_HOME,并且PATH中未包含“ android”命令。 You must fulfill at least one of these conditions. 您必须至少满足以下条件之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM