在同步我的项目时,我遇到了多个“无法解决”问题。他们都是火力架和游戏服务相关的。我确定它们都是一样的(11.2.0)。我也检查过,两者的最新版本是11.2.0。此外,类似问题的所有其他答案都涉及在SDK Manager中更新Google Play服务和存储库,但我的已经是最新的。
知道为什么我无法同步我的项目吗?
编辑 - 当前工作解决方案
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.Android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.google.firebase:firebase-plugins:1.0.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" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
将maven { url "https://maven.google.com" }
添加到根级build.gradle
文件中
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
播放服务 和 Firebase 依赖关系现在可通过maven.google.com
获得,发布版本为 11.2.0 Google Play服务和Firebase。
您可以在此处找到Google Play服务 官方文档 和 firebase文档。 。
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
如果您使用的是Android gradle插件3.x,您还可以使用:
allprojects {
repositories {
jcenter()
google()
}
}
我刚刚通过添加 firebase-core dependency修复了同样的错误。
implementation 'com.google.firebase:firebase-core:16.0.1'
随着firebase的16.0.0
释放,我不得不这样做
15.0.0
analytics和tagmanager需要16.0.0
27.1.1
16.0.0
建立对抗sdk 27
额外变化:
我还必须将我的分析更新到16.0.0
我最近猜测的部分Android独立版本的东西。可能需要尝试在google play服务和firebase库上升或调低版本
解决此问题的最佳方法是不使用将firebase链接到您的应用程序的手动方法。
我已经尝试通过参考这个 Link 添加最新的firebase repo。
它显示错误“无法解析依赖关系firebase 11.2.0”
FireBase建议在FireBase Assistant for Android Studio 2.2及更高版本的帮助下为您的应用添加firebase。手动将最新库添加到build-gradle(模块)会导致上述错误。
Firebase助手自动将较低版本10.0.1添加到模块gradle-build的依赖项中,该模块兼容并且可以解析。
使用Firebase助手是如此简单和两步过程。作为参考,您可以使用上述相同链接上的“使用Firebase助手”部分。
它真的与我的Android Studio 2.3.3一起工作。并确保您的Google存储库是最新的