1
I’m developing a app which will run from version 2.3 of Android (Gingerbread - API Level 9). However, when trying to add dependencies to Firebase and of Google Admob, the following error occurred while trying to synchronize:
This support library should not use a different version (25) than the compilesdkversion (18)" na linha compile 'com.android.support:appcompat-v7:25.2.0'
When changing compile 'com.android.support:appcompat-v7:25.2.0'
for compile 'com.android.support:appcompat-v7:18.0.0'
Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 14 declared in library [com.google.android.gms:play-services-ads:10.2.4] C:\Users\leand\.android\build-cache\e914e1341a896ecd664487a87a8e07281927ee66\output\AndroidManifest.xml Suggestion: use tools:overrideLibrary="com.google.android.gms.ads.impl" to force usage
I added <uses-sdk tools:overrideLibrary="com.google.android.gms.all"/>
at the Androidmanifest as suggested by the error itself, but the same message keeps appearing when trying to synchronize.
Excerpt from build.grade(Module: app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 18
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.black.flash"
minSdkVersion 9
targetSdkVersion 25
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:18.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-ads:10.2.4'
}
apply plugin: 'com.google.gms.google-services'
Great tip. Option 2 I believe is the best not to limit future evolutions of the app, but has the burden of maintaining 2 applications. Perhaps a multi-project approach can mitigate such management.
– Márcio Oliveira
The idea is to use a single project and use
productFlavors
to generate more than one APK.– ramaral