Android Question Class Defined multiple times (SOLVED)

walterf25

Expert
Licensed User
Longtime User
Hi All, I am working on a proof of concept, I am wrapping a library that requires of a few other dependencies listed below.
I am seeing this error when trying to compile the app.

The dependency that is causing this issue is guava-27.0.1-android.jar which obviously is required by the library I am wrapping, I created a small example in Android Studio using the Main library I am trying to wrap, and I see that there's an empty jar file that is being used to prevent this very same issue I am seeing now with B4A.

As you can see from this screen shot in my Android Studio project where the dependencies are loaded.


The listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar is generated to avoid conflict with the guava library.

Inside this empty jar file, there is a pom.xml file that contains this description/explanation in it

Is there any way to do the same with B4A, I tried adding the listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar with #AdditionalJar directive but I still get the same error as above.

Thanks guys, normally when wrapping libraries, I almost never have any issues such as this, any help or suggestions will be appreciated.

FYI, I already checked all the other library dependencies and I don't see the class that is causing the issue
com.google.common.util.concurrent.ListenableFuture
anywhere else, so I'm not sure how I can exclude this class or if even possible.

Walter
 

walterf25

Expert
Licensed User
Longtime User
Thanks Erel, that works like a charm, one way I had figured out was to rename the guava jar file to a zip file, unzipped that file and delete the class that was being detected as duplicate.

I like your approach better.

Thanks,
Walter
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…