Inconsistent minSdkVersion across libraries (Android Studio 0.5.1 + Gradle 0.9)

I have upgraded my Android Studio to the version 0.5.1 taking care of the migration process that has to be applied to the build.gradle files into my project and modules.

After having introduced the latest version of the GooglePlayServices(4.2.42)and the Android-Map-Utils, not all the time, I'm facing the following compilation error:

 Main manifest has <uses-sdk android:minSdkVersion='8'> 
but library uses minSdkVersion='9'

Is there anyone who is encountering the same issue? Any solution?

Many thanks, Simone


It seems that I'm not the only who has got this problem.


If you have the problem for another library you can modify this hack:

Android bug:

EDIT: The bug has since been fixed.

You can use the new manifest-merger (enabled by default)

To replace the minSdk you would need something like this:

<uses-sdk tools:replace="minSdkVersion" android:minSdkVersion="9" android:targetSdkVersion="19"/>

According to the docs at

Note: Google Play services 4.0.30 (released November 2013) and newer versions require Android 2.3 or higher. If your app supports Android 2.2, you can continue development with the Google Play services SDK, but must instead install Google Play services for Froyo from the SDK Manager.

Android 2.3 is API level 9, so that means that you must declare the minSdkVersion to be 9 or higher. You can do this through your build.gradle file:

android {
    defaultConfig {
        minSdkVersion 9

If you compile what is on maven with

dependencies {
compile ''


notice that this version has dependency on play services 3+. I manually cloned git repo and changed that for 4.3.+. Problem solved. According to this fix will be pushed to maven central, hope soon.

Need Your Help

Using Data Source Configuration Wizard from Source View? sql-server visual-studio

I'm developing an site over a pretty slow network. The "Design" view of the remote Visual Studio doesn't work via Remote Desktop Connection-- and this is the only way I've seen in the docs to