[英]Android build issues with cordova
I have a cordova android app that I am trying to build with android version 8.1.0.我有一个 cordova android 应用程序,我正在尝试使用 android 版本 8.1.0 构建它。
While I attempt build, I see the below error:当我尝试构建时,我看到以下错误:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 19 declared in library [:CordovaLib] C:\Users\Thejwal\Desktop\IES.InMotion.Driver_10_22_2018_V0.5\IES.InMotion.Driver\platforms\android\CordovaLib\build\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 14
Suggestion: use a compatible library with a minSdk of at most 14,
or increase this project's minSdk version to at least 19,
or use tools:overrideLibrary="org.apache.cordova" to force usage (may lead to runtime failures)
After checking out a number of threads describing the same issue, I could see that the issue seems to be with the minsdkvalue.在检查了许多描述相同问题的线程后,我可以看到问题似乎与 minsdkvalue 有关。
I can see the below in the platforms/android/build.gradle file:我可以在platforms/android/build.gradle 文件中看到以下内容:
allprojects {
repositories {
google()
jcenter()
}
//This replaces project.properties w.r.t. build settings
project.ext {
defaultBuildToolsVersion="28.0.3" //String
**defaultMinSdkVersion**=19 //Integer - Minimum requirement is Android 4.4
defaultTargetSdkVersion=28 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=28 //Integer - We ALWAYS compile with the latest by default
}
}
There is another build.gradle in the app folder. app文件夹中还有另一个build.gradle。 I cant see any minsdkversion there.我在那里看不到任何 minsdkversion。
Can somebody please help me to understand what the error message means and how I can resolve it?有人可以帮我理解错误消息的含义以及如何解决吗?
You should try to override your manifest using, in config.xml您应该尝试使用 config.xml 覆盖您的清单
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="28" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.