-
Notifications
You must be signed in to change notification settings - Fork 688
Guava missing classes? #776
Comments
This sounds kind of like something's getting linked away from your app, or never making it into the final dex in the first place. Can you try and update to Xamarin.Google.Guava 27.1.0.3 and adding an explicit PackageReference to your app head project for that package? It also could be that the .targets from the nuget package weren't being properly included in your app project, and so the actual The newest nuget package uses buildTransitive/ as well so this shouldn't happen anymore as a transitive dependency in the future, but for now, adding an explicit reference to this package should help. |
Thank you for your answer Jonathan, and sorry for the delay, I was on vacations (lucky me, I know) |
At one point I was able to get my app to compile with the combination of Xamarin.Build.Download 0.7.1 and Guava 27.1.0, but I'm self-compiling the Play Services libraries off their androidx branch and applied a patch to allow XBD >0.8 to work. Unfortunately it seems like Guava is not at all compatible with XBD >0.7.1. Compiling with Guava 27.1.0 gives me an error about a duplicate ListenableFuture class (probably something depends on the nuget package somewhere, reasonable). Bumping the version to 27.1.0.3 gives me a bunch of missing classes:
The first three are solved by downloading the Guava jar manually and bundling it in my Android project and setting the action to 'AndroidExternalJavaLibrary', which seems to mean that it's not getting downloaded through the normal build process. The final missing class seems to be due to a dependency on some Google Conscrypt library that isn't provided anywhere. I tried to download the 'aar' from maven and bundle it in, but it looks like it's going to need an actual binding project, I'm going to try to put that together. I can't exactly tell where this Conscrypt dependency is coming from, looking at https://mvnrepository.com/artifact/org.conscrypt/conscrypt-android/usages doesn't suggest it's used in a lot of places, so I'm not sure if it's a part of Guava or something else. |
Alright, I've tried a few permutations of build configs and made some findings. First, I've removed the hard dependency on Xamarin.Build.Download, so I'm assuming it's on version 0.9.0 right now. I'm not using any code shrinker right now.
Situation 5 probably makes sense, because Xamarin.Firebase.Firestore has a dependency on Xamarin.Google.Guava.ListenableFuture, but then I don't really understand why it works in situation 6 just by changing the dex compiler. I also have to use the 'dx' compiler. If I leave multidex disabled, with Guava 27.1.0 I get the same error as situation 5, with Guava 27.1.0.3 I just get '"java.exe" exited with code 2.' I hope this makes sense to the devs here. I took a little look at the bindings in this repo but nothing particularly stood out to me. |
Has there been solutions to this issue? I also have the same issue after running some updates to the Firebase packages including firestore. Reverting the updates seems not to solve the build issues on my end so this needs to be escalated.. |
I've just tried the last nuget available today (v28.2.0) and I've got the same error at runtime: |
I ve got the same problem after installing the latest version (v28). someone would like to help me? |
Sorry to hear. It doesn't seem to me that they are working on the issue or even trying to fix it. I would suggest building a library around firebase rest apis which is what I did and doing away with the native libraries. There may be some feature downside to that but at least you save yourself the trouble of dealing with these libraries and if you're not interested in doing that yourself there are nugget packages that are based on firebase rest apis. I hope this helps |
Still facing this unfortunately. Seems the only solution is to use Guava 27.1.0.1 where needed. Later versions may work, but I didn't feel like messing with it anymore. |
It was good to know...I spent a lot of time to sort out this...nothing worked..This version works fine. |
I have installed the version 27.1.0 of xamarin.google.guava and I'm getting errors like this:
Fatal Exception: java.lang.NoClassDefFoundError
Failed resolution of: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension;
com.google.common.base.Throwables.getStackTraceAsString (Throwables.java:352)
As I can see in the crashlytics report, the invocation of this method comes from io.grpc.Status.toString (Status.java:551)
If I try to update guava to any newer version, then I've got another error (another missing class):
Java.Lang.NoClassDefFoundError: 'Failed resolution of: Lcom/google/common/base/Preconditions;'
thrown when I try to make a query to Firestore
Any ideas on what's missing? It appears that the binding is deleting those classes
The text was updated successfully, but these errors were encountered: