2016-04-21 61 views
0

我试图在Android上运行一个非常简单的React Native应用程序,但构建不断失败。该版本没有给出任何错误,并且run-ios工作得很好。反应原生android编译失败,没有例外

$ react-native run-android JS server already running. Building and installing the app on the device (cd android && ./gradlew installDebug... 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

我OSX上运行,并试图部署到三星Galaxy S6的应用程序,它是adb devices名单上。还尝试将ANDROID_HOME变量设置为我的.bash_profile并更新构建工具,但这些都没有帮助。

如果有人能帮我解决这个问题,我会很高兴。

回答

0

将gradle版本更改为1.2.3。

File android/build.gradle 
modify this line: classpath 'com.android.tools.build:gradle:1.2.3' 
+0

试图做到这一点,但它并没有帮助在这种情况下。仍然有同样的问题。 – Pyryn

+0

你能用'adb shell'在设备上获得一个shell吗?在手机上启用了USB调试吗? – duketwo

+0

'adb shell'工作正常,并且usb-debugging已启用,并且mac已在设备上授权。而且我实际上可以在手机上运行本地Android项目和Cordova项目。所以React Native是我遇到问题的唯一框架。 – Pyryn