2017-12-21 4 views
-1

firebase를 사용하여 Google 로그인을 구현합니다.호환되지 않는 라이브러리 버전으로 인해 Android 빌드를 실행하지 못했습니다.

이이 내 응용 프로그램 수준 build.gradle

apply plugin: 'com.android.application' 
apply plugin: 'com.google.gms.google-services' 
android { 
    compileSdkVersion 26 
    defaultConfig { 
     applicationId "wallet.mycoin" 
     minSdkVersion 16 
     targetSdkVersion 26 
     versionCode 1 
     versionName "0.2" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    implementation fileTree(dir: 'libs', include: ['*.jar']) 
    implementation 'com.android.support:appcompat-v7:26.1.0' 
    implementation 'com.android.support.constraint:constraint-layout:1.0.2' 
    implementation 'com.android.support:design:26.1.0' 
    compile 'com.google.code.gson:gson:2.8.2' 
    compile 'com.squareup.retrofit:retrofit:1.9.0' 
    compile 'com.squareup.okhttp:okhttp:2.4.0' 
    compile 'com.squareup.okio:okio:1.5.0' 
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0' 
    compile 'com.google.firebase:firebase-auth:11.8.0' 
    compile 'com.google.android.gms:play-services-auth:11.8.0' 
} 

내 프로젝트 수준의 build.gradle

buildscript { 

    repositories { 
     google() 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:3.0.1' 
     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 { 
     google() 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

입니다 난>

Error:Execution failed for task ':app:processDebugGoogleServices'. Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.

같은 오류를 얻고 구축하는 동안 < <

01 23,516,

그리고

All firebase/gms libraries must use the exact same specification (mixing versions can lead to run time crashes) Found versions 9.0.0 and 11.8.0. Examples include com.google.firebase:firebase-analytics:9.0.0 and com.google.android.gms:play-services-auth:11.8.0.

There are some combinations of libraries , or tools and libraries that are incompatible, or can lead to bugs. One such incompatibility compiling with a version of Android support library that is not the latest version (or in a particular version lower than targetSdkVersion)

프로젝트에 추가 더 중포 기지 분석 라이브러리가 없습니다

. 누구든지 해결책을 제안 할 수 있습니까? 빌드가 실패했습니다.

답변

4
dependencies { 
implementation fileTree(include: ['*.jar'], dir: 'libs') 
implementation 'com.android.support:appcompat-v7:26.1.0' 
implementation 'com.android.support.constraint:constraint-layout:1.0.2' 
implementation 'com.android.support:design:26.1.0' 
compile 'com.google.code.gson:gson:2.8.2' 
compile 'com.squareup.retrofit:retrofit:1.9.0' 
compile 'com.squareup.okhttp:okhttp:2.4.0' 
compile 'com.squareup.okio:okio:1.5.0' 
compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0' 
compile 'com.google.firebase:firebase-auth:11.8.0' 
compile 'com.google.android.gms:play-services-auth:11.8.0' 
} 
apply plugin: 'com.google.gms.google-services' 

이 파일을 사용하여 Google 서비스 구성 파일을 추가하십시오.

+0

변경된 사항이 없습니다. 나는 장소와 위치 의존성을 원치 않는다. 이게 무슨 뜻이야. 또한 gson을 2.6.2로 다운 그레이드했습니다. – AndEngine

+0

위치와 장소를 삭제할 수 있지만 상단에서 'com.google.gms.google-services'를 적용한 다음 적용 플러그인을 제거하고 파일의 끝에 추가하십시오. 동일한 gson을 사용할 수 있습니다. 답변을 –

+0

업데이트했습니다. << apply plugin : 'com.google.gms.google-services'>>를 위에서 아래로 놓기 만하면됩니다. 모두 잘 작동한다. – AndEngine

관련 문제