GooglePlayServicesComponents icon indicating copy to clipboard operation
GooglePlayServicesComponents copied to clipboard

Xamarin.Firebase.Firestore ClassNotFoundException with Guava

Open gioggio79 opened this issue 4 years ago • 0 comments

Operating System & Version:

Windows 10

Google Play Services Version

117

Describe your Issue

I have a new issue using Xamarin.Firebase.Firestore 121.4.3 Xamarin.Google.Guava version 27.1.0.2+ (v28 inclused) or 27.1.0 with ExcludeAssets="all".

If I understand new update of guava nuget, it's only a reference, but nothing it's really included.

Now when I try to get firebase Instance I have two different error.

  1. If I try to use FirebaseFirestore.GetInstance var FirestoreIstance = FirebaseFirestore.GetInstance(MainActivity.MyFirebaseApp);

I have a UNHANDLED EXCEPTION: with Java.Lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/io/BaseEncoding; ---> Java.Lang.ClassNotFoundException: Didn't find class "com.google.common.io.BaseEncoding"

But com.google.common.io.BaseEncoding is a part of Xamarin.Google.Guava or I'm wrong? How can I force import this class?

  1. I try to use FirebaseFirestore.Instance I have JNI DETECTED ERROR IN APPLICATION java_vm_ext.cc:542] JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethodA called with pending exception java.lang.NoClassDefFoundError: com.google.firebase.firestore.remote.FirebaseClientGrpcMetadataProvider java_vm_ext.cc:542] Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/io/BaseEncoding;

Any tips or workaround? Thanks & regards

Packages used:

  <ItemGroup>
    <PackageReference Include="Xamarin.Firebase.Firestore">
      <Version>121.4.3</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
    <PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
    <PackageReference Include="Xamarin.Google.Guava">
      <Version>28.2.0</Version>
    </PackageReference>
  </ItemGroup>

links to the existing example code:

https://github.com/gioggio79/FirestoreExample

Steps to Reproduce:

Download example Run Click on Initialize FIREBASE FIRESTORE Crash with UNHANDLED EXCEPTION

Other test Open Android Nuget Remove Xamarin.Google.Guava Run Now all works fine.

But I need to install Xamarin.Google.Guava because my original project have many other firebase package.

gioggio79 avatar Nov 20 '20 09:11 gioggio79