2016-04-21 52 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