【发布时间】:2019-01-19 07:39:50
【问题描述】:
我想使用谷歌地图,但依赖项 (com.google.android.gms:play-services-maps:15.0.1) 与 'com.android.support:appcompat-v7:27.1.1' 冲突。 . 谁能帮忙? 这是我的 gradle 文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.gamecodeschool.mapso"
minSdkVersion 18
targetSdkVersion 27
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:27.1.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
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'
}
我的顶级构建文件
// 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.1.3'
// 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
}
【问题讨论】:
-
为什么我只是投入,至少投入和帮助
-
您必须至少说明您遇到的错误是什么,以便人们可以提供帮助,冲突可能会以多种不同的方式发生
-
您可以发布您的应用级
build.gradle文件吗? -
我编辑了问题
-
我添加了它,遗憾的是我仍然有相同的错误消息,'com.android.support:appcompat-v7:27.1.1' 下的红线说“所有 com.android.support 库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。找到版本 27.1.1、26.1.0。示例包括 com.android.support:animated-vector-drawable:27.1.1 和 com.android.support:support -media-compat:26.1.0