简体   繁体   中英

Android Studio Error using gradle

I'm using Android Studio with Gradle for my project. I had to convert it from eclipse to android studio. But I get this error

Failed to find: com.google.android.gms:play-services:5.0.77

That's my build.gradle file.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 18
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.org.appname"
        minSdkVersion 14
        targetSdkVersion 17
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}


dependencies {
    // Google Play Services
    compile 'com.google.android.gms:play-services:5.0.77'
    compile 'com.android.support:support-v4:20.0.0'
    compile 'org.jsoup:jsoup:1.7.3'
    compile 'io.segment.analytics.android:google-analytics:1.3.1'
    compile 'com.squareup.picasso:picasso:2.3.3'
}

What's Wrong? I have installed the Google Repository like a read in some other post. But it doesn't work. Thanks

Use com.google.android.gms:play-services:5.0.89 . You can find the available versions in extras/google/m2repository/com/google/android/gms/play-services of your Android SDK directory.

Use this line:

compile 'com.google.android.gms:play-services:5.0.+'

Instead of

compile 'com.google.android.gms:play-services:5.0.77'

Edit: This is a bad practice, please use exact version if possible and avoid using + .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM