我试图将 firebase-config 作为依赖项添加到我的项目中,我尝试使用Firebase工具,并在配置其依赖项时进行同步,但出现错误。
找不到firebase-config.jar (com.google.firebase:firebase-config:11.8.0)。在中搜索 以下位置: https://jcenter.bintray.com/com/google/firebase/firebase-config/11.8.0/firebase-config-11.8.0.jar
应用程序级别依赖性:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support.constraint:constraint-layout:1.1.2'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('com.twitter.sdk.android:twitter:2.3.0@aar') {
transitive = true;
}
compile 'com.android.support:appcompat-v7:26+'
compile 'com.android.support:cardview-v7:26+'
compile 'com.android.support:design:26+'
compile 'com.github.Mariovc:ImagePicker:1.0.5'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.4.0'
compile 'com.squareup.retrofit2:converter-gson:2.4.0'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.android.support:support-annotations:25.2.0'
compile 'com.android.support:recyclerview-v7:26+'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.android.gms:play-services:11.8.0'
compile 'com.android.support:support-v4:26+'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.facebook.android:audience-network-sdk:4.+'
compile 'com.facebook.android:account-kit-sdk:4.+'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.android.gms:play-services-auth:11.8.0'
compile 'com.android.support:percent:26+'
compile 'com.fenchtose:tooltip:0.1.5'
compile 'com.github.tobiasbuchholz:circularviewpager:1.0.0'
compile 'com.google.maps.android:android-maps-utils:0.4.+'
compile 'com.koushikdutta.ion:ion:2.+'
compile 'com.android.support:multidex:1.0.0'
compile 'it.sephiroth.android.library.targettooltip:target-tooltip-library:1.3.15'
compile 'com.github.vajro:MaterialDesignLibrary:1.6'
compile 'com.google.android:flexbox:0.3.2'
compile 'me.zhanghai.android.materialprogressbar:library:1.3.0'
compile 'com.matthew-tamlin:sliding-intro-screen:3.2.0'
compile 'com.wang.avi:library:2.1.3'
compile 'com.android.support:support-vector-drawable:26+'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.akexorcist:localizationactivity:1.2.2'
compile 'in.gauriinfotech:commons:1.0.8'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-config:11.8.0'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2'
compile 'me.leolin:ShortcutBadger:1.1.21@aar'
compile 'com.android.support:palette-v7:26+'
compile 'com.github.gturedi:stateful-layout:1.2.1'
compile 'com.github.florent37:expansionpanel:1.0.7'
compile('com.crashlytics.sdk.android:crashlytics:2.9.0@aar') {
transitive = true
}
}
顶级版本:
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
maven { url 'https://maven.google.com' }
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
maven {
url "https://jitpack.io"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
答案 0 :(得分:0)
要解决此问题,首先需要删除以下代码行:
compile 'com.google.android.gms:play-services:11.8.0'
compile 'com.google.maps.android:android-maps-utils:0.4.+'
并更改以下所有代码行:
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.android.gms:play-services-auth:11.8.0'
compile 'com.google.android.gms:play-services-auth:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-config:11.8.0'
到
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-config:16.0.0'
另外,请不要忘记更改以下代码行:
classpath 'com.google.gms:google-services:3.0.0'
到
classpath 'com.google.gms:google-services:4.0.1'