簡體   English   中英

使用gradle的Android Studio錯誤

[英]Android Studio Error using gradle

我正在將Android Studio與Gradle一起用於我的項目。 我不得不將其從eclipse轉換為android studio。 但是我得到這個錯誤

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

那是我的build.gradle文件。

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'
}

怎么了? 我已經像其他文章中的閱讀內容一樣安裝了Google Repository。 但這是行不通的。 謝謝

使用com.google.android.gms:play-services:5.0.89 您可以在Android SDK目錄的extras/google/m2repository/com/google/android/gms/play-services中找到可用的版本。

使用此行:

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

代替

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

編輯:這是一個不好的做法,請盡可能使用准確的版本,並避免使用+

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM