简体   繁体   English

Google Firestore 获取数据库实例时出错

[英]Google Firestore error getting database instance

I am trying to add information to my firebase project using Xamarin.android app but all of a sudden I got this message:我正在尝试使用 Xamarin.android 应用程序向我的 firebase 项目添加信息,但突然间我收到了这条消息:

Error Message错误信息

Java.Lang.NoClassDefFoundError
Message=Failed resolution of: Lcom/google/common/base/Preconditions;

My GetDatabase method:我的 GetDatabase 方法:

Imgur Link图像链接

NuGet Packages Installed: NuGet 安装的软件包:

  • Xamarin.Android.Support.Core.Utils (ver 28.0.0.3) Xamarin.Android.Support.Core.Utils(版本 28.0.0.3)
  • Xamarin.Android.Support.CustomTabs (ver 28.0.0.3) Xamarin.Android.Support.CustomTabs(版本 28.0.0.3)
  • Xamarin.Android.Support.Design (ver 28.0.0.3) Xamarin.Android.Support.Design(版本 28.0.0.3)
  • Xamarin.Android.Support.Media.Compat (ver 28.0.0.3) Xamarin.Android.Support.Media.Compat(版本 28.0.0.3)
  • Xamarin.AndroidX.MultiDex (ver 2.0.1.4) Xamarin.AndroidX.MultiDex(版本 2.0.1.4)
  • Xamarin.Essentials (ver 1.5.3.2) Xamarin.Essentials(版本 1.5.3.2)
  • Xamarin.Firebase.Auth (ver 71.1605.4) Xamarin.Firebase.Auth(版本 71.1605.4)
  • Xamarin.Firebase.Firestore (ver 71.1705.4) Xamarin.Firebase.Firestore(版本 71.1705.4)
  • Xamarin.Google.Guava (ver 28.2.0) Xamarin.Google.Guava(版本 28.2.0)
  • Xamarin.GooglePlayServices.Auth (ver 71.1600.4) Xamarin.GooglePlayServices.Auth(版本 71.1600.4)
  • XamarinLibrary.Xamarin.Android.Support.Multidex (ver 1.0.3) XamarinLibrary.Xamarin.Android.Support.Multidex(版本 1.0.3)

Debug Log调试日志

https://paste.ubuntu.com/p/TDNGwSTDTG/ 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正如我在这个网站上看到的类似问题,我试图将 Guava 降级到 27.1.0.0 以及 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.我可以自信地说,因为我已经实施了 firebase auth Google 登录选项并且它按预期工作。

I am quite new to Xamarin and Firebase so please don't stone me xD我对 Xamarin 和 Firebase 很陌生,所以请不要用石头砸我 xD

There is a well known conflict beetween Guava , Xamarin.Firebase and AndroidX . Guava Xamarin.FirebaseAndroidX存在众所周知的冲突。

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.)在我的例子中,我在最后实施了 AndroidX 作为一个新的更新,所以我已经用 Firebase 配置了所有逻辑,所以最快、最简单和(对我来说)最好的解决方案是停止使用 AndroidX 并开始卸载所有 AndroidX package。(让我告诉你,这是很多。)

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.这并不容易,因为如果我没记错的话,即使是 Guava 或 Xamarin.Firebase 的一些最新更新也取决于 AndroidX,因此我建议在更新 Nuget 软件包之前检查一下。

So, long story short, my solution was to stop using AndroidX Nuget package. At least until this issue got fix.所以,长话短说,我的解决方案是停止使用AndroidX Nuget package。至少在这个问题得到解决之前。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Imageurl 未保存到 Firestore 数据库 - SwiftUI - Imageurl not getting saved to Firestore database - SwiftUI 创建 Firestore 文档时获取权限错误 - Getting permission error when creating a Firestore document 从 Cloud Firestore 数据库检索数据时出错 - Error retrieving data from Cloud Firestore database 无法使用 Map 更新 Firestore 数据库 - “无效参数:‘AppointmentSlot’ 实例” - Unable to update Firestore Database with a Map - "Invalid argument: Instance of ‘AppointmentSlot’” 从 Firestore 获取文档时的错误处理 - Error handling when getting document from Firestore 作为 firestore 数据库调用的结果,从 promise 获取数据 - Getting data from a promise as result of a firestore database call 试图从 firestore 获取数据但出现此错误 - trying to get data from firestore but getting this ERROR Flutter - 使用 Firestore 实例的 BuildSuggestions(搜索代理)出错 - Flutter - Error in BuildSuggestions (Search Delegate) using Firestore instance 使用 Flutter Firebase Firestore 从数据库获取地理点数据 - Getting Geopoint Data from Database Using Flutter Firebase Firestore 在 React Native Cloud Firestore 中出现错误“@firebase/firestore: Firestore (9.15.0): Connection WebChannel transport errored” - Getting the error " @firebase/firestore: Firestore (9.15.0): Connection WebChannel transport errored" in React Native Cloud Firestore
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM