在使用依赖项时,、google插件或上出现错误以解决此问题?
Build.gradle(模块应用程序)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.+'
implementation 'com.twotoasters.jazzylistview:library:1.2.1'
implementation 'com.google.android.gms:play-services-ads:12.0.1'
//here its shows an error请通过更新google-services插件的版本(有关最新版本的信息可在https://bintray.com/android/android-tools/com.google.gms.google-services/上获得)或将com.google.android.gms的版本更新为12.0.1来解决版本冲突。
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'Build.gradle(XYZ项目)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
// classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.google.gms:google-services:3.2.0' // google-services plugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}发布于 2018-04-06 06:22:01
您需要使用相同版本的依赖项。
使用这个
implementation 'com.google.firebase:firebase-messaging:12.0.1'而不是这个
implementation 'com.google.firebase:firebase-messaging:11.0.4'发布于 2018-04-06 06:25:29
依赖项应该具有相同的版本。否则会产生冲突错误。
替换这个
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-messaging:11.0.4'至
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-messaging:12.0.1'https://stackoverflow.com/questions/49686584
复制相似问题