游戏服务地图和火力基地之间的依赖冲突



我试图将火碱添加到我已经启动的项目中,但是在build.gradle(应用程序(中,我在play-services-map和firebase之间发生了依赖冲突,我到处寻找并尝试更改版本号,但仍然不起作用。 这是 build.gradle 文件

apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.android.tencho.test"
minSdkVersion 22
targetSdkVersion 26
versionCode 1
versionName "1.0"
//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.google.android.gms:play-services:15.0.1'
//    implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.google.code.gson:gson:2.2.+'
compile 'com.google.firebase:firebase-core:16.0.0'
//    //Firebase Auth
implementation 'com.google.firebase:firebase-auth:16.0.1'
//    //FirebaseUI Auth
compile 'com.firebaseui:firebase-ui-auth:3.3.0'

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

Build.gradle (项目级别(

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
//        The google-services plugin has 2 main functions:
//        1) Process the google-services.json file and produce Android resources that can be used in your
//        application's code
//        2) Add dependencies for basic libraries required for the services you have enabled. This step requires
//        that the apply plugin: 'com.google.gms.google-services' line be at the bottom of your app/build.gradle file
//        so that no dependency collisions are introduced.
classpath 'com.google.gms:google-services:4.0.1'

// 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
}

您使用的版本不一致。

让我告诉你简单的例子。

如果您使用的是Google Play服务11.8.0,那么Firebase也应该处于同一版本。

compile 'com.google.android.gms:play-services:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.android.gms:play-services-maps:11.8.0'
compile 'com.google.firebase:firebase-crash:11.8.0'
compile 'com.google.firebase:firebase-core:11.8.0'

因此,要注意的主要事情是,您使用的是不一致的版本。

最新更新