developer tip

Gradle 오류 : ': app : processDebugGoogleServices'작업에 대한 실행 실패

optionbox 2020. 11. 19. 08:06
반응형

Gradle 오류 : ': app : processDebugGoogleServices'작업에 대한 실행 실패


이 링크를 따라 내 Android 앱에 Google 로그인을 통합하고 있습니다. https://developers.google.com/identity/sign-in/android/start-integrating 위의 주어진 페이지의 마지막 단계에서 주어진 것처럼 우리는 의존성을 포함해야합니다

 compile 'com.google.android.gms:play-services-auth:8.3.0' 

앱 수준 build.gradle 파일에 있지만 그렇게하면 프로젝트를 빌드하면 오류가 발생합니다.

Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict.

build.gradle (모듈 : 앱)

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


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.brainbreaker.socialbuttons"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.google.android.gms:play-services-auth:8.3.0'
}

build.gradle 파일에서 컴파일 종속성 줄 compile 'com.google.android.gms:play-services-auth:8.3.0'에 오류가 표시됩니다.

모든 com.google.android.gms 라이브러리는 정확히 동일한 버전 사양을 사용해야합니다 (버전을 혼합하면 런타임 충돌이 발생할 수 있음). 8.3.0, 8.1.0 버전을 찾았습니다. 예를 들면 com.google.android.gms : play-services-base : 8.3.0 및 com.google.android.gms : play-services-measurement : 8.1.0이 포함됩니다. 라이브러리 또는 도구와 라이브러리의 조합이 있습니다. 호환되지 않거나 버그가 발생할 수 있습니다. 이러한 비 호환성 중 하나는 최신 버전 (또는 특히 targetSdkVersion보다 낮은 버전)이 아닌 Android 지원 라이브러리 버전으로 컴파일하는 것입니다.

다음은 gradle 빌드의 메시지입니다.

Information:Gradle tasks [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :social_buttons:generateDebugSources, :social_buttons:generateDebugAndroidTestSources, :social_buttons:compileDebugSources, :social_buttons:compileDebugAndroidTestSources]
:clean UP-TO-DATE
:app:clean
:social_buttons:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library
:app:prepareComAndroidSupportDesign2301Library
:app:prepareComAndroidSupportSupportV42301Library
:app:prepareComGoogleAndroidGmsPlayServicesAds810Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library
:app:prepareComGoogleAndroidGmsPlayServicesAuth830Library
:app:prepareComGoogleAndroidGmsPlayServicesBase830Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement830Library
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
Found com.google.android.gms:play-services-auth:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-auth:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-auth:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-auth:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-auth:8.3.0, but version 8.1.0 is needed
:app:processDebugGoogleServices FAILED
Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict.
Information:BUILD FAILED
Information:Total time: 3.49 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

이 버전 충돌에 대한 어떤 방법도 볼 수 없습니다. 도움을 주시면 감사하겠습니다.


나는 같은 문제가 있습니다. 하지만 이제 고정되었습니다.

라인을 삭제해야합니다 apply plugin: 'com.google.gms.google-services'

"com.android.application"패키지에 이미 동일한 패키지가 있기 때문입니다.


동일한 문제가 발생하여 프로젝트 수준 build.gradle의 종속성에 다음 줄을 추가하여 해결했습니다.

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

전체 작동 예제 는 github 에서 다음 프로젝트확인하십시오 .

도움이 되었기를 바랍니다 :)


8.3에서 8.4로 전환 할 때 Google Play 서비스 버전을 혼합하는 것에 대해 불평하는 동일한 오류를 발견했습니다. 이상하게도 사용하지 않은 앱 측정 라이브러리에 대한 참조를 보았습니다.

내 앱의 종속성 중 하나가 이전 버전을 참조한다고 생각했기 때문에 ./gradlew app:dependencies문제가되는 라이브러리를 찾기 위해 실행 했습니다.

그러나 작업 출력 상단에서 Google 플러그인을 찾을 수 없다는 오류 메시지를 발견했으며 기본값은 Google Play 서비스 8.3입니다. 비교를 위해 연결된 @TheYann 샘플 프로젝트를 사용했습니다 . 내 설정은 apply plugin: 'com.google.gms.google-services'앱의 build.gradle 파일 상단에 적용한 것을 제외하고는 동일했습니다 . 파일 맨 아래로 이동하여 gradle 컴파일 오류를 수정했습니다.


google-services.json 파일을 삭제하고 Firebase 콘솔에서 다시 다운로드하여이 문제를 해결했습니다.


나도 같은 문제에 직면했습니다. 하지만 내 프로젝트에 google-services.json 을 추가하는 것을 잊었습니다 . 이 파일은 Google에서 얻을 수 있습니다.


