1
我在用PhoneGap嘗試一個簡單的HelloWorld。我是新設立的依賴關係,不清楚錯誤是否在我的設置中。同一個項目在iOS中運行,不在Android中運行。PhoneGap項目:在Android中破解,在iOS中工作。 (終端中的Gradle錯誤 - Android Studio中的損壞管道)
我已經採取下列步驟操作:
- 安裝Java7 JDK
- 已安裝Android 2.1.2工作室
已安裝Android的SDK:
的Android工作室>首選項>外觀&行爲>系統設置> Android SDK:通過Android 4.0.3(IceCreamSandwich)從Android 6.X(N)中選擇
設置路徑,以啓用Android SDK:
sudo nano /etc/paths
/Users/(username)/Library/Android/sdk
/Users/(username)/Library/Android/sdk/tools
創建
phoneGap
應用程序 - 爲簡便起見,張貼鏈接,而不步驟: http://phonegap.com/getstarted/
結果:
- 成功運行帶有Xcode模擬器的PhoneGap iOS項目。
- 通過PhoneGap移動應用程序成功運行PhoneGap iOS項目w/iPhone。 。
- 不成功與插上仿真器(Genymotion)或設備上運行的Android項目
錯誤在終端:
Error: Error code 1 for command: /Users/Christina/Desktop/phoneGapHelloWorld/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/Christina/Desktop/phoneGapHelloWorld/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
錯誤Android Studio中的事件日誌:
8:58:21 AM Adb connection Error:EOF
8:58:21 AM Connection attempts: 1
8:58:22 AM Connection attempts: 2
8:58:23 AM Connection attempts: 3
8:58:30 AM Broken pipe
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:69)
at sun.nio.ch.IOUtil.write(IOUtil.java:40)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:336)
at com.android.ddmlib.JdwpPacket.write(JdwpPacket.java:179)
at com.android.ddmlib.Client.send(Client.java:654)
at com.android.ddmlib.jdwp.JdwpAgent.send(JdwpAgent.java:92)
at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap.java:349)
at com.android.ddmlib.Client.requestAllocationStatus(Client.java:517)
at com.android.ddmlib.DeviceMonitor.createClient(DeviceMonitor.java:573)
at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:545)
at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:361)
at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:65)
at com.android.ddmlib.DeviceMonitor$1.run(DeviceMonitor... (show balloon)