You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/10/19 12:39:36 UTC

[GitHub] [cordova-android] prospong opened a new issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

prospong opened a new issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070


   <!--
   Please have a look at the issue templates you get when you click "New issue" in the GitHub UI.
   We very much prefer issues created by using one of these templates.
   -->
   
   ### Issue Type
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x ] Bug Report
   - [ ] Feature Request
   - [ ] Support Question
   
   ## Description
   I encountered this bug when compiling the ionic project. I have followed the instructions on the Internet to continuously modify the project.properties under "myproject/platforms/android" and the project.properties under "myproject/platforms/android/Coedovalib".
   
   But this did not take effect. When I cleared android and added android again, the same error still appeared. And, the value I changed was restored. 
   ## Information
   Execution failed for task ':app:processDebugManifest'.
   > Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in 
   library [:CordovaLib] 
   
   ### Command or Code
   
   <uses-sdk
      android:minSdkVersion="19"
      android:targetSdkVersion="29" />
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   
   
   
   ### Version information
      Ionic:
   
      Ionic CLI                     : 6.11.8 
      Ionic Framework               : @ionic/angular 5.0.4
      @angular-devkit/build-angular : 0.803.24
      @angular-devkit/schematics    : 8.1.3
      @angular/cli                  : 8.1.3
      @ionic/angular-toolkit        : 2.3.3
   
   Cordova:
   
      Cordova CLI       : 10.0.0
      Cordova Platforms : android 9.0.0
      Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 
      19 other plugins)
   
   Utility:
   
      cordova-res : 0.15.1
      native-run  : not installed
   
   System:
   
      Android SDK Tools : 26.1.1 (D:\Program Files\sdk)
      NodeJS            : v12.18.0 (D:\Program Files\nodejs\node.exe)
      npm               : 6.14.4
      OS                : Windows 10
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an `x` in the `[ ]` like so: `[x]` -->
   
   - [x] I searched for already existing GitHub issues about this
   - [ ] I updated all Cordova tooling to their most recent version
   - [ ] I included all the necessary information above
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] ebhsgit commented on issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
ebhsgit commented on issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070#issuecomment-711114270


   I understand that cordova-android 9.0 supports SDK 22 and up, and that the code is not tested against anything lower.
   
   Currently, my issue is with the `android-minSdkVersion` options is that the build results in error
   > Manifest merger failed...
   
   Which is thrown by Cordova, not due to any errors from using deprecated Java/Android SDK API
   
   How do we force the build to use a lower minSDK and ignore/bypass the error throw by Cordova?
   And I understand that I will need to test and fix issues related to any unsupported SDK APIs.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] dpogue edited a comment on issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
dpogue edited a comment on issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070#issuecomment-711113663


   > But I thought `android-minSdkVersion` is used to override that behaviour.
   > 
   > If I need to force minSdk lower than 22, how would I achieve this?
   
   You can use `android-minSdkVersion` to force a lower minSdk, but the code in cordova-android only supports SDK 22 and up. So if you are trying to target something lower, you'll probably also need to make changes to the Java code.
   
   Namely, the CordovaLib library that powers cordova-android has a minSdk of 22.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek edited a comment on issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
breautek edited a comment on issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070#issuecomment-692832726


   This is occurring because you (or a plugin) is setting the project min sdk to something lower than the cordova framework's min sdk, which for 9.x is set to 22.
   
   Do you have the `android-minSdkVersion` preference set in your `config.xml`? If so I'd suggest to increase it to 22 or remove it to allow it to default to 22.
   
   Do note that increasing the min sdk to 22 will limit your app to Android 5.1 or later.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] jcesarmobile commented on issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
jcesarmobile commented on issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070#issuecomment-697311385


   Yeah, Ionic apps used to include `<preference name="android-minSdkVersion" value="19" />` in the starters `config.xml`.
   
   It's been removed, but for apps created before that, they should also manually remove that if using cordova-android 9+ as it uses `android-minSdkVersion` 22


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] aldhamdy commented on issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
aldhamdy commented on issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070#issuecomment-776301624


   I solved the issue by declaring the Cordova android  version to 8
   
   <engine name="android" spec="8.0.0" />


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] jcesarmobile closed issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
jcesarmobile closed issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] dpogue commented on issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
dpogue commented on issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070#issuecomment-711113663


   > But I thought `android-minSdkVersion` is used to override that behaviour.
   > 
   > If I need to force minSdk lower than 22, how would I achieve this?
   
   You can use `android-minSdkVersion` to force a lower minSdk, but the code in cordova-android only supports SDK 22 and up. So if you are trying to target something lower, you'll probably also need to make changes to the Java code.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek closed issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
