Closed maurocolella closed 4 years ago
Please define "some libraries". Was this different in 7.1.3 (or 7.1.2, 7.1.1, ...)? How can this be reproduced?
1) For example, dependencies of cordova-plugin-crosswalk-webview
such as the android support library.
See: https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview/issues/207 https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview/issues/205#issuecomment-371669478
2) Not sure.
3) In your config.xml
, add:
<plugin name="cordova-plugin-device" spec="^2.0.2">
<variable name="android-minSdkVersion" value="19" />
<variable name="android-targetSdkVersion" value="28" />
</plugin>
Then cordova add platform android
.
Build files are generated for an android-27
compile target.
Those should be preferences, not plugin variables, and they should be on the root, not inside a plugin
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="28" />
Thank you for the clarification. Build files are still generated for android-27
.
which files?
The build.gradle
at the root of my cordova project.
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
maven {
url "https://jitpack.io"
}
jcenter()
}
//This replaces project.properties w.r.t. build settings
project.ext {
defaultBuildToolsVersion="26.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
}
}
@maurocolella what you see in build.gradle
are default values. You should see the correct values in the uses-sdk
element in platforms/android/app/src/main/AndroidManifest.xml
.
When I tried with the recommended preferences along with cordova-plugin-crosswalk-webview
, I got platforms/android/app/src/main/AndroidManifest.xml
with the correct values:
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
In case you continue to see an issue a demo project would be really helpful.
I'll just note here that Cordova-Android 7.x is not compatible with the Android API 28 build tools, so you might run into issues trying to target them.
Well, thank you @dpogue .
It appears that the android support library mentioned above doesn't explicitly declare targets.
cordova/platforms/android/app/src/main/cordova-android-support-gradle-release
Also, @brodybits, in the same AndroidManifest.xml
I get:
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="27" />
So, considering that at least one of these is affecting others, could we be looking at perhaps a bug with the support libraries as well as a misconfiguration on my part? https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview/issues/205#issuecomment-371669478
I am unable to create a test case right now, but I'll try, as time permits, to reproduce the issue in an isolated case in the few coming days.
I think this is a manifestation of #508 - Inconsistent handling of min/target SDK values
I just added the bug label.
simply add this plugin solved this problem: cordova-android-support-gradle-release
simply add this plugin solved this problem:
cordova-android-support-gradle-release
Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 19 declared in library [:CordovaLib] /home/alpine/project/src-cordova/platforms/android/CordovaLib/build/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 15 Suggestion: use a compatible library with a minSdk of at most 15, 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)
it's not worked for me
how to change AndroidManifest.xml minSdkVersion? i'm add
<platform name="android">
<preference name="android-minSdkVersion" value="15" />
<preference name="android-targetSdkVersion" value="19" />
in config.xml rm & add platform then build an get error in /home/alpine/project/src-cordova/platforms/android/CordovaLib/build/intermediates/library_manifest/debug/AndroidManifest.xml i'm get
<uses-sdk android:minSdkVersion="19" />
then install ordova plugin add cordova-android-support-gradle-release --variable ANDROID_SUPPORT_VERSION=15
error when build still here
You really should upgrade to cordova-android@8
, which by default targets android 28.
Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 19 declared in library
This is caused something that is using a lower min sdk and it conflicting with another package. You can override it, but it may cause fatal in your app so I wouldn't recommend doing so.
<preference name="android-targetSdkVersion" value="19" />
This is also going to be problematic. This should be at least 28. Which google enforces as of November 1, 2019 for all apps intended to be deployed to the Google Play Store. See https://support.google.com/googleplay/android-developer/answer/113469#targetsdk for more information.
i use jeduan/cordova-plugin-facebook4 in the project. in plugin.xml i'm found
<preference name="android-minSdkVersion" value="15" />
how can i'm use the facebook SDK another way?
and i'm use cordova-android@latest in the project
thanx!
Hello again. has anyone found a solution to the problem of mismatch of the minimum sdk version? or a workaround?
@newbie78 What you're talking about is unrelated to this issue. Please open a new ticket, or for support, it's better to join the cordova slack community.
Regarding the android-targetSdkVersion
, PR https://github.com/apache/cordova-android/pull/849 should address that issue. There is issue already documented for preference tag at https://github.com/apache/cordova-android/issues/846
cordova-android 7.x will always default to android-27. cordova-android 8 will default (and expect) android-28.
For the reasons above, I'm closing this ticket.
It seems that the
android-targetSdkVersion
is ignored in7.1.4
if it exceedsandroid-27
.Some libraries have started to require
android-28
.Please advise.