I got this error while loading Android studio - android

Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 14 declared in library [com.android.support:design:26.0.0-alpha1] /home/dinesh/.android/build-cache/5b4541f0362f0c186bfecf0c7160b9688c35a715/output/AndroidManifest.xml
Suggestion: use tools:overrideLibrary="android.support.design" to force usage

It is self explanatory. The library which you are using in your app has min sdk version set to 14.
But in your app you have set it to 9.
Now you need to increase it to minimum 14.

in app/build.gradle, minSdkVersion should not be smaller than 14

Set your project to use SDK version 25.0.0. Ensure it is downloaded first in Android SDK settings found under Tools > Android > SDK Manager. Search for SDK Settings and look under SDK Tools. Ensure Show Package Details is checked.
Then change your app/build.gradle to have 25.0.0 used in place of what put there by default if you used the wizard to create your app. e.g.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.example.adam.myapplication5"
minSdkVersion 9
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.android.support:support-vector-drawable:25.0.0'
testCompile 'junit:junit:4.12'
}
You can change the Sdk version, the buildToolsVersion and targetSdkVersion via the File > Project Structure > Properties and Flavors tabs. But I found the need to set the compile directives manually via editing the build.gradle file directly.

Related

android unable to build the project showing install missing files

Codes of build.gradle(Module.app)
After,creating my project it was showing incompatible version.So,Found in internet to modify my gradle file but after modifying gradle file and changing compile sdk from 26 to 27 it's showing install the missing file .
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
applicationId "com.example.thelost.fisp_beta10"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:27.+'
compile 'com.android.support:recyclerview-v7:27.+'
compile 'com.android.support:design:27.+'
compile 'com.android.support:cardview-v7:27.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
Error: Showing in my project
Click on the error if any, it will automatically download.
From the docs
You should always keep your Build Tools component updated by
downloading the latest version using the Android SDK Manager. If
you're using Android plugin for Gradle 3.0.0 or higher, your project
automatically uses a default version of the build tools that the
plugin specifies. To use a different version of the build tools,
specify it using buildToolsVersion in your module's build.gradle,
The latest buildToolsVersion is 27.0.1
So change
buildToolsVersion "27.0.2"
to
buildToolsVersion "27.0.1"
and sync your project.
try this in app level gradle
repositories {
maven {
url "https://maven.google.com"
}
}

Android, Firebase: Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16

My app/build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.firebase"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile "com.android.support:design:26.1.0"
compile "com.android.support:customtabs:26.1.0"
compile "com.android.support:cardview-v7:26.1.0"
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
But when I try to build my Android project I get error:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.firebaseui:firebase-ui-auth:2.3.0]
I can't change minSdkVersion because this is the client's requirement - run Android application on min. ver = 15
I can't change minSdkVersion because this is the client's requirement - run Adnroid application on min. ver = 15
You can't do it since you are using some dependencies with minSdk = 16 (in your case the firebase-ui has a minSdk=16).
You can choose an older version of the dependencies but you will have always problems in the future since you will not able to update them.
As you can check in the official dashboard, today with minSdk=16 you will cover over the 99% of the devices.
In any case, if it is a strong requirement of the customer you can create multiple APKs for Different API Levels.
It means that you can create different flavors in your build.gradle with a different level of api and different dependencies. In this way you will be able to support device with api 15 and also the new versions of the libraries used.
productFlavors {
// priority than the second, and so on.
minApi15 {
minSdkVersion '15'
...
}
minApi16 {
minSdkVersion '16'
}
}
dependencies {
minApi15Compile xxxxx
minApi16Compile xxxxx
}
To solve this problem, you need to downgrade the version of your com.firebaseui:firebase-ui-auth:2.3.0.
2.3.0 is the latest version. According to FirebaseUI-Android you need to use an earlier version which allow you to use minSdkVersion 15.
Hope it helps.

How to build app supports Old SDK Versions (minSdkVersion) in android

