2017-08-16 22 views
-5

喜欢标题我想同时使用firebasegoogle map。 当我单独尝试时,它没有任何错误。但是,如果我尝试使用它全部错误!任何人都可以帮我解决这个问题吗?我试图找到一些soulutions,但或使更新级别相同不工作在所有。我想同时使用firebase和谷歌地图

这里是我的gradle这个文件:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "26.0.1" 
    defaultConfig { 
     applicationId "MY-APPLICATION-ID" 
     minSdkVersion 21 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile 'com.android.support:multidex:1.0.1' 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 


    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.github.paolorotolo:appintro:4.0.0' 
    compile 'com.google.firebase:firebase-core:10.2.0' 
    compile 'com.google.firebase:firebase-database:10.2.0' 
    compile 'com.google.firebase:firebase-auth:10.2.0' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.google.android.gms:play-services-maps:11.0.4' 
    testCompile 'junit:junit:4.12' 
} 





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

这里是我的错误的gradle .. :(

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 10.2.0. 

回答

3

下的版本相同火力地堡的依赖,反之亦然

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

compile 'com.google.firebase:firebase-core:11.0.4' 
compile 'com.google.firebase:firebase-database:11.0.4' 
compile 'com.google.firebase:firebase-auth:11.0.4'  
compile 'com.google.android.gms:play-services-maps:11.0.4' 
0

尝试对火力地堡相同版本的谷歌

compile 'com.android.support:appcompat-v7:25.3.1' 
compile 'com.android.support.constraint:constraint-layout:1.0.2' 
compile 'com.github.paolorotolo:appintro:4.0.0' 
compile 'com.google.firebase:firebase-core:11.0.4' 
compile 'com.google.firebase:firebase-database:11.0.4' 
compile 'com.google.firebase:firebase-auth:11.0.4' 
compile 'com.android.support:design:25.3.1' 
compile 'com.google.android.gms:play-services-maps:11.0.4' 
testCompile 'junit:junit:4.12' 
1

请确保您有相同的版本都 火力和谷歌地图的

compile 'com.google.firebase:firebase-core:11.0.4' 
compile 'com.google.firebase:firebase-database:11.0.4' 
compile 'com.google.firebase:firebase-auth:11.0.4'  
compile 'com.google.android.gms:play-services-maps:11.0.4' 
0

使用火力的最新版本和地图for Example. 11.0.4

compile 'com.google.android.gms:play-services-maps:11.0.4' 
compile 'com.google.firebase:firebase-database:11.0.4' 

并确保您在项目' s正在使用的gradle文件

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