位置的Google Play服务与Firebase依赖项冲突

时间:2016-12-21 06:22:21

标签: android google-maps firebase

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.6.1.
apply plugin: 'com.android.application'

android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
    }

    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.myapp"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        // Enabling multidex support.
        multiDexEnabled true
    }
    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.firebase:firebase-client-android:2.3.1'
    compile 'com.google.firebase:firebase-database:9.6.1'
    compile 'com.google.firebase:firebase-storage:9.6.1'
    //map
    compile 'com.google.android.gms:play-services-location:9.0.2'
}
apply plugin: 'com.google.gms.google-services'

当我将其更新为 9.6.1 时,某些类找不到

  1. SupportMapFragment类
  2. OnMapReadyCallback,GoogleMap.OnMarkerClickListener,GoogleMap.OnInfoWindowClickListener侦听器
  3. LatLng,LatLngBounds,GoogleMap,Marker classes

1 个答案:

答案 0 :(得分:1)

尝试将地图相关性添加到您的gradle文件

compile 'com.google.android.gms:play-services-maps:9.6.1'