Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cordova Build minSdkVersion change to 19 #498

Closed
sandeep2244 opened this issue Sep 14, 2018 · 5 comments
Closed

Cordova Build minSdkVersion change to 19 #498

sandeep2244 opened this issue Sep 14, 2018 · 5 comments
Labels

Comments

@sandeep2244
Copy link

Hello,

I have android version 7.1.1 in my project

after adding android i build project using "cordova Build" command

And i got following error

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

:app:processDebugManifest FAILED

    uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:CordovaLib] C:\Users\trikonuser\TestAgain\WebCall_AS_tsim\webCall\platforms\android\CordovaLib\build\ intermediates\manifests\full\debug\AndroidManifest.xml as the library might be using APIs not available in 16

    Suggestion: use a compatible library with a minSdk of at most 16,

            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)

Now magic is in my files
www/config.xml and xml/config.xml

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

and main/AndroidManifest.xml file I have put
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="27" />

While My gradle file also contain

project.ext {

defaultBuildToolsVersion="27.0.1" //String
defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default
}

### BUT NOW I RUN COMMAND :- CORDOVA BUILD it changes all config i mad automatically to previous as follows
www/config.xml and xml/config.xml

<preference name="android-minSdkVersion" value="16" />
<preference name="android-targetSdkVersion" value="27"/>

and main/AndroidManifest.xml file I have put
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="27" />

How Cordova Build command run rechange agin to 16 if they already want to 19

I used below phonegap version
> <preference name="phonegap-version" value="cli-6.3.0" />

@janpio janpio added the support label Sep 14, 2018
@jcesarmobile
Copy link
Member

You have to edit the root config.xml, not the config.xml in xml folder. The content of xml/config.xml is recreated from the root one, that's why your changes are lost.

@chrisunderdown
Copy link

The problem for me was in cordova-plugin-browsertab.

You need to change line 1 of my_project/plugins/cordova-plugin-browsertab/src/android/BrowserTab.gradle to

def minSdkVersion = 19

Make sure you have the minimum SDK added to your config.xml

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

Then remove and add cordova-android by:

cordova platform remove android
cordova platform add android

@starchild92
Copy link

The problem for me was in cordova-plugin-browsertab.

You need to change line 1 of my_project/plugins/cordova-plugin-browsertab/src/android/BrowserTab.gradle to

def minSdkVersion = 19

Make sure you have the minimum SDK added to your config.xml

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

Then remove and add cordova-android by:

cordova platform remove android
cordova platform add android

Thanks it worked for me

@elymberopoulos
Copy link

Thanks Chris

@shanutyagi112
Copy link

firstly remove android

  • cordova platform remove android
  • cordova platform add android
  • cordova build android

@starchild92 thank You Bro.

` uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:CordovaLib] C:\Users\trikonuser\TestAgain\WebCall_AS_tsim\webCall\platforms\android\CordovaLib\build\ intermediates\manifests\full\debug\AndroidManifest.xml as the library might be using APIs not available in 16

Suggestion: use a compatible library with a minSdk of at most 16,

        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)`

Also working in this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants