ReactNative Could not install the app on the device(Mac OS环境)
2016-11-15 15:16
531 查看
我们从github下载的ReactNative(以下简称RN)经常会出现这个错误:
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment: https://facebook.github.io/react-native/docs/android-setup.html 导致构建失败BUILD FAILED.
看到上述的命令行提示,发现他的意思是我们的安卓环境可能配置的不对,还让我们去官网看看,那好吧,咱们到官网一看,有个步骤是这样的
Set up paths
The React Native command line interface requires the
following command:
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_HOME=~/Library/Android/sdkexport
PATH=${PATH}:${ANDROID_HOME}/tools
To avoid doing this every time you open a new Terminal, create (or edit)
The second line will add the
Please make sure you export the correct path for
SDK using Homebrew, it will be located at
这个是环境相关的配置,咱们只需要这样在命令行中输入:export ANDORD_HOME = 我们的android sdk 路径(一个细节后面记得加上 sdk,这个目录才是sdk的位置,否则还是会报错,我就是忘记加这个了)
然后上面设置完成后设置到环境变量PATH中即可
export PATH = ${PATH}:${ANDROID_HOME}/tools
上述配置完成后,react-native run-android 继续运行,这个时候他会构建运行该项目的必需project,我们等待即可,这个时候如果gradle 是1.3.1,命令行中可能会出现以下错误:
com.android.ddmlib.InstallException: Unable to upload some APKs
需要将project的gradle version修改到1.2.3,可能这个版本命令行启动不了
http://blog.csdn.net/shenshibaoma/article/details/52936349 可以看下我这篇博客的介绍,有说到这个错误。
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment: https://facebook.github.io/react-native/docs/android-setup.html 导致构建失败BUILD FAILED.
看到上述的命令行提示,发现他的意思是我们的安卓环境可能配置的不对,还让我们去官网看看,那好吧,咱们到官网一看,有个步骤是这样的
Set up paths
ANDROID_HOMEenvironment variable to be set up. You can configure it in a Terminal using the
following command:
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_HOME=~/Library/Android/sdkexport
PATH=${PATH}:${ANDROID_HOME}/tools
To avoid doing this every time you open a new Terminal, create (or edit)
~/.bashrcusing your favorite text editor and add the following lines:
The second line will add the
androidtool to your path, which will come in handy in the next step.
Please make sure you export the correct path for
ANDROID_HOMEif you did not install the Android SDK using Android Studio. If you install the Android
SDK using Homebrew, it will be located at
/usr/local/opt/android-sdk.
然后上面设置完成后设置到环境变量PATH中即可
export PATH = ${PATH}:${ANDROID_HOME}/tools
上述配置完成后,react-native run-android 继续运行,这个时候他会构建运行该项目的必需project,我们等待即可,这个时候如果gradle 是1.3.1,命令行中可能会出现以下错误:
com.android.ddmlib.InstallException: Unable to upload some APKs
需要将project的gradle version修改到1.2.3,可能这个版本命令行启动不了
http://blog.csdn.net/shenshibaoma/article/details/52936349 可以看下我这篇博客的介绍,有说到这个错误。
相关文章推荐
- Mac环境下的React-Native环境配置流程(主要解决问题Could not install the app on the device)
- react-native 启动服务器时候报错Could not install the app on the device, read the error above for details.
- ReactNative Could not install the app on the device
- Could not install the app on the device, read the error above for details. Make sure you have an And
- Could not install the app on the device, read the error above for details. Make sure you have an And
- 安卓The library '*.jar' contains native libraries that will not run on the device.
- No SDKs could be found for the IOS Device Platform, did you install the command line tools on your
- App installation failed.could not write to the device.
- The library `xxx.jar` contains native libraries that will not run on the device.
- The library 'xx.jar' contains native libraries that will not run on the device解决办法
- react native生成APP报错:You have not accepted the license agreements of the following SDK components:
- “The library 'aaa.jar' contains native libraries that will not run on the device.”问题解决
- the library 'jna.jar'contains native libraries that will not run on the device
- 【iOS】Could not launch Verify the Developer App certificate for your account is trusted on your devic
- 服务器端安装ASP.NET运行环境错误Failed to execute request because the App-Domain could not be created. Error: 0x80131902
- The library 'sqlite-native-driver.jar' contains native libraries that will not run on the device.
- The library '*.jar' contains native libraries that will not run on the device
- Androi开发运行项目报异常:The library '*.jar' contains native libraries that will not run on the device
- 安卓开发 Eclipse关于 The Library 'xxx.jar' contains native libraries that will not run on the device.....
- Instant Run performed a full build and install since the installation on the device does not match t