이 링크를 따라 내 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 을 추가하는 것을 잊었습니다 . 이 파일은 Google에서 얻을 수 있습니다.
답변
google-services.json 파일을 삭제하고 Firebase 콘솔에서 다시 다운로드하여이 문제를 해결했습니다.
답변
당신이 아래에이 두 가지를 수행했는지 확인 defaultConfig
에서 Android/app/build.gradle
당신의 플러터 앱 중포 기지를 연결 한 후에.
정확히 같은 당신으로 업데이트해야합니다, 당신의 중포 기지 안드로이드 프로젝트를 생성하는 동안 1) 무엇이든 패키지 이름은 입력 applicationId
에서defaultConfig
.
2) multiDexEnabled true
아래 에 줄을 추가합니다 defaultConfig
.
그래서 defaultConfig{}
지금의 모양은
defaultConfig {
applicationId "com.companyName.appName"
minSdkVersion 16
targetSdkVersion 27
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
답변
빌드 프로젝트에서
사용 하던 것과 동일한 문제가 추가 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'
