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이되었습니다 rebrandedFirebase사용하려는 경우, 클라우드 메시징 (FCM) com.google.android.gms:play-services:9.0.0이 문서 읽기 FCM을 . 이 작업 build.gradle을 수행하고 플러그인을 사용하도록 파일을 수정하십시오 .

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

답변

내가 찾은 가장 쉬운 방법은 모두 최신 버전을 사용하는 것입니다.

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'

}

설명

플러그인 적용 : ‘com.google.gms.google-services’// 하단에 추가하십시오.

  • 먼저 apply plugin: 'com.google.gms.google-services'// 하단에 추가하십시오.
  • 그런 다음 종속성에 추가하십시오.

    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' // FCM에 사용

    compile 'com.google.firebase:firebase-messaging:10.2.6' // FCM에 사용

2017 년 5 월 25 일 오늘 최신 버전 인 firebase-auth 10.2.6을 가지고 있지만 play-services-auth : 9.0.0 이하를 최신 버전보다 동시에 사용하고 있다면 둘 다 연결할 수 없으며 당신은 오류입니다.

이것이 도움이 되었기를 바랍니다.


답변

Gradle에서 문자열을 다음과 같이 변경하여 까다로운 문제를 해결했습니다.

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에서 캐시를 피하고 해결할 수 있습니다.