Jonathan Sloan
Jonathan Sloan

Reputation: 33

CordovaJS - ERROR: Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 19 declared in

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)

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" /> 

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

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

As well as instructed Cordova to build specific versions:

cordova platform add [email protected]

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

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.

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)

Upvotes: 1

Views: 946

Answers (1)

Felipe Guerrero
Felipe Guerrero

Reputation: 66

What worked for me was, first

remove android platform

ionic cordova platform remove android

then add the android platform as follows

ionic cordova platform add android@nightly  

Upvotes: 2

Related Questions