Phonegap 构建错误(phonegap 构建 android 命令)
Phonegap build error (phonegap build android command)
我想安装 phonegap,但在构建过程中遇到了一些错误。 (我已经安装了jdk、git、node.js、apache-ant、android studion、sdk和sdk manager并设置了环境变量)
:processDebugManifest
C:\my_first_app\platforms\android\AndroidManifest.xml:15:5 Error:
uses-sdk:minSdkVersion 7 cannot be smaller than version 10 declared in l
ibrary C:\my_first_app\platforms\android\build\intermediates\exploded-aar\androi
d\CordovaLib\unspecified\debug\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="org.apache.cordova" to force usag
e
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugManifest'.
>
Manifest merger failed : uses-sdk:minSdkVersion 7 cannot be smaller than version
10 declared in library C:\my_first_app\platforms\android\build\intermediates\ex
ploded-aar\android\CordovaLib\unspecified\debug\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="org.apache.cordova" to force usag
e
* Try:
Run with
--stacktrace option to get the stack trace. Run with --info
or --debug
option to get more log output.
BUILD FAILED
Total time: 47.884 secs
C:\my_first_app\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\my_first_app\platforms\androi
d\gradlew cdvBuildDebug -b C:\my_first_app\platforms\android\build.gradle -Dorg.
gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\Cebit\AppData\Roaming\npm\node_modules\ph
onegap\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:1
34:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
在系统属性 -> 环境变量中:
path
变量为:
C:\Program Files (x86)\Silverfrost\FTN95;C:\Program Files (x86)\ActiveState Komodo IDE 8\;%systemroot%\system32\windowspowershell\v1.0\;%systemroot%\system32\wbem;%systemroot%\system32;c:\progra~2\egcs\bin;c:\program files (x86)\microsoft sql server0\tools\binn\;c:\program files\microsoft sql server0\tools\binn\;c:\program files\microsoft sql server0\dts\binn\;%systemroot%;%QUARTUS_ROOTDIR%\bin;C:\Program Files (x86)\MATLAB\R2010a\runtime\win32;C:\Program Files (x86)\MATLAB\R2010a\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;%JAVA_HOME%\bin;%ANT_HOME%\bin;%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
你的错误日志说你正在使用 uses-sdk:minSdkVersion=7
改成10或者更好,我推荐14
uses-sdk:minSdkVersion=10
它会将您的 Android SDK 级别设置为 10(姜饼)。
什么是 use-sdk:minSdkVersion?按照这个 link.
终于找到答案了
首先,提到的新版phonegap有一个问题。 (检查接受的答案)
然后在www\config.xml
文件中,替换为:
<preference name="android-minSdkVersion" value="7" />
有了这个:
<preference name="android-minSdkVersion" value="10" />
我想安装 phonegap,但在构建过程中遇到了一些错误。 (我已经安装了jdk、git、node.js、apache-ant、android studion、sdk和sdk manager并设置了环境变量)
:processDebugManifest
C:\my_first_app\platforms\android\AndroidManifest.xml:15:5 Error:
uses-sdk:minSdkVersion 7 cannot be smaller than version 10 declared in l
ibrary C:\my_first_app\platforms\android\build\intermediates\exploded-aar\androi
d\CordovaLib\unspecified\debug\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="org.apache.cordova" to force usag
e
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugManifest'.
>
Manifest merger failed : uses-sdk:minSdkVersion 7 cannot be smaller than version
10 declared in library C:\my_first_app\platforms\android\build\intermediates\ex
ploded-aar\android\CordovaLib\unspecified\debug\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="org.apache.cordova" to force usag
e
* Try:
Run with
--stacktrace option to get the stack trace. Run with --info
or --debug
option to get more log output.
BUILD FAILED
Total time: 47.884 secs
C:\my_first_app\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\my_first_app\platforms\androi
d\gradlew cdvBuildDebug -b C:\my_first_app\platforms\android\build.gradle -Dorg.
gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\Cebit\AppData\Roaming\npm\node_modules\ph
onegap\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:1
34:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
在系统属性 -> 环境变量中:
path
变量为:
C:\Program Files (x86)\Silverfrost\FTN95;C:\Program Files (x86)\ActiveState Komodo IDE 8\;%systemroot%\system32\windowspowershell\v1.0\;%systemroot%\system32\wbem;%systemroot%\system32;c:\progra~2\egcs\bin;c:\program files (x86)\microsoft sql server0\tools\binn\;c:\program files\microsoft sql server0\tools\binn\;c:\program files\microsoft sql server0\dts\binn\;%systemroot%;%QUARTUS_ROOTDIR%\bin;C:\Program Files (x86)\MATLAB\R2010a\runtime\win32;C:\Program Files (x86)\MATLAB\R2010a\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;%JAVA_HOME%\bin;%ANT_HOME%\bin;%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
你的错误日志说你正在使用 uses-sdk:minSdkVersion=7 改成10或者更好,我推荐14
uses-sdk:minSdkVersion=10
它会将您的 Android SDK 级别设置为 10(姜饼)。
什么是 use-sdk:minSdkVersion?按照这个 link.
终于找到答案了
首先,提到的新版phonegap有一个问题
然后在www\config.xml
文件中,替换为:
<preference name="android-minSdkVersion" value="7" />
有了这个:
<preference name="android-minSdkVersion" value="10" />