可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I don't understand this error message
C:\Program Files (x86)\Jenkins\workspace\__temp-mobile-prev\platforms\android\AndroidManifest.xml:67:5 Error:
uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library C:\Program Files (x86)\Jenkins\workspace\__temp-mobile-prev\platforms\android\build\intermediates\exploded-aar\com.paypal.sdk\paypal-android-sdk\2.14.2\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.paypal.android.sdk.payments" to force usage
Because line 67 of AndroidManifest.xml looks like:
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="22" />
Where does 15 come from?
I use ionic to build my app. But I don't think that this is the problem.
回答1:
Maybe I found the problem.
I don't want to overwride the build.gradle, because cordova create this file dynamically. But I searched why that cdvMinSdkVersion
returns a wrong value. And the reason was this barcodescanner-plugin. The plugin gradle file has this line
ext.cdvMinSdkVersion = 15
which overwrite my value from AndroidManifest.xml. After I have remove and add the plugin again it works.
But I don't know why? Maybe someone could explain the order of the different gradle scripts.
回答2:
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
回答3:
As of release 2.14.0, the minSdkVersion has been increased to 16. If you prefer to have your app on a lower minSdkVersion and want to leverage the latest SDK, please disable PayPal for versions below API 16, add xmlns:tools="http://schemas.android.com/tools
inside the manifest's xml declaration, and add the following snippet to your AndroidManifest.xml:
<uses-sdk android:minSdkVersion="INSERT_YOUR_DESIRED_minSdkVersion_HERE" tools:overrideLibrary="com.paypal.android.sdk.payments"/>
回答4:
In case of Hybrid/Ionic app such issue could get fixed by changing minSdkVersion in config.xml is what I did.
回答5:
The easier way to do this is to:
-Go to Build.gradle(Module:app).
-Change minSDKVersion 15 to minSDKVersion 16.
-Sync your project.
回答6:
Here are some context to understand the things:
By default, when importing a library with a minSdkVersion value that's higher than the main manifest file, an error occurs and the library cannot be imported. To make the merger tool ignore this conflict and import the library while keeping your app's lower minSdkVersion value, add the overrideLibrary attribute to the tag. The attribute value can be one or more library package names (comma-separated), indicating the libraries that can override the main manifest's minSdkVersion.
For example, if your app's main manifest applies overrideLibrary like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app"
xmlns:tools="http://schemas.android.com/tools">
<uses-sdk android:targetSdkVersion="22" android:minSdkVersion="2"
tools:overrideLibrary="com.example.lib1, com.example.lib2"/>
Then the following manifest can be merged without an error regarding the <uses-sdk> tag, and the merged manifest keeps minSdkVersion="2" from the app manifest.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lib1">
<uses-sdk android:minSdkVersion="4" />
回答7:
This solved my problem.
Right click on app folder in android studio, select 'open module settings' | or just press F4. Go to Flavors Tab and change Min Sdk Version to the latest.
Problem Solved.
回答8:
I use @Naga suggestion, and it's work.
config.xml that I change is not in the root of project, but in
platforms/android/app/src/main/res/xml/config.xml
and minSdkVersion
in AndroidManifests.xml are not overwritten again
回答9:
work like a charm:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.aspireone.myapplication"
xmlns:tools="http://schemas.android.com/tools">
<uses-sdk android:targetSdkVersion="28" android:minSdkVersion="14"
tools:overrideLibrary="com.allyants.draggabletreeview"/>
from this error message:
<!-- Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 15 declared in library [com.github.jakebonk:DraggableTreeView:1.0.1] C:\Users\ASPIREone\.gradle\caches\transforms-1\files-1.1\DraggableTreeView-1.0.1.aar\45f4095d2e68f3e9a1fbc4b73c7f9c33\AndroidManifest.xml as the library might be using APIs not available in 14
Suggestion: use a compatible library with a minSdk of at most 14,
or increase this project's minSdk version to at least 15,
or use tools:overrideLibrary="com.allyants.draggabletreeview" to force usage (may lead to runtime failures) -->
回答10:
Try this instead.
Change minSdkVersion 15
to minSdkVersion 16
in build.gradle(module: app)
回答11:
The way I fixed it was to go to platforms\android
folder and did a find-in-folder
from my VS code editor for minSdkVersion
and replaced all minSdkVersion=16
to minSdkVersion=19
regardless of whether cordova generated it dynamically or not. Everything worked fine for me after that.
回答12:
This error message means that the minimal android version of the paypal library is 16, not your own app's version.
If one of the 3rd party libraries you use has the bigger minimum version than your version, you have to increase your minSdkVersion to them.
回答13:
Increase the minSdkVersion as your requirement, hope it will be solved.
回答14:
The problem started for me after I added "jitPak" library for viewing PDF, the root cause of the problem turn out to be line 13 in build.gradel (Module Level). Just change the version from 15 to 16, will resolve the issue.
android { // line 7 of build.gradle (module App)
compileSdkVersion 28
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.web_app"
minSdkVersion 15 // change this to 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
回答15:
Please Follow these three steps to solve this error in ionic 3
1) projectfolder/platforms/android/CordovaLib/AndroidManifest.xml
<uses-sdk android:minSdkVersion="16" />
change this to
<uses-sdk android:minSdkVersion="19" />
2) projectfolder/platforms/android/gradle.properties
cdvMinSdkVersion=16 or X
change to
cdvMinSdkVersion=19
3) projectfolder/config.xml
<preference name="android-minSdkVersion" value="16" />
change to
`