在我的应用程序中,我想使用firebase Crashlytics,为此,我在我的应用程序中添加了以下代码。
我从谷歌文档逐步添加了这些代码!
我添加了以下代码,但是当同步应用程序显示错误而不是同步项目时。
Build.gradle(项目):
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.1.0'
classpath 'io.fabric.tools:gradle:1.26.1'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://dl.bintray.com/tapsellorg/maven' }
maven { url 'https://maven.google.com/' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build.gradle(应用程序):
dependencies {
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
但是当添加此行时apply plugin: 'com.google.gms.google-services',单击同步时会显示以下错误:
The library com.google.android.gms:play-services-base is being requested by various other libraries at [[11.0.2,11.0.2]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
我该如何解决?
烙印99
Smart猫小萌
慕妹3146593
相关分类