How to change the Android Studio Project minSDK version? - android

I had a recurring error that I wasnt sure how to correct. My android studio was returning the an error indicating that my minSdk version was 11 and had to 14 in order to use the NoTitleBar parent reference in styles.xml. My AndroidManifest had the tag <uses-sdk android:minSdkVersion="14"/> but the error would not go away. I re-cleaned the project and tried to build again - same error.
Android Studio version: 0.8.6
OS: Win8.1

In app > build.gradle file try to modify this section
defaultConfig {
minSdkVersion 11
}
Best regards

Although I had the minSdk set in the manifest the project level sdk was overriding this or at least causing a collision. I located this way: File -> Project Structure -> App -> Flavors -> Change the minSdk version to whatever you need (preferably to match whats in the manifest if its declared - otherwise remove it from there). Hope this helps.
As a note I also next ran into this error I have not resolved yet:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version L declared in library com.android.support:support-v4:21.0.0-rc1

Related

ERROR: Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 19 declared in library [__tested_artifact__::CordovaLib]

I'm creating a cordova android project first time.upto build project everythings goes okey.after building the project, when I try to open in the Android IDE, Android Studio,
I'm getting this error.
ERROR: Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be
smaller than version 19 declared in library
[tested_artifact::CordovaLib]
E:\projects\cordova\hello1\platforms\android\CordovaLib\build\intermediates\library_manifest\debug\AndroidManifest.xml
as the library might be using APIs not available in 1 Suggestion: use
a compatible library with a minSdk of at most 1, 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)
here is setup information
I tried adding
preference name="android-minSdkVersion" value="19"
In Config.xml (Project directory).
It didn't work.
Please help me fixing this.
Thanks,
Deleting
<uses-sdk android:minSdkVersion="19" />
inside android/CordovaLib/AndroidManifest.xml helped to resolve the issue
I had same issue when building my app with Ionic. I solved it by making changes to gradle.properties(Project Properties) file. Change the cdvMinSdkVersion to the min targeted version which in my case was 22 then click on sync project. After build or run the project.
cdvMinSdkVersion=22
I had same issue when building my app with Ionic. I solved it by making changes to gradle.properties(Project Properties) file. Change the cdvMinSdkVersion to the min targeted version which in my case was 22 then click on sync project. After build or run the project.
cdvMinSdkVersion=22
This worked for me too.
I have not worked on Cordova, But works on Android apps development. The issue you described is because you are using library that has minSdkVersion 19. And you cannot use lower then that in your project. Change minSdkVersion in /platforms/android/app/build.gradle file.
As you need to change apps minSdkVersion.
Change the cdvMinSdkVersion in gradle.properties

Android Studio 3.4 Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 14

after upgrading Android Studio to version 3.4 my project sync reports an error:
ERROR: Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 14 declared in library [androidx.legacy:legacy-support-v4:1.0.0] C:\Users\pecana\.gradle\caches\transforms-2\files-2.1\0b6817155f227f1df719b12aa7dc1519\AndroidManifest.xml as the library might be using APIs not available in 1
Suggestion: use a compatible library with a minSdk of at most 1,
or increase this project's minSdk version to at least 14,
or use tools:overrideLibrary="androidx.legacy.v4" to force usage (may lead to runtime failures)
I can by the way build the APK and run the application correctly (but only without instant run active). I tried to add the
<uses-sdk tools:overrideLibrary="androidx.legacy.v4"/>
to the main AndroidManifest.xml but the error still occurs.
Any idea on how to fix this ?
Thank you
As the error suggested you can also increase your project's minSdk version to 14 or above.
Go to your build.gradle(Module app) file and add the minimum SDK version like this:
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 14 or above here
}
}

