-1

this is my First app i will reskin and i got this Eror! in image Here enter image description here: i researched and i tried to add 'com.google.android.gms.play_services' Like in this Guide Here but still the Same Erorr the code sours is Hopping Bird Game . gradle file

apply plugin: 'com.android.application'
android {
    compileSdkVersion 19
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "bb.hoppingbird"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}
dependencies {
    compile 'com.android.support:support-v4:19.1.0'
    compile 'com.google.android.gms:play-services:+'
}

Help please!

Community
  • 1
  • 1
Reda KL
  • 1
  • 4

2 Answers2

2

This is the quote from Google developer official release notes -

Google Play services 10.2.x is the first release that no longer includes full support for Android version 2.3.x (Gingerbread). Apps developed using SDK release 10.2.x and later require a minimum Android API level of 14 and cannot be installed on devices running an API level below 14. To learn more about your options, including building multiple APKs to extend your app's support for Android Gingerbread,

There are two options now -

  1. Target API level 14 as the minimum supported API level.
  2. Build multiple APKs to support devices with an API level less than 14. Here is how you can do that -
    define two different product flavors, with two different compile dependencies for the components of Play Services you're using:

    productFlavors { legacy { minSdkVersion 9 versionCode 901 // Min API level 9, v01 } current { minSdkVersion 14 versionCode 1401 // Min API level 14, v01 } }

    dependencies { legacyCompile 'com.google.android.gms:play-services:10.0.0' currentCompile 'com.google.android.gms:play-services:10.2.0' }

Source - Google developer blog

Paresh P.
  • 6,677
  • 1
  • 14
  • 26
0

In your App Gradle File: Set minSdkVersion to 14 and it will be solved.

defaultConfig {
        applicationId "bb.hoppingbird"
        minSdkVersion 14
    }

Hope this helps. :)

tahsinRupam
  • 6,325
  • 1
  • 18
  • 34
  • tahsinRupam' Can u explain more please. in my app gradle file there is something like this => defaultConfig { applicationId "bb.hoppingbird" } so i tried to add that code you post Down or above and still isn't work can u please tell me specific where i will add this . thankk youu – Reda KL Mar 11 '17 at 08:12
  • You have to add minSdkVersion 14 inside defaultConfig {here} Don't you have minSdkVersion version in defaultConfig ? Add your gradel file to your question. – tahsinRupam Mar 11 '17 at 08:16
  • Add "minSdkVersion 14" just under applicationId "bb.hoppingbird" inside defaultConfig. Check my updated answer. As I can see your gradle file, your minSdkVersion hasn't been defined. So, Android Studio is considering as minSdkVersion 1 as default. But google-play-service requires at least sdk version 14. Hope this solves your problem. – tahsinRupam Mar 11 '17 at 08:39
  • isn't working too bro! i tried to add and Gradle build finished with 211 error(s). i will try to find some othere same code sours resolved without errors thanks so much for help – Reda KL Mar 11 '17 at 09:02
  • I'm assuming that you have used in your manifest file. Try removing all modification in manifest and Sync gradle again. – tahsinRupam Mar 11 '17 at 09:22
  • THaanks its Solved Now with ur answear. i just was doing it wrong before lol .thank youuu – Reda KL Mar 14 '17 at 18:13