Google Firestore错误获取数据库实例 [英] Google Firestore error getting database instance
问题描述
我正在尝试使用Xamarin android应用程序将信息添加到我的Firebase项目中,但突然间我收到以下消息:
错误消息
Java.Lang.NoClassDefFoundError消息=无法解决以下问题:Lcom/google/common/base/前提条件;
我的GetDatabase方法:
已安装NuGet软件包:
- Xamarin.Android.Support.Core.Utils(版本28.0.0.3)
- Xamarin.Android.Support.CustomTabs(版本28.0.0.3)
- Xamarin.Android.Support.Design(28.0.0.3版)
- Xamarin.Android.Support.Media.Compat(版本28.0.0.3)
- Xamarin.AndroidX.MultiDex(2.0.1.4版)
- Xamarin.Essentials(1.5.3.2版)
- Xamarin.Firebase.Auth(版本71.1605.4)
- Xamarin.Firebase.Firestore(版本71.1705.4)
- Xamarin.Google.Guava(版本28.2.0)
- Xamarin.GooglePlayServices.Auth(版本71.1600.4)
- XamarinLibrary.Xamarin.Android.Support.Multidex(版本1.0.3)
调试日志
https://paste.ubuntu.com/p/TDNGwSTDTG/ >
我尝试将其作为文本粘贴到此处,但它不喜欢它:( ^^
- 每次更改后,我都尝试过多次重建项目
- 正如我在该站点中看到的类似问题一样,我试图将番石榴降级到27.1.0.0以及27.1.0.4
- 再次检查了与google的连接.我可以自信地说,因为我已经实现了firebase auth Google登录选项,并且可以按预期运行.
我对Xamarin和Firebase还是陌生的,所以请不要向我扔xD
Guava
, Xamarin.Firebase
和 AndroidX 之间存在众所周知的冲突.代码>.
在我的情况下,我最终将AndroidX实施为新更新,因此我已经为Firebase配置了所有物流,因此最快,最简单,(对我而言)最好的解决方案是停止使用AndroidX并开始卸载所有AndroidX包裹.(我告诉你,很多.)
这并不容易,因为即使从Guava或Xamarin.Firebase上获得的一些最新更新,如果我没记错的话,都取决于AndroidX,所以我建议在更新Nuget软件包之前先进行检查.
长话短说,我的解决方案是停止使用 AndroidX
Nuget软件包.至少在此问题得到解决之前.
I am trying to add information to my firebase project using Xamarin android app but all of a sudden I got this message:
Error Message
Java.Lang.NoClassDefFoundError
Message=Failed resolution of: Lcom/google/common/base/Preconditions;
My GetDatabase method:
NuGet Packages Installed:
- Xamarin.Android.Support.Core.Utils (ver 28.0.0.3)
- Xamarin.Android.Support.CustomTabs (ver 28.0.0.3)
- Xamarin.Android.Support.Design (ver 28.0.0.3)
- Xamarin.Android.Support.Media.Compat (ver 28.0.0.3)
- Xamarin.AndroidX.MultiDex (ver 2.0.1.4)
- Xamarin.Essentials (ver 1.5.3.2)
- Xamarin.Firebase.Auth (ver 71.1605.4)
- Xamarin.Firebase.Firestore (ver 71.1705.4)
- Xamarin.Google.Guava (ver 28.2.0)
- Xamarin.GooglePlayServices.Auth (ver 71.1600.4)
- XamarinLibrary.Xamarin.Android.Support.Multidex (ver 1.0.3)
Debug Log
https://paste.ubuntu.com/p/TDNGwSTDTG/
I tried to paste it here as text but it didn't like it :( ^^
- I have tried to rebuild the project on multiple occasions after each change
- As I saw in this site in a similar question I tried to downgrade Guava to 27.1.0.0 as well as 27.1.0.4
- Double checked the connection to google. I can confidently say so since I have implemented a firebase auth Google sign in option and it works as intented.
I am quite new to Xamarin and Firebase so please don't stone me xD
There is a well known conflict beetween Guava
, Xamarin.Firebase
and AndroidX
.
In my case I implemented AndroidX at the end as a new update, so I already had all the logistic configured with Firebase so the fastest, easiest and (for me) the best solution was to stop using AndroidX and start uninstalling all AndroidX package. (Let me tell you, it was a lot.)
It wasn't easy because even some of the last updates from Guava or Xamarin.Firebase if I recall correctly, depends on AndroidX so I recommend to check that before you update your Nuget packages.
So, long story short, my solution was to stop using AndroidX
Nuget package.
At least until this issue got fix.
这篇关于Google Firestore错误获取数据库实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!