Programing

Google Play 서비스로 업그레이드 : 9.0.0 오류 해결 실패 : com.google.android.gms : play-services-measurement : 9.0.0

lottogame 2020. 7. 7. 07:41
반응형

Google Play 서비스로 업그레이드 : 9.0.0 오류 해결 실패 : com.google.android.gms : play-services-measurement : 9.0.0


build.gradle 파일을 다음에서 업그레이드했습니다.

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

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

그리고 지금은 전에 얻지 못했던이 오류가 발생합니다.

오류 : 해결 실패 : com.google.android.gms : play-services-measurement : 9.0.0 여기에 이미지 설명을 입력하십시오

여기에 이미지 설명을 입력하십시오


이 문제를 해결하기 위해 발견되었습니다.

프로젝트 레벨 gradle com.google.gms:google-services:2.1.0에서 클래스 경로를 클래스 경로로 업데이트하십시오.com.google.gms:google-services:3.0.0


필수 : 최신 버전의 Android Studio 및 Google Play 서비스

다음과 같이 최상위 build.gradle 및 앱 레벨 build.gradle 파일을 업데이트하여 프로젝트에 플러그인을 추가 할 수 있습니다 .

classpath 'com.google.gms:google-services:3.0.0'

처럼

 // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        mavenLocal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'com.google.gms:google-services:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenLocal()
    }
}

이제 Google Play 서비스에 대한 종속성을 추가해야합니다. 앱의 build.gradle 내부에 다음을 추가하십시오.

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

드디어

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"

    defaultConfig {
        applicationId "// set Yours"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"


    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'LICENSE.txt'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.google.android.gms:play-services-gcm:9.6.1'
    compile 'com.android.support:appcompat-v7:24.2.0'

}

apply plugin: 'com.google.gms.google-services'

GCM has been rebranded to Firebase Cloud Messaging (FCM), If you want to use com.google.android.gms:play-services:9.0.0 read this article FCM. Do this maybe work, modify your build.gradle file to use the plugin.

buildscript {
  dependencies {
    // Add this line
    classpath 'com.google.gms:google-services:3.0.0'
  }
}

The easiest way I found is to use the latest version for all.

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
//apply plugin: 'com.google.gms.google-services' //Firebase
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
compile 'com.google.firebase:firebase-auth:10.2.6'
compile 'com.google.android.gms:play-services-auth:10.2.6' //10.2.6
compile 'com.google.firebase:firebase-core:10.2.6' // used for FCM
compile 'com.google.firebase:firebase-messaging:10.2.6' // used for FCM
testCompile 'junit:junit:4.12'
//  apply plugin: 'com.google.gms.google-services'

}

EXPLAINATION

apply plugin: 'com.google.gms.google-services' // Add this at bottom.

  • First, apply plugin: 'com.google.gms.google-services' // Add this at bottom.
  • Then, add these into dependencies

    compile 'com.google.firebase:firebase-auth:10.2.6' // make suere this is in latest version.

    compile 'com.google.android.gms:play-services-auth:10.2.6' //10.2.6 Latest

    compile 'com.google.firebase:firebase-core:10.2.6' // used for FCM

    compile 'com.google.firebase:firebase-messaging:10.2.6' // used for FCM

Suppose if you have firebase-auth 10.2.6 that is latest today 25, May 2017, But simultaneously you're using play-services-auth:9.0.0 or below than latest, then they both can't make the connection and show you the error.

I hope this helped.


I solved this tricky problem by changing the string in Gradle to

compile 'com.google.android.gms:play-services:9.0.0' //or latest version

재생 서비스를 10.2.1 이상의 버전으로 변경하면 종속성이 해결되지 않습니다.

다음 maven URL을 변경하면 문제가 해결되었음을 알았습니다.

maven { url 'https://raw.githubusercontent.com/onepf/OPF-mvn-repo/master/' }

maven { url 'https://github.com/onepf/OPF-mvn-repo/raw/master/' }

URL 변경으로 인해 gradle 또는 maven에서 캐시를 피하고 해결할 수 있습니다.

참고 URL : https://stackoverflow.com/questions/37311794/upgrade-to-google-play-services9-0-0-error-failed-to-resolve-com-google-androi

반응형