【发布时间】:2016-11-13 10:31:36
【问题描述】:
所以我正在尝试使用 Firebase 存储,当我在依赖项中复制并粘贴这些代码行时:
compile 'com.google.firebase:firebase-storage:9.2.0'
compile 'com.google.firebase:firebase-auth:9.2.0'
我收到一个构建错误,指出:
错误:(33, 13) 无法解决:com.google.firebase:firebase-storage:9.2.0
在文件中显示
在项目结构对话框中显示
与
错误:无法解决:com.google.firebase:firebase-core:9.2.0
打开文件
在项目结构对话框中显示
和
错误:(34, 13) 无法解决:com.google.firebase:firebase-auth:9.2.0
在文件中显示
在项目结构对话框中显示
这是我的依赖项的样子。
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0-beta1'
compile 'com.android.support:design:24.0.0-beta1'
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.firebaseui:firebase-ui:0.3.1'
compile 'com.google.firebase:firebase-storage:9.2.0'
compile 'com.google.firebase:firebase-auth:9.2.0'
}
apply plugin: 'com.google.gms.google-services'
另外,Firebase 数据库和 Firebase 存储有什么区别?您什么时候会使用其中一个,它们不是都为您存储信息吗?
【问题讨论】:
-
我认为
com.firebase:开始的依赖项现在已被弃用,因为 Google 拥有 firebase(比较最后两个依赖项)。因为它们高于最新的,所以可能会导致错误。数据库是一个数据库——你可以在那里存储原始数据类型。存储更像是“云”——您可以上传图片、媒体等。 -
您是否在 SDK 管理器中安装了 Google Play 服务?
-
@LordRaydenMK 是的,我愿意,但也许我需要更新它们?这是唯一可能的解决方案吗?
-
关于在哪里存储什么样的数据,请参见:stackoverflow.com/questions/37482907/…
-
@LordRaydenMK 我更新了我的 SDK 管理器,但仍然没有运气:/ 我似乎无法使用 Firebase 数据库...
标签: android firebase firebase-realtime-database firebase-authentication firebase-storage