CordovaJS-错误:清单合并失败:uses-sdk:minSdkVersion 1不能小于版本19中声明的版本 [英] CordovaJS - ERROR: Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 19 declared in

查看:471
本文介绍了CordovaJS-错误:清单合并失败:uses-sdk:minSdkVersion 1不能小于版本19中声明的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了2天,以使我的Cordova应用程序可以为Android编译.每次我在Android Studio中打开项目时,在运行任务阶段的gradle同步过程中都会得到以下信息:

I've been trying for 2 days now to get my Cordova app to build for Android. Each time I open my project in Android Studio I get the following during gradle sync during the run tasks phase:

ERROR: Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 19 declared in library [__tested_artifact__::CordovaLib]/Users/userName/Downloads/MyApp(1.2.5)/platforms/android/CordovaLib/build/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 1

Suggestion: use a compatible library with a minSdk of at most 1, 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)

我已经查看了许多解决方案,但似乎没有一个可以解决我的问题.我已经调整了构建项目清单和cordova.android node_modules文件夹中的设置,如下所示:

I've looked through many solutions and none seem to correct my issue. I've adjusted settings in the manifests of my built project and also in the cordova.android node_modules folder as so:

<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" /> 

我已经在config.xml中添加了各种值:

I've added the various values in my config.xml:

<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="28"/>

并指示Cordova构建特定版本:

As well as instructed Cordova to build specific versions:

cordova platform add android@7.0.0

我仍然收到相同的错误,尽管即使更改了数字,值(即19和1)也没有改变.

And I still receive the same error, though the values (19 and 1, that is) don't change even when the numbers are changed.

此外,我创建了一个新的空白项目,并以相同的结果构建了该项目.同样的项目可以在我的旧机器上很好地构建,但是Play商店说它已经过时了,并且存在安全风险.

In addition, I've created a new blank project and built it with the same results. The same project builds fine on an old machine of mine, but the Play Store says that it's outdated and is a security risk.

需要注意的另一件事可能是帮助:在Cordova构建时,我在此过程中看到以下内容:

One additional thing of note that could be of help: when Cordova builds, I see the following during the process:

Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/userName/Library/Android/sdk (DEPRECATED)

推荐答案

首先为我工作的是

删除android平台

remove android platform

ionic cordova platform remove android

然后按如下所示添加android平台

then add the android platform as follows

ionic cordova platform add android@nightly  

这篇关于CordovaJS-错误:清单合并失败:uses-sdk:minSdkVersion 1不能小于版本19中声明的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