You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2020/07/16 08:48:48 UTC
[GitHub] [cordova] rookieleader opened a new issue #229: Can't set minSdkVersion when building for Android 9.0.0
rookieleader opened a new issue #229:
URL: https://github.com/apache/cordova/issues/229
<!--
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
When trying to build debug release for android 9.0.0 it fails with a minSdkVersion message set to 21 where 22 minimum is expected although I tried almost all possible way to set it to 22 or above (Gradle.properties, Androidmanifest.xml, config xml, etc...)
## Information
Error when building :
```> Task :app:processDebugManifest FAILED
/app/logistique/platforms/android/app/src/main/AndroidManifest.xml Error:
uses-sdk:minSdkVersion 21 cannot be smaller than version 22 declared in library [:CordovaLib] /app/logistique/platforms/android/CordovaLib/build/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 21
Suggestion: use a compatible library with a minSdk of at most 21,
or increase this project's minSdk version to at least 22,
or use tools:overrideLibrary="org.apache.cordova" to force usage (may lead to runtime failures)
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than version 22 declared in library [:CordovaLib] /app/logistique/platforms/android/CordovaLib/build/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 21
Suggestion: use a compatible library with a minSdk of at most 21,
or increase this project's minSdk version to at least 22,
or use tools:overrideLibrary="org.apache.cordova" to force usage (may lead to runtime failures)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 23s
13 actionable tasks: 13 executed
```
```<?xml version="1.0"encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.apache.cordova"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="22" >
</manifest>
```
### Command or Code
Cordova build
### Environment, Platform, Device
Build for android@9.0.0
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
Other Frameworks: Ionic Framework and CLI version
Operating System, Android Studio, Xcode etc.
-->
root@519c32a54a05:/app/logistique# cordova --version
9.0.0 (cordova-lib@9.0.1)
root@519c32a54a05:/app/logistique# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
...
(OpenJDK)
root@519c32a54a05:/app/logistique# javac -version
javac 1.8.0_252
root@519c32a54a05:/app/logistique# node --version
v12.16.1
## Checklist
<!-- Please check the boxes by putting an `x` in the `[ ]` like so: `[x]` -->
- [x] I searched for already existing GitHub issues about this
- [x] I updated all Cordova tooling to their most recent version
- [x] 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: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova] breautek commented on issue #229: Can't set minSdkVersion when building for Android 9.0.0
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #229:
URL: https://github.com/apache/cordova/issues/229#issuecomment-659435534
Cordova does not support API 21 (Android 5.0), so cordova-android@9 is min is set to 22, including at the framework level. This is why you're seeing a min SDK conflict, it's letting you know that another library that you are using has a higher min sdk, so that library may not work properly on anything lower.
If you must support API 21, you can do so by using the `<edit-config>` tag to add what is mentioned in the error. However a little disclaimer... This puts your configuration into an unsupported state. It may work, but it may break in the future without warning and only when the app reaches attempts to execute the problematic code resulting in a hard crash. It will be up to you to test your app thoroughly on API 21.
An untested example should look something like:
```
<!-- The manifest doesn't have the tools namespace by default, so we'll need this to use tools:overrideLibrary
<edit-config file="AndroidManifest.xml" target="/manifest[@xmlns:tools]" mode="merge">
<manifest xmlns:tools="http://schemas.android.com/tools" />
</edit-config>
<!-- Override cordova -->
<edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge">
<uses-sdk android:minSdkVersion="21" tools:overrideLibrary="org.apache.cordova" />
</edit-config>
```
Docs for `<edit-config>` can be found at https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#edit-config
Since this isn't a bug, I'll be closing this ticket. You're invited to our [slack](http://slack.cordova.io/) if you require more assistance on 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: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova] breautek closed issue #229: Can't set minSdkVersion when building for Android 9.0.0
Posted by GitBox <gi...@apache.org>.
breautek closed issue #229:
URL: https://github.com/apache/cordova/issues/229
----------------------------------------------------------------
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: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org