6

I am using Android Studio Version 1.2.2.

My project's min sdk is 7 and I want to use google play service which requires min sdk 9 and above. So I use the below to overrideLibrary the library.

Although I am getting the below error:

Error:Execution failed for task ':processDebugManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 7 cannot be smaller than version 9 declared in library D:\project_name\build\intermediates\exploded-aar\com.google.android.gms\play-services-ads\7.5.0\AndroidManifest.xml Suggestion: use tools:overrideLibrary="com.google.android.gms.ads" to force usage

I stuck at this point and can not go ahead. Any help is highly appreciated.

Smeet
  • 4,036
  • 1
  • 36
  • 47
  • Your app must support minsdkversion = 7? – Phuc Tran Jun 22 '15 at 10:00
  • @ Yeah IO. Yah.. That i can not change. That is the main issue. – Smeet Jun 22 '15 at 10:01
  • Google play service requires min sdk version = 9. This means if you use it and your app supports min version = 7, some thing will not work. – Phuc Tran Jun 22 '15 at 10:07
  • Yes correct. No matter if something is not supported but does not build at least. Even i use overrideLibrary in manifast.xml – Smeet Jun 22 '15 at 10:12
  • Can you post your gradle file? – Phuc Tran Jun 22 '15 at 10:16
  • Can not paste all content as it is limited to 143 characters – Smeet Jun 22 '15 at 10:24
  • apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId 'com.example.phonestate' minSdkVersion 7 targetSdkVersion 22 }buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } productFlavors { } } – Smeet Jun 22 '15 at 10:24
  • dependencies { compile 'com.android.support:support-v4:22.2.0' compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.google.android.gms:play-services-ads:7.5.0' compile files('libs/activation.jar') compile files('libs/additionnal.jar') compile files('libs/mail.jar') } – Smeet Jun 22 '15 at 10:24
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/81164/discussion-between-yeah-io-and-smeet). – Phuc Tran Jun 22 '15 at 10:25
  • You can add it to your question. – Phuc Tran Jun 22 '15 at 10:25

2 Answers2

9

You just need to update your minSdkVersion 7 to minSdkVersion 9 in your gradle file.

Its just mean that your application must not have minSdkVersion (minimum SDK version) lesser then the library minSdkVersion.

update your gradle file and build project again.

SilentKiller
  • 6,944
  • 6
  • 40
  • 75
  • Where is this? build.gradle - defaultConfig? – DanceSC Sep 24 '15 at 20:36
  • @DanceSC that will be in your app folder. – SilentKiller Sep 29 '15 at 04:52
  • I was looking for an exact file / location. When I asked build.gradle -> defaultConfig? I was asking specifically what you were referring to because I have updated multiple minSdkVersions in multiple different files including build.gradle and none of them worked :/ – DanceSC Sep 29 '15 at 19:46
  • 2
    @DanceSC there may be multiple modules you've added in your project all that modules must have same min sdk as your main app or peoject – SilentKiller Sep 30 '15 at 07:22
  • yup that was it, it was in the android manifest to one of the modules, thanks for the help! – DanceSC Sep 30 '15 at 14:17
  • i changed to min sdk 9 but now it cant upload apk to mobile 11-29 14:16:09.585 591-870/? E/Watchdog: !@Sync 2586 11-29 14:16:35.100 29161-29161/? E/memtrack: Couldn't load memtrack module (No such file or directory) 11-29 14:16:35.100 29161-29161/? E/android.os.Debug: failed to load memtrack module: -2 11-29 14:16:35.290 168-432/? E/audio_hw_primary: select_devices_signal starting... adev->out_devices 0x2 adev->in_devices 0x0 11-29 14:16:35.340 591-717/? E/InputDispatcher: channel ~ Channel is unrecoverably broken and will be disposed! 11-29 14:16:37.192 29184-29184/? E/memtrack: Couldn't loa –  Nov 29 '15 at 12:19
1

Update your build.gradle with this minSdkVersion 14

defaultConfig {
    applicationId "com.sample.myapp"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 3
    versionName "1.2"
}
Pang
  • 9,564
  • 146
  • 81
  • 122
shihabkv
  • 41
  • 2