Firebase Android SDK 导致 Gradle 错误(无错误原因) [英] Firebase Android SDK causing Gradle error (With no error cause)
问题描述
我正在尝试在我的 Android Studio 项目中使用 Firebase,但它给了我一个空的 Gradle 错误.
I am trying to use Firebase in my Android Studio project and it is giving me an empty Gradle error.
我尝试将 Firebase SDK 与 Gradle 一起使用,并将 jar 放入我的 libs 文件夹中,但两者都给出了相同的空白 Gradle 错误.
I have tried using the Firebase SDK with Gradle, as well as putting the jar in my libs folder and both give the same blank Gradle error.
我在此处遵循了 Android 快速入门:https://www.firebase.com/docs/android/quickstart.html
i have followed the Android quickstart here: https://www.firebase.com/docs/android/quickstart.html
我输入了 PackagingOptions,但没有用.如果没有实际的错误消息,就很难调试!我还没有为 Firebase 编写任何代码,我只是想让它与 Firebase Android SDK 一起运行而不会出现 Gradle 错误
I put in the packagingOptions and that didn't work. Without an actual error message it's very hard to debug! I haven't written any code for Firebase, i am only trying to get it to run with the Firebase Android SDK without getting a Gradle error
我的项目在不包含 Firebase 的情况下工作.
My project works when Firebase is not included.
有什么想法吗?
谢谢!
推荐答案
感谢各位的帮助,看来是 dex 限制错误.添加 Firebase SDK 肯定让我超出了限制,为了解决这个问题,我必须在我的 app:build.gradle
文件的 defaultConfig 部分添加 multiDexEnabled true 以及编译依赖项中的'com.android.support:multidex:1.0.0'
Thanks for your help guys, it looks like it was a dex limit error. Adding the Firebase SDK must have put me over the limit, to fix this i had to add multiDexEnabled true in the defaultConfig section of my app:build.gradle
file as well as compile 'com.android.support:multidex:1.0.0'
in the dependencies
这篇关于Firebase Android SDK 导致 Gradle 错误(无错误原因)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!