빌드 프로젝트에서 사용 하던 것과 동일한 문제가 추가 compile 'com.google.android.gms:play-services-measurement:8.4.0'되고 삭제되었습니다 .apply plugin: 'com.google.gms.google-services'classpath 'com.google.gms:google-services:2.0.0-alpha6'


제 경우에는 firebase 서비스를 사용할 때 google.json 파일이 일치하지 않았는지 확인했습니다.


@scottyab에서 설명한 것과 동일한 문제가 발생했습니다.

모든 참조는 8.4.0 이었지만 어디에서나 참조하지 않은 앱 측정 8.3.0에 대한 참조로 인해 실패했습니다 (하지만 종속성 중 하나는?). Android Studio에서 불량 (빨간색) 종속성 위로 마우스를 가져 가면 문제를 확인할 수 있습니다. 명시 적으로 추가

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

app.gradle문제 해결했습니다.


중요 사항 : build.gradle (앱 수준) 하단 에만 플러그인을 적용해야합니다.

플러그인 적용 : 'com.google.gms.google-services'

이 플러그인을 build.gradle 상단에 실수로 적용했습니다. 그래서 오류가 발생합니다.

팁 하나 더 : 3.1.0 이상을 사용하더라도 제거 할 필요가 없습니다. Google이 공식적으로 발표하지 않았기 때문에

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

Ensure that you have done these two things under defaultConfig in Android/app/build.gradle after wiring up Firebase for your Flutter app.

1) Whatever package name you entered while creating your Firebase android project, exactly the same should be updated as your applicationId under defaultConfig.

2) Add the line multiDexEnabled true under defaultConfig.

So defaultConfig{} should now look something like this

defaultConfig {
    applicationId "com.companyName.appName"
    minSdkVersion 16
    targetSdkVersion 27
    multiDexEnabled true
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

I had a similar issue/error.. fixed it by moving apply plugin: 'com.google.gms.google-services'
to the end of app level gradle file.

And updated the version of gms:play-services and gms:play-services auth


same issue i have.

i tired all possible solutions that i found. but non were worked.

always got this error

Cannot add task ':processDebugGoogleServices' as a task with that name already exists

Now, i solved it.

1) first i checked my config.xml

2) and removed unnecessary plugin. (I used firebase fcm plugin for pushnotification, but there was two unnecessary plugin phonegap-plugin-push and cordova-plugin-customurlscheme. I removed both these plugins)

3) then removed platform.

4) then add platform

5) then build it.

6) now it build successfully.


Had the same problem with malformed error Deleted the line apply plugin: 'com.google.gms.google-services' And the build got successful


NEVER DELETE apply plugin: 'com.google.gms.google-services' from the gradle. Sometimes you are using com.google.gms:google-services:3.1.0 , without apply plugin: 'com.google.gms.google-services' your gradle build successfully. BUT IT IS COMPLETELY WRONG !!!! This error comes due to google-service.json file is not at the correct location. Go to your PROJECT TAB at left side above. If you display it as ANDROID make it PROJECT then check your google-service.json file is at this location. EXPAND app then see google-service.json file below the build.gradle. IF NOT PLACE IT THERE BY RIGHT CLICK ON THE app .


This error comes up when there is change in your config.xml file resulting in mismatching of the data present in google-services.json file. I got it fixed this just by updating changes to my google-services.json file and building the app again ...it worked well.


If you´re building a new app, put the jsonfile in the right place and make sure it's the jsonfile for that app. Before I realized this, when I clicked the jsonfile, I didn't get the information that wanted.

Go to firebase configurations, download the correct version of google-services.json, and replace the version that didn't work for you. When using the wrong version, you might see the wrong Projectid, storagebucket etc.


Also please check your package name in Manifest and package name in google services json file. If both have package name differ from one another u will have this issue.


I fixed it without deleting apply plugin: 'com.google.gms.google-services' I had the error Execution failed for task ':app:processDebugGoogleServices' because I was using two different versions of google services in my dependencies :

implementation "com.google.android.gms:play-services-maps:11.8.0"
implementation "com.google.android.gms:play-services-nearby:16.0.0"

I changed it to :

implementation "com.google.android.gms:play-services-maps:11.8.0"
implementation "com.google.android.gms:play-services-nearby:11.8.0"

Then it worked


When you create an android application in firebase console you should set your application package in future it will be recorded to google-services.json. So this error can happen when you try to add google services in the application which has a different package (Current application package will not match to which was recorded to google-services.json).


First close your android studio then right click on studio icon and click 'Run as administrator' it will workenter image description here

참고URL : https://stackoverflow.com/questions/33572465/gradle-errorexecution-failed-for-task-appprocessdebuggoogleservices

반응형