breautek closed issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] ebhsgit commented on issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
ebhsgit commented on issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070#issuecomment-711111544


   @breautek 
   I understand that cordova-android 9.x min sdk is 22. And the reason is due to effort involved to test vs sdk market share.
   
   But I thought `android-minSdkVersion` is used to override that behaviour.
   
   If I need to force minSdk lower than 22, how would I achieve this?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek edited a comment on issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
breautek edited a comment on issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070#issuecomment-692832726


   This is occurring because you (or a plugin) is setting the project min sdk to something lower than the cordova framework's min sdk, which for 9.x is set to 22.
   
   Do you have the `android-minSdkVersion` preference set? If so I'd suggest to increase it to 22 or remove it to allow it to default to 22.
   
   Do note that increasing the min sdk to 22 will limit your app to Android 5.1 or later.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070#issuecomment-712128530


   The problem is in the android project, we have 2 modules, the `app` module, and the `CordovaLib` module, and it looks like the preferences only changes the min sdk for the `app` module and the `CordovaLib` remains the default min sdk of 22, which is an incompatible app config.
   
   As jcesar pointed out in the dev mailing list, I think this is something that can and should be fixed so I'll reopen this ticket.
   
   To re-iterate from previous comments, this is only to keep the `CordovaLib` and `app` module min sdks in sync so it doesn't cause the gradle error. A PR that patches this is welcome.
   
   This error could still come up via third-party libraries if they define a min sdk value. Lowering the min sdk could also make your app crash during runtime when attempting to use an API that may not exists on older devices.
   
   In the meantime, this untested workaround could suffice:
   
   __config.xml__
   ```xml
   <widget ... xmlns:tools="http://schemas.android.com/tools">
       <edit-config file="AndroidManifest.xml" target="/manifest" mode="merge">
           <manifest xmlns:tools="http://schemas.android.com/tools" />
       </edit-config>
       <edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge">
           <uses-sdk tools:overrideLibrary="<packageThatNeedsToBeOverridden>" />
       </edit-config>
   </widget>
   ```
   
   Where `packageThatNeedsToBeOverridden` should be a string of a package name. I don't quite remember exactly that this is for Cordova generally the error output for min sdk mismatches states the library package name. This can be a comma delimited list if there are multiple packages to override.
   
   Lastly, I believe `<edit-config>` targeting `uses-sdk` can fail if your `AndroidManifest.xml` has no `<uses-sdk>` tag to modify. If that's the case of your app, I think you can replace it with `config-file` instead like so:
   
   ```xml
   <config-file target="AndroidManifest.xml" parent="/manifest">
       <uses-sdk tools:overrideLibrary="<packageThatNeedsToBeOverridden>" />
   <config-file>
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070#issuecomment-692832726


   This occurring because you (or a plugin) is setting the project min sdk to something lower than the cordova framework's min sdk, which for 9.x is set to 22.
   
   Do you have the `android-minSdkVersion` preference set? If so I'd suggest to increase it to 22 or remove it to allow it to default to 22.
   
   Do note that increasing the min sdk to 22 will limit your app to Android 5.1 or later.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] ebhsgit commented on issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
ebhsgit commented on issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070#issuecomment-714923226


   For others that with similar needs
   
   I was able to build by adding the following to my project's config.xml
   
   ```
           <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest">
               <manifest xmlns:tools="http://schemas.android.com/tools" />
           </edit-config>
           <config-file parent="/manifest" target="AndroidManifest.xml">
               <uses-sdk tools:overrideLibrary="org.apache.cordova" />
           </config-file>
   ```
   
   As noted by @breautek 
   ```
       <edit-config file="AndroidManifest.xml" target="/manifest" mode="merge">
           <manifest xmlns:tools="http://schemas.android.com/tools" />
       </edit-config>
       <edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge">
           <uses-sdk tools:overrideLibrary="<packageThatNeedsToBeOverridden>" />
       </edit-config>
   ```
   
   Results in error
   > Unable to graft xml at selector "/manifest/uses-sdk" from "[project path]\platforms\android\app\src\main\AndroidManifest.xml" during config install
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] DavidRiosProg commented on issue #1070: Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Posted by GitBox <gi...@apache.org>.
DavidRiosProg commented on issue #1070:
URL: https://github.com/apache/cordova-android/issues/1070#issuecomment-1047157150


   How do you access/find Cordova or config.xml?  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org