Nice programing

오류 : 버전 충돌 수정 (google-services 플러그인)

nicepro 2020. 11. 19. 21:59
반응형

오류 : 버전 충돌 수정 (google-services 플러그인)


SO 스레드에 따라 버전 충돌이 있음을 알고 있지만 Google의 새 버전 후에도 문제가 계속 발생합니다.

오류 : ': app : processDebugGoogleServices'작업에 대한 실행이 실패했습니다. google-services 플러그인의 버전을 업데이트하여 버전 충돌을 수정하십시오 (최신 버전에 대한 정보는 https://bintray.com/android/android-tools/com.google.gms.google-services/ 에서 확인할 수 있음 ). 또는 com.google.android.gms의 버전을 10.0.1로 업데이트합니다.

build.gradle (모듈 : 앱)

....
dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
   androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
    })
   compile 'com.android.support:appcompat-v7:26.+'
   compile 'com.android.support.constraint:constraint-layout:1.0.2'
   testCompile 'junit:junit:4.12'
   compile 'com.google.firebase:firebase-messaging:10.0.1'
   compile 'com.google.android.gms:play-services-maps:11.0.4'
   compile 'com.google.android.gms:play-services-location:11.0.4'
}

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


지금 어떤 변경이 필요합니까?


당신이 변하는 것 같아요

compile 'com.google.firebase:firebase-messaging:11.0.4'

다음과 같은 경우 동일한 오류가 발생합니다.

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

모듈 build.gradle파일의 맨 아래에 추가되지 않습니다 .


3 개의 lib 모두에 대해 하나의 버전 만 사용해야합니다.

compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'

또는 3 libs에 10.0.1 만 사용하십시오.


build.gradle종속성 클래스 경로 google-services또는 build.gradle경로 를 변경해야하는 프로젝트 수준 파일을 변경하십시오 .

buildscript {

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:4.0.1'
    }
}

Google Play 서비스는 모든 종속성이 동일한 버전을 가져야합니다. 하지만 의존성을 살펴보면 :

compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'

버전이 다른 것이 있습니다.

버전을 (이 경우)로 변경하면 해결할 수 있습니다 11.0.4.

이는 Firebase와 Google Play 서비스 모두에 적용되며 둘 다 서로 일치하는 버전이 일치해야합니다. Firebase 종속성이 10.0.1이고 Google Play 서비스 종속성이 11.0.4이면 동일한 오류가 발생합니다.

경우에 따라 다른 버전의 라이브러리가있는 라이브러리가있을 수 있습니다 (예 : 앱의 종속성에 x사용 play-services-games:10.0.1하는 동안 라이브러리 사용 11.0.4).


편집하다

이 답변은 버전이 개별적인 최신 버전을 다루지 않습니다. 최신 버전을 찾으려면 mvnrepository (또는 다른 maven / gradle 아티팩트 검색 도구)를 업데이트 com.google.gms:google-services:4.1.0하고 확인하십시오 .


방화 기지가 제대로 설치 되려면 방화 기지 컴파일의 모든 버전이 동일한 버전이어야합니다.

compile 'com.google.firebase:firebase-messaging:11.0.4' 
compile 'com.google.android.gms:play-services-maps:11.0.4' 
compile 'com.google.android.gms:play-services-location:11.0.4'

이것이 올바른 방법입니다.


com.android.tools.build:gradle:3.2.0

다음을 사용해야합니다.

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

이것은 내 문제를 해결했습니다.


처음에는 firebase 데이터베이스가 11.8.0을 가리 켰습니다. 모든 관련 jar를 11.0.4로 변경 한 후이 문제는 SDK 수준에서 해결되었습니다. 'com.google.firebase : firebase-database : 11.0.4'컴파일 'com.google.firebase : firebase-messaging : 11.0.4'컴파일


중요한 업데이트

Firebase 및 Play 서비스 종속성은 모두 과거와 달리 독립적 인 버전을 가지고 있습니다. 버전 충돌이있는 경우 com.google.gms:google-services. 독립 버전 정의를 시작합니다.

단계 (1) : 업데이트 com.google.gms:google-services

프로젝트 레벨을 열고 버전으로 build.gradle업데이트 com.google.gms:google-services하려면 4.1.0 가능한 경우 최신 버전을 확인해야합니다 .

buildscript {
    ...
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
        classpath 'com.google.gms:google-services:4.1.0' //< update this 
    }
}

2 단계 : Firebase 종속성 최신 버전 업데이트

Firebase 종속성 버전은 개별적 일 수 있습니다.

com.google.firebase:firebase-core:16.0.3    //Analytics, check latest too
com.google.firebase:firebase-database:16.0.2    //Realtime Database, check latest too

단계 (3) : Play 서비스 종속성 최신 버전 업데이트

Play services versions also can have individual versions.

com.google.android.gms:play-services-ads:17.1.2 //Ads, check latest too
com.google.android.gms:play-services-analytics:16.0.6   //Analytics, check latest too

Still having issue? You can check which dependency is making conflict by reading this answer.


as the message says go to: com.google.gms.google-services versions

And copy the last version's number . Mine was less than 3.3.1. Then in project's build.gradle put/change dependencies node as :

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2' // as it was before             
    classpath 'com.google.gms:google-services:3.3.1' // <-- the version change                  
        }

Then I synced the project and error went


All google services should be of same version, try matching every versions.

Correct one is :

  implementation 'com.google.firebase:firebase-auth:11.6.0'
  implementation 'com.google.firebase:firebase-database:11.6.0'

Incorrect Config is :

 implementation 'com.google.firebase:firebase-auth:11.6.0'
 implementation 'com.google.firebase:firebase-database:11.8.0'

After All Working for 6 hours i got the solution...

Simple Just what ever the plugins you defined in the build.gradle file... for ex: google services plugins or firebase plugins or any third party plugins all the **version code** should be same..

Example: In my application i am using following plugins...

    // google services plugins
    implementation 'com.google.android.gms:play-services-analytics:10.0.1'
    implementation 'com.google.android.gms:play-services-gcm:10.0.1'
    implementation 'com.google.android.gms:play-services-base:11.6.1'
    implementation 'com.google.android.gms:play-services-auth-api-phone:11.6.0'

    //firebase plugin
    implementation 'com.google.firebase:firebase-ads:10.0.1'

    //Third Party plugin
    implementation 'com.google.android.gms:play-services-auth:16.0.0'

In the above plugins version code(ex:10.0.1, 16.0.0, 11.6.1) are different I was facing fix the version conflict (google-services plugin) issue

Below for all plugins i have given single version code(11.6.0) and the issue is resovled...

 // google services plugins
    implementation 'com.google.android.gms:play-services-analytics:11.6.0'
    implementation 'com.google.android.gms:play-services-gcm:11.6.0'
    implementation 'com.google.android.gms:play-services-base:11.6.0'
    implementation 'com.google.android.gms:play-services-auth-api-phone:11.6.0'

    //firebase plugin
    implementation 'com.google.firebase:firebase-ads:11.6.0'

    //Third Party plugin
    implementation 'com.google.android.gms:play-services-auth:11.6.0'


**Syn Gradle**...

Go to Build>>Rebuild Projcet...

Sure it will work....@Ambilpura

Update google services and Firebase library to latest version

google services

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

firebase

 implementation 'com.google.firebase:firebase-database:19.0.0'

install or update google play services. Secondly, check your 'com.google.gms:google-services:3.0.0' version . Check , this by upgrading it if still not work to 3.1.0

참고URL : https://stackoverflow.com/questions/45500934/error-fix-the-version-conflict-google-services-plugin

반응형