gpt4 book ai didi

android - Phonegap 构建错误(phonegap 构建 android 命令)

转载 作者:行者123 更新时间:2023-11-29 14:47:13 26 4
gpt4 key购买 nike

我想安装 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 server\100\tools\binn\;c:\program files\microsoft sql server\100\tools\binn\;c:\program files\microsoft sql server\100\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

最佳答案

终于找到了答案。

首先,新版phonegap中有一个问题被提到here . (检查接受的答案)

然后www\config.xml 文件中,替换为:

<preference name="android-minSdkVersion" value="7" />

有了这个:

<preference name="android-minSdkVersion" value="10" />

关于android - Phonegap 构建错误(phonegap 构建 android 命令),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31300829/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com