facebook-sdk-for-unity
facebook-sdk-for-unity copied to clipboard
Build failing due to duplicate classes, conflicting with Firebase SDK - Unity 2019.4.26
Checklist
- [x] I've updated to the latest released version of the SDK
- [x] I've searched for existing GitHub issues
- [x] I've looked for existing answers on Stack Overflow, the Facebook Developer Community Forum and the Facebook Developers Group
- [x] I've read the Code of Conduct
- [x] This issue is not security related and can safely be disclosed publicly on GitHub
Environment
Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:
- Unity Editor Version:
2019.4.26
- Unity SDK Version:
11.0.0
- Installation Platform & Version:
Android
versionany
- Firebase SDK 8.1.0
Goals
Build Project
Expected Results
Project built build successfully
Actual Results
Project is failing to build during gradle:
FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':launcher:checkDebugDuplicateClasses'. 1 exception was raised by workers: java.lang.RuntimeException: Duplicate class com.android.installreferrer.BuildConfig found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.android.installreferrer.api.InstallReferrerClient found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.android.installreferrer.api.InstallReferrerClient$1 found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.android.installreferrer.api.InstallReferrerClient$Builder found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.android.installreferrer.api.InstallReferrerClient$InstallReferrerResponse found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.android.installreferrer.api.InstallReferrerClientImpl found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.android.installreferrer.api.InstallReferrerClientImpl$1 found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.android.installreferrer.api.InstallReferrerClientImpl$ClientState found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.android.installreferrer.api.InstallReferrerClientImpl$InstallReferrerServiceConnection found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.android.installreferrer.api.InstallReferrerStateListener found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.android.installreferrer.api.ReferrerDetails found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.android.installreferrer.commons.InstallReferrerCommons found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.google.android.finsky.externalreferrer.IGetInstallReferrerService found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.google.android.finsky.externalreferrer.IGetInstallReferrerService$Stub found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.google.android.finsky.externalreferrer.IGetInstallReferrerService$Stub$Proxy found in modules classes.jar (:installreferrer-1.0:) and classes.jar (com.android.installreferrer:installreferrer:1.0) Duplicate class com.google.zxing.BarcodeFormat found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.Binarizer found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.BinaryBitmap found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.ChecksumException found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.DecodeHintType found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.EncodeHintType found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.FormatException found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.LuminanceSource found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.MultiFormatReader found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.MultiFormatWriter found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.MultiFormatWriter$1 found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.NotFoundException found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.PlanarYUVLuminanceSource found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.RGBLuminanceSource found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.Reader found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.ReaderException found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.Result found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.ResultMetadataType found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.ResultPoint found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.ResultPointCallback found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.Writer found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.WriterException found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.aztec.AztecDetectorResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.aztec.AztecReader found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.aztec.decoder.Decoder found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.aztec.decoder.Decoder$1 found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.aztec.decoder.Decoder$Table found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.aztec.detector.Detector found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.aztec.detector.Detector$Point found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.AbstractDoCoMoResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.AddressBookAUResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.AddressBookDoCoMoResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.AddressBookParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.BizcardResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.BookmarkDoCoMoResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.CalendarParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.EmailAddressParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.EmailAddressResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.EmailDoCoMoResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.ExpandedProductParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.ExpandedProductResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.GeoParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.GeoResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.ISBNParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.ISBNResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.ParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.ParsedResultType found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.ProductParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.ProductResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.ResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.SMSMMSResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.SMSParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.SMSTOMMSTOResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.SMTPResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.TelParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.TelResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.TextParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.URIParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.URIResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.URLTOResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.VCardResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.VEventResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.WifiParsedResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.client.result.WifiResultParser found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.common.BitArray found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.common.BitMatrix found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.common.BitSource found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.common.CharacterSetECI found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.common.DecoderResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.common.DefaultGridSampler found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.common.DetectorResult found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.common.GlobalHistogramBinarizer found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.zxing.common.GridSampler found in modules MIO_SDK_UNITY_1.3.9_10156.jar (:UnityChannel:) and core-3.3.3.jar (com.google.zxing:core:3.3.3) Duplicate class com.google.
Steps to Reproduce
- Create new unity 2019.4.26 project
- Set project build target to Android.
- Import Facebook SDK 11.0.0
- Import the latest Firebase Analytics SDK 8.1.0 into the project.
- Import External Dependency Manager
- Enable mainTemplate.gradle (Player settings -> publishing settings -> check custom gradle template)
- Click Assets -> External Dependency Manager -> Resolve
- Enable Jetifier when prompted (or Assets -> External Dependency Manager -> Settings -> Enable Jetifier)
- Build the project
Code Samples & Details
If you comment out the Firebase implementations in mainTemplate.gradle, the project compiles. If you comment out the Facebook implementations in mainTemplate.gradle, the project compiles.
However, having both UNCOMMENTED (enabled), the above exception is observed.
I got the same issue when including installreferrer jar from other library
Same issue
Any fix?
Getting the same issue on Unity 2020.3.16f1
Anyone have a fix? I updated Facebook SDK and Firebase, and I still get the error :/