我已經安裝了WebStorm和Android工作室。我有我的Android SDK和Java環境變量設置。我本來這個錯誤(https://github.com/phonegap/phonegap-cli/issues/685)和我固定,通過提取模板文件夾如該文章中提到。的PhoneGap /科爾多瓦WebStorm Ubuntu的 - 錯誤
當我運行在WebStorm的PhoneGap的示範項目,我現在得到:
BUILD SUCCESSFUL
Total time: 0.653 secs
Built the following apk(s):
/home/user/WebstormProjects/PageLoad/platforms/android/build/outputs/apk/android-debug.apk
ANDROID_HOME=/home/user/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
Error: android: Command failed with exit code 2
所以我然後再從CLI phonegap run android --verbose
和我:
Built the following apk(s):
/home/user/WebstormProjects/PageLoad/platforms/android/build/outputs/apk/android-debug.apk
No scripts found for hook "before_deploy".
ANDROID_HOME=/home/user/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
Running command: adb devices
Command finished with error code 0: adb devices
No target specified and no devices found, deploying to emulator
Running command: adb devices
Command finished with error code 0: adb devices
Running command: android list avds
Command finished with error code 2: android list,avds
Error: android: Command failed with exit code 2
at ChildProcess.whenDone (/home/user/WebstormProjects/PageLoad/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
我還試圖刪除我的android-24
目錄從$ANDROID_HOME/Sdk/platforms
和相同的結果。這實際上是我嘗試的第一件事,因爲沒有得到任何錯誤,在WebStorm中運行PhoneGap只是掛着。
PhoneGap的CLI 6.4.5
節點4.5.0
NPM 4.3.0
Android SDK工具25.3.1
您正在使用哪個cordova-android版本?你知道你的android sdk工具版本嗎? – jcesarmobile
添加要發佈的版本。您還可以看到在github上的問題我張貼,並在OP鏈接 – xendi