2016-08-30 54 views
0

我已經安裝react-native並且已經能夠使用android-studio部署我的應用程序。但是,當我嘗試使用react-native run-android它給了我下面的錯誤部署:無法在Genymotion仿真器上測試應用程序

Starting JS server... 
Running /home/leo/Android/Sdk/platform-tools/adb reverse tcp:8081 tcp:8081 
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 

我已經使用Android SDK管理器安裝成功android-sdk-tools v25.1.7android-sdk-platform-tools v24.0.2android-sdk-build-tools v23.0.1

我可以用Genymotion部署仿真器,它使用adb devices我可以看到,它提供了以下的輸出:

List of devices attached 
192.168.56.101:5555 device 

我還能做什麼用react-native run-android在我的Android模擬器部署?

回答

1
  1. 您可能會檢查android/gradlew上的權限。
  2. 它應該是755而不是644.
  3. run chmod 755 android/gradlew在您的應用根文件夾中。
  4. 然後運行react-native run-android,它應該再次工作。
+0

謝謝,它對我有用:)) – nguyencse

0

問題可能是您的設備在genymotion中的API比您的android sdk構建工具api 23低,因爲您在安裝react native之前已經添加了它。 嘗試:

  1. 在genymotion添加新設備
  2. 具有API 23
  3. 安裝後選擇設備,啓動設備
  4. 重新運行代碼。
相關問題