f-miyu / Plugin.CloudFirestore

MIT License
121 stars 44 forks source link

Android: Dex Compiler d8 not working with the Library #62

Closed chrisgate closed 3 years ago

chrisgate commented 3 years ago

Hi @f-miyu , Thanks for this Library! Android: Dex Compiler d8 not working with the Library (Plugin.CloudFirestore),always coming with Java.exe exited with code 1 error;

I created a new project with latest Visual Studio ; Microsoft Visual Studio Community 2019 Version 16.7.4 VisualStudio.16.Release/16.7.4+30517.126 Microsoft .NET Framework Version 4.8.03752

with latest Xamarin Forms "Xamarin.Forms" Version="4.8.0.1451"

But When i changed Dex Compiler in Android Build Properties to Dx (Which is deprecated now) everything work as expected.......This error wasn't happening with Plugin.FirebaseAuth Library.

Thanks.

f-miyu commented 3 years ago

Do you use Xamarin.Google.Guava.ListenableFuture or the package which depends on it (Xamarin.AndroidX.Browser etc.)? If so, try the following.

  1. Install Xamarin.Google.Guava:28.2.0.
  2. Add guava.jar in C:\Users\[user name]\.nuget\packages\xamarin.google.guava\28.2.0\build\monoandroid90 to your Android project.
  3. Change Build Action of guava.jar to AndroidJavaLibrary.
f-miyu commented 3 years ago

It may work well if you just install Xamarin.Google.Guava:27.1.0.1 without adding guava.jar.

chrisgate commented 3 years ago

@f-miyu Thanks Latest Xamarin Forms actually depends on Xamarin.AndroidX.Browser ! I tested both Xamarin.Google.Guava:28.2.0 and Xamarin.Google.Guava:27.1.0.1 each and it works.

But if i enable Multi-Dex ,then it won't work.

I currently don't required Multi-Dex in my App.

Thanks.