programing tip

com.google.android.gms : play-services-measurement-base는 다른 여러 라이브러리에서 요청하고 있습니다.

itbloger 2020. 6. 3. 21:35
반응형

com.google.android.gms : play-services-measurement-base는 다른 여러 라이브러리에서 요청하고 있습니다.


4.0.1을 gradle로 업데이트하고 다음과 같은 오류가 발생하기 시작했습니다.

com.google.android.gms : play-services-measurement-base 라이브러리는 [[15.0.4,15.0.4]]의 다른 여러 라이브러리에서 요청하지만 15.0.2로 해석됩니다. 플러그인을 비활성화하고 ./gradlew : app : dependencies를 사용하여 종속성 트리를 확인하십시오.

내 프로젝트는 그 의존성을 사용하지 않으므로 전 세계적으로 검색했으며 내부에서만 나타납니다.

build / intermediates / lint-cache / maven.google / com / google / android / gms / group-index.xml

이 라인으로

<play-services-measurement-base versions="15.0.0,15.0.2"/>

그래서 빌드 폴더를 삭제하고 프로젝트를 정리하려고 시도했지만 동일한 값으로 다시 생성합니다.


실제 문제는 https://developers.google.com/android/guides/releases#may_23_2018 의 5 월 23 일 릴리스 노트에 설명되어 있습니다.

기본적으로 모든 Play 서비스Firebase 라이브러리를 최신 버전 ( 버전 15부터 다를 수 있음 )으로 변경해야합니다. https://mvnrepository.com/사용 하여 각 라이브러리의 최신 버전을 찾을 수 있습니다 .

참조 : https://firebase.google.com/support/release-notes/android#20180523


나를 위해 작동하는 유일한 솔루션 :

build.gradle의 맨 아래에 넣으십시오.

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

Google Play 서비스 종속성 및 Firebase 종속성을 최신 버전으로 유지하십시오.

또한 모든 gradle 파일, 모듈 수준 및 프로젝트 수준을 확인하십시오. 모든 모듈에서 하나의 공통 버전의 종속성이 있어야합니다. 해당 버전을 프로젝트 레벨 gradle 변수로 유지하여 해결할 수 있습니다.

Google Play 서비스 업데이트 버전은 여기를 확인하십시오.

Google Play 서비스 최신

Firebase 업데이트 버전은 여기를 확인하십시오.

파이어베이스 최신

Android 용 Firebase 업데이트 버전은 여기를 확인하십시오.

Firebase Android 최신


나는 업데이트했다

implementation 'com.google.android.gms:play-services-analytics:16.0.3'

그리고 그것은 나를 위해 작동


build.gradle것을 다음으로 변경 하면 나를 위해 일했습니다.

ext {
  googlePlayServicesVersion   = "15.0.1"
}

allprojects {
  repositories {
      mavenLocal()
      maven { url 'http://maven.google.com' }
      jcenter { url "http://jcenter.bintray.com/" }
      google()
      maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../node_modules/react-native/android"
      }

      configurations.all {
        resolutionStrategy {
            force "com.google.android.gms:play-services-basement:$googlePlayServicesVersion"
            force "com.google.android.gms:play-services-tasks:$googlePlayServicesVersion"
        }
      }
  }
}

내 경우에는 다음 버전의 최신 버전을 사용하여 dependencies문제를 해결했습니다.

'com.google.android.gms:play-services-analytics:16.0.1'
'com.google.android.gms:play-services-tagmanager:16.0.1'

단일 Google 라이브러리 만 사용하더라도 Android Gradle 플러그인이 매우 오래된 경우에 발생할 수 있습니다! 이전에 사용 된 모든 Google 라이브러리는 정확히 동일한 버전이어야합니다. 이제는 동일 할 필요가 없으며 최신 버전 일뿐입니다. 단일 라이브러리조차 지정하면 버전이 일치하지 않고 이전 Android Gradle 플러그인이 푸시되는 종속성을 가져옵니다.

다음과 같은 최신 버전을 설정하십시오.

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
    }
}

최신 플러그인을 사용하려면 Gradle을 업데이트해야 할 수도 있습니다 (알겠습니다).


나를 위해 작동하는 유일한 솔루션 (SOF의 일부를 찾았습니다) (링크가 없음)은 다음과 같습니다.

메인 메인 빌드에서

allprojects {

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.google.android.gms'
                    && !details.requested.name.contains('multidex')) {
                details.useVersion "x.y.z"
            }
        }
    }
}