error import android eclipse project in Android Studio

Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library [com.google.android.gms:play-services:8.4.0] C:\Users\admin\Desktop\RingtoneApp2\app\build\intermediates\exploded-aar\com.google.android.gms\play-services\8.4.0\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.google.android.gms.all" to force usage
I used the site
http://developer.android.com/sdk/installing/migrate.html
You have a library (Play Services) that declares its minSdkVersion to be 9 but your application declares it to be 8. Since the library won't work on API 8, this combination is invalid. Eclipse didn't check for this but Android Studio does.
First Remove the google play library(in this case com.google.android.gms.play_services), then open manifests --> AndroidManifest.xml and change min sdk version to 9
This Line: android:minSdkVersion="9"
Also Change it in your build.gradle of app.. under the defaultConfig

Minimum sdk for Facebook sdk

I had the common errors like when trying to setup the fb sdk such as ANDROID_BUILD_SDK_TOOLS ERROR and getbootclasspath() method error
but some of the solutions that people posted on SO has the minimum sdk as 14, instead of 9 (which is shown on the fb's guide). Now in my app's build.gradle file, if I use minSdkVersion 9 instead of 14, it wont work and it will say:
Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 14 declared in library
I have researched, but couldn't find the solution for using 9 because I want to support the app on Gingerbread.
If anyone has this kind of error
"uses-sdk:minSdkVersion 14 cannot be smaller than version 15"
Just downgrade FacebookSDK to 4.5.0
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
nvm I solved it. All I had to do was put this in the app's manifest file:
> <uses-sdk android:targetSdkVersion="22" android:minSdkVersion="9"
> tools:overrideLibrary="com.facebook"/>

uses-sdk element cannot have a "tools:node" attribute

I've updated Android Studio last night to 0.9.0, buildToolsVersion to 21.1.0 and gradle to 0.14.0, after that I'm receiving this error
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk element cannot have a "tools:node" attribute
I've spent the last night looking for a solution, I found this:
<uses-sdk tools:node="replace" />
But unfortunately, added one more error!
Error:(10, 5) uses-sdk element cannot have a "tools:node" attribute
Error:(10, 5) Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk element cannot have a "tools:node" attribute
Another solution I've read, to not use support-v4:21, for me I don't use it, since I'm using v13.
Solution:--
Add this line to uses-sdk tag like this:-
<uses-sdk
tools:node="merge" <----This line do the magic
android:minSdkVersion="14"
android:targetSdkVersion="19" />
And add the tools name space in manifest :-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" .....
.../>
OK this is not the answer, but a temporary workaround.
According to the Gradle build tools release notes this problem was fixed in version 0.13.2 (2014/09/26)
However, seems to happen again in 0.14.0 (2014/10/31)
You can disable the manifest merger task in order to build your project for the time being.
Add the following in your build.gradle file
android.applicationVariants.all { variant ->
variant.processResources.manifestFile = file('src/main/AndroidManifest.xml')
variant.processManifest.enabled=false }
See this question for reference.
I ran into this after upgrading to Android Studio 1.0.0 rc4. I had previously been using so that I could make projects with lower min SDK versions than some of the libraries they depended on. Turns out, if you remove tools:replace and let the compiler error out again with the manifest merge conflict, it will provide you with a much better solution:
<uses-sdk tools:overrideLibrary="com.google.android.gms" />
At least, the Google Play Services library was what I was running into. Actually, you can list a whole bunch if you need to. Just comma-separate the package names. You may have to run the compiler a few times until it tells you every library that's causing problems.
My solution
I have removed all of the <uses-sdk tools:node="replace" /> From all of my manifest.xml files
In my base.gradle file(the one for the entire project I Added
ext {
compileSdkVersion = 19
buildToolsVersion = "21"
minSdkVersion = 10
targetSdkVersion = 19
}
In my modules I have this
// all modules
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
// in an application module
defaultConfig {
applicationId "com.something"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode appVersionCode
versionName appVersionName
}
The problem has solved after updating the AS to v0.9.1 and Gradle to 0.14.1.
Thank you guys_
Update
The problem appears again!
Update 2
Here is a workaround to solve this problem:
Open your project with Android Studio 0.8.14 / Gradle build tools 0.13.2
Build your project.
Switch back to Android Studio 0.9.1 / Gradle build tools 0.14.1
gradlew assembleRelease will work now

Categories

Resources