When creating new project by wizard and gives errors, then it is so frustrated.
I just create new project with MinSdk = 9 to make the app run on gingerbread
this gives me the following Error:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 14 declared in library [com.android.support:appcompat-v7:26.0.0-alpha1] C:\Users\USER\.android\build-cache\dfb3187f39ea1ff94009f5d34353fff5cfc3daee\output\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="android.support.v7.appcompat" to force usage
and here is the gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.com.testApp"
minSdkVersion 9
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
testCompile 'junit:junit:4.12'
}
how to fix this?
You have to use the older version of the support library.
compileSdkVersion 25
compile 'com.android.support:appcompat-v7:25.4.0'
As you can find out in the releases notes for 26.0.0 here
Note: The minimum SDK version has been increased to 14. As a result,
many APIs that existed only for API < 14 compatibility have been
deprecated. Clients of these APIs should migrate to their framework
equivalents as noted in the reference page for each deprecated API.
Remove this compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
Or change compileSdkVersion 26 to compileSdkVersion 25 and use a library from that version

How to support GCM service for minimum version 8 in Android

How to support Android minimum SDK version 8 for Google play GCM service [com.google.android.gms:play-services-base:8.4.0]. In my application I have set minimum SDK version 8 and targeting version 23 and need Google GCM service to my app, so that I have added corresponding dependencies to the app.
This is gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.mg"
minSdkVersion 8
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile files('libs/achartengine-1.0.0.jar')
compile files('libs/android-async-http-1.4.4.jar')
compile files('libs/httpmime-4.1.jar')
compile project(':sliderlibrary')
}
Got the following error:
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-gcm:8.4.0] /home/node/mg_android_studio/MeterGenius/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-gcm/8.4.0/AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.google.android.gms.gcm" to force usage
How to get support for minimum version 8?. Please help me.
Follow the suggestion in the error message and add the following to your Manifest:
<uses-sdk tools:overrideLibrary="com.google.android.gms.gcm"/>
Be prepared however that GCM might not work as expected on SDK 8.

Gradle build error."minsdkversion 14 cannot be different than version l declared in library"?

Hi everyone I am new to android developing.I download the latest version of android studio 1.3.2 yesterday.But when I start a new project for testing, gradle give me an error.
My gradle is
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.niyamat.testing3"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.+'
}
The error is
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be different than version L declared in library [com.android.support:appcompat-v7:21.0.0-rc1] C:\Users\Niyamat\Documents\Testing3\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.0-rc1\AndroidManifest.xml
I know there are some question about the same error but I didn't find any good solution.
So please someone help me?
Whats your Logcat Throws
Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be different than version L declared in library [com.android.support:appcompat-v7:21.0.0-rc1]
What should you Do
Remove minSdkVersion version from Manifest .You already declare it in your build.gradle .
Use this compileSdkVersion 21
buildToolsVersion '21.1.2' instead yours.
Compile compile 'com.android.support:appcompat-v7:21.0.1'
First of all remove this line from your Manifest .
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="22" />
Finally
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.niyamat.testing3"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.1'
}
It is your issue.
uses-sdk:minSdkVersion 15 cannot be different than version L declared in library [com.android.support:appcompat-v7:21.0.0-rc1]
It is quite strange that you have in your sdk folder the preview version of appcompat 21.
This version was published with the lollipop preview (api-L) and had the minSdk = L. It is the reason of your issue (because you have minSdkVersion 15)
You should not have this folder in your sdk. Check with the SDK Manager if it is updated.
Then you can modify your build.gradle removing the +.
Support libraries v21
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.android.support:appcompat-v7:21.0.3'
Support libraries v22 (require compileSdkVersion 22)
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:appcompat-v7:22.1.0'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.1'
Support libraries v23 (require compileSdkVersion 23)
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:appcompat-v7:23.0.1'
Seems you have a previous version of the app compat into your lib folder specific for android L.
Also you should set the version for compileSdkVersion, buildToolVersion, targetSdkVersion and the appcompat-v7 to be the same.
In your case, the buildToolVersion should be "21.1.2".
Basically, this is the reason why android studio complains / suggests NOT using .+ in your compiles.
compile 'com.android.support:appcompat-v7:21.+'
It forces compile with absolute last version of appcompat 21 which is com.android.support:appcompat-v7:21.0.0-rc1 (as you can see from error you got). That version does not allow minSdkVersion 15 - it's made for Lollipop. Change your compile appcompat to version number that does allow minSdkVersion 15 to solve the issue.

Categories

Resources