Closed highpockets closed 4 years ago
Hi @highpockets
I think I found a simpler workaround that does not require export to Android Studio.
The issue is that Mapbox includes Android support 25.1.0 packages into Gradle and that Firebase imports AndroidX packages at the same time.
Mapbox actually includes the .aar files for Android support 25.1.0 into the package. Simply removing all `-25.1.0.aarfiles from
Assets/Mapbox/Core/Plugins/Android/` prevents thoses files to be added to Gradle and resolves the conflict.
Hope it helps !
I tested your solution and it works fine. You are a GOD. Thanks a lot Thalkz.
Hi @Thalkz,
Yes, that is a much easier and less painful approach. I'd imagine it would be best for Mapbox SDK to be updated to use AndroidX - or better yet the android resolver. Anyhow, I'll close this now even though both solutions are hacks.
Hi @highpockets
I think I found a simpler workaround that does not require export to Android Studio.
The issue is that Mapbox includes Android support 25.1.0 packages into Gradle and that Firebase imports AndroidX packages at the same time.
Mapbox actually includes the .aar files for Android support 25.1.0 into the package. Simply removing all `-25.1.0.aar
files from
Assets/Mapbox/Core/Plugins/Android/` prevents thoses files to be added to Gradle and resolves the conflict.Hope it helps !
man, you saved my life :)
thalkz, thanks a lot.
Note: If this is a bug or support ticket, please provide the following information:
Unity version: 2019.3.4f1
Scripting Runtime Version: .NET 4.6
Scripting Backend: Mono
Api Compatibility Level: Minimum API level 24
Mapbox SDK version: 2.1.1
The platform you're building to: Android
A description of what you're trying to do: Build to Android
Steps to recreate the bug if appropriate:
Include Firebase SDK and MapBox SDK in the same project, build to Android and there are several errors reporting multiple duplicate classes
found in modules classes.jar (:androidx.core.core-1.0.0:) and classes.jar (:support-compat-25.1.0:)
. Theandroidx.core.core-1.0.0
is from the Firebase SDK (it is the new support library) and thesupport-compat-25.1.0
is from the Mapbox SDK..My log file is almost exactly the same as the one from the link below which is from the Facebook SDK. The only difference is the support library versions are not the same.
https://github.com/facebook/facebook-sdk-for-unity/issues/386
Will you guys be refactoring to the androidx support library??
EDIT: Or will you guys be using Android/Play Service Resolver rather than redistributing Java libraries??
At the moment, the workaround, as mentioned in the link above, is to export the project from Unity to Android Studio and delete
implementation
of the support library in question from build.gradle and also removing a line in the AndroidManifest file.. This is not the most comfortable solution as it has to be done every time I do a test build.EDIT: I have also created an issue with the Firebase SDK here at the link below, but I'm going to close it now since they Google Play Services requires AndroidX now and that is the support library that firebase is using. https://github.com/firebase/quickstart-unity/issues/607