종속성 목록에 추가하십시오. 이제 모든 firebase 의존성에 대한 올바른 작업을 위해 필요합니다.

implementation 'com.google.firebase:firebase-core:16.0.1'

나는 같은 문제가 있었다

모든 종속성 최신 버전 이 있는지 확인하십시오 . Firebase 코어 및 인증에 현재 버전을 사용했습니다. 최신 버전에는 버그 수정이 있습니다.

https://firebase.google.com/support/release-notes/android 에서 최신 버전을 얻을 수 있습니다.

현재 시점에서 최신 버전 사용 :

app / build.gradle에서 :

dependencies {
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-auth:16.1.0'
}

내 프로젝트에 Firebase 데이터베이스를 추가하려고 할 때 비슷한 문제가 발생했습니다.

implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.3'

이 문제는 두 버전을 모두 비슷한 수준으로 다운 그레이드하거나 업그레이드하여 해결할 수 있습니다. 그래서 firebase 데이터베이스를 다운 그레이드했습니다.

implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'

그리고 그것은 효과가 있었다! 사용 가능한 모든 버전은이 사이트에서 검색 할 수 있습니다 : https://mvnrepository.com/


나를 위해이 오류는 Firebase를 통해 Crashlytics를 통합 한 후 버전 간 충돌로 인해 나타났습니다.

implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.android.gms:play-services-location:15.0.1'

I first tried downgrading Firebase Core to 15.0.1, but it seems there is no such version, only 15.0.0 and 15.0.2! Instead I had to downgrade both to version 15.0.0, so I ended up with

implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'

So now it's working, but I get those annoying Lint warnings about newer versions being available. This versioning debacle is a freakin' mess.


You can find the library pulling this dependancy using:

$ ./gradlew app:dependencies

I was having an error The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.0.2,16.0.2]], but resolves to 16.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

Running ./gradlew :app:dependencies will reveal what dependencies are requiring wrong dependencies (the ones in the square bracket). For me the problem was coming from firebase-core:16.0.3 as shown below. I fixed it by downgrading firebase-core to 16.0.1

+--- com.google.firebase:firebase-core:16.0.3
|    +--- com.google.firebase:firebase-analytics:16.0.3
|    |    +--- com.google.android.gms:play-services-basement:15.0.1
|    |    |    \--- com.android.support:support-v4:26.1.0 (*)
|    |    +--- com.google.android.gms:play-services-measurement-api:[16.0.1] -> 16.0.1
|    |    |    +--- com.google.android.gms:play-services-ads-identifier:15.0.1
|    |    |    |    \--- com.google.android.gms:play-services-basement:[15.0.1,16.0.0) -> 15.0.1 (*)
|    |    |    +--- com.google.android.gms:play-services-basement:15.0.1 (*)
|    |    |    +--- com.google.android.gms:play-services-measurement-base:[16.0.2] -> 16.0.2

1. Open project level build.gradle

Update com.google.gms:google-services version to latest. Track latest release. At the time of answer latest is 4.1.0.

2. Open app level build.gradle

Update below dependency if you use any. Note that firebase has individual versions for every dependency now.

Use latest Firebase Libraries. At the time of answer latest versions are below.

Firebase Core                com.google.firebase:firebase-core:16.0.3
Ads                          com.google.firebase:firebase-ads:15.0.1
Analytics                    com.google.firebase:firebase-analytics:16.0.3
App Indexing                 com.google.firebase:firebase-appindexing:16.0.1
Authentication               com.google.firebase:firebase-auth:16.0.3
Cloud Firestore              com.google.firebase:firebase-firestore:17.1.0
Cloud Functions              com.google.firebase:firebase-functions:16.1.0
Cloud Messaging              com.google.firebase:firebase-messaging:17.3.2
Cloud Storage   c            om.google.firebase:firebase-storage:16.0.2
Crash Reporting              com.google.firebase:firebase-crash:16.2.0
Crashlytics                  com.crashlytics.sdk.android:crashlytics:2.9.5
Dynamic Links                com.google.firebase:firebase-dynamic-links:16.1.1
Invites                      com.google.firebase:firebase-invites:16.0.3
In-App Messaging             com.google.firebase:firebase-inappmessaging:17.0.1
In-App Messaging Display     com.google.firebase:firebase-inappmessaging-display:17.0.1
ML Kit: Model Interpreter    com.google.firebase:firebase-ml-model-interpreter:16.2.0
ML Kit: Vision               com.google.firebase:firebase-ml-vision:17.0.0
ML Kit: Image Labeling       com.google.firebase:firebase-ml-vision-image-label-model:15.0.0
Performance Monitoring       com.google.firebase:firebase-perf:16.1.0
Realtime Database            com.google.firebase:firebase-database:16.0.2
Remote Config                com.google.firebase:firebase-config:16.0.0

Sync and Build...


I noticed that debug logs mention old version of firebase-analytics (16.0.0). Adding explicitly the latest version fixed the problem:

implementation "com.google.firebase:firebase-analytics:16.0.3"

Update all your dependencies to the latest version and it will fix the issue.

No need to add
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

It will lead to crashes if you use mixed versions.


I guess the following error is caused because of the varying versions of firebase dependencies. For me changing the version of all the dependencies that i'm implementing on my project to 16.0.1, worked like a charm.

For me the error was created by the line: com.google.firebase:firebase-auth:16.0.2

And I changed it to : com.google.firebase:firebase-auth:16.0.1

And it worked.. Hope this helps.


In my case, this solves the issue:

implementation 'com.google.android.gms:play-services-analytics:16.0.1'

In my case I have replaced my build.gradle file this line

implementation 'com.google.firebase:firebase-core:16.0.8'

with

implementation 'com.google.firebase:firebase-core:15.0.0' 

and added this line

implementation 'com.google.android.gms:play-services-location:15.0.0'

Now its fine


I changed the following dependencies in my project to make it work .

build.gradle (app):

implementation 'com.google.firebase:firebase-core:16.0.1'

to

implementation 'com.google.firebase:firebase-core:16.0.8'

build.gradle (app) :

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

to

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

****Note :

Use the following link for updated use of libraries that have dependencies https://firebase.google.com/docs/android/setup


I my case i use latest rnfirebase below URL

https://rnfirebase.io/docs/v4.3.x/installation/android

add below in android/app/proguard-rules.pro)

-keep class io.invertase.firebase.** { *; }
-dontwarn io.invertase.firebase.**

I was bumping into this problem, and noticed that the release notes mentioned:

Firebase now requires the app gradle file to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.

Making firebase-core an app dependency (as well as a library dependency) resolved this problem for me.


If the message is:

The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.4,15.0.4]], but resolves to 15.0.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

Change the version of all the play services libraries you are using to the one you need (15.0.2 in this case) could solve the problem.

In my case, I've changed:

implementation 'com.google.android.gms:play-services-base:+' -> implementation 'com.google.android.gms:play-services-base:15.0.2'
implementation 'com.google.android.gms:play-services-location:+' -> implementation 'com.google.android.gms:play-services-location:15.0.2'
implementation 'com.google.android.gms:play-services-maps:+' -> implementation 'com.google.android.gms:play-services-maps:15.0.2'
implementation 'com.google.android.gms:play-services-auth:+' -> implementation 'com.google.android.gms:play-services-auth:15.0.2'
implementation 'com.google.android.gms:play-services-places:+' -> implementation 'com.google.android.gms:play-services-places:15.0.2'

Resolved here: Me too faced the same problem when trying to add crashlytics in firebase. Please update the latest version of dependencies for com.google.android.gms:play-services and com.google.firebase: ....... It will automatically resolved the issues


I had that same problem when I tried to add the firebase-database implementation, if I commented that line it works, so after a few tries I went to https://firebase.google.com/docs/android/setup

There I checked the versions of the available libraries and my firebase-core was at 16.0.1 (current version is 16.0.4) so I manually changed it and it worked just fine, build and sync were successful.


In my case I simply remove

implementation "com.google.android.gms:play-services-ads:16.0.0

and add firebase ads dependencies

implementation 'com.google.firebase:firebase-ads:17.1.2'

Had the same issue. You have to remove the colon : after the version in the gradle (it's a bug).

These settings worked for me:

implementation 'com.google.firebase:firebase-firestore:17.1.5'

Also set multiDexEnabled to true in the gradle (if you get the DexOverflowException error):

    android {
        compileSdkVersion 27
..
            multiDexEnabled true
        }

just put below code:

    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.google.firebase:firebase-database:16.0.6'

and rebuild. it works just for fine for me


firebase-core & firebase-database ... should be same version:

implementation 'com.google.firebase:firebase-core:16.0.1' implementation 'com.google.firebase:firebase-database:16.0.1'

참고URL : https://stackoverflow.com/questions/50577437/com-google-android-gmsplay-services-measurement-base-is-being-requested-by-vari

반응형