question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

[Bug] Unable to build AAB with enabled setting "Split application binary"

See original GitHub issue

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2022, 2023
  • Firebase Unity SDK version: 10.5, 10.6, maybe also early releases
  • Source you installed the SDK: .unitypackage
  • Problematic Firebase Component: I think any ( for sure Analytics, I used it for tests)
  • Other Firebase Components in use: no
  • Additional SDKs you are using: no
  • Platform you are using the Unity editor on: Windows
  • Platform you are targeting: Android
  • Scripting Runtime: IL2CPP
  • Pre-built SDK from the website or open-source from this repo: website

[REQUIRED] Please describe the issue here:

When Iโ€™m trying to build an AAB file with the enabled setting โ€œSplit application binaryโ€ Iโ€™m facing errors, telling me about duplicate classes.

Im not sure, if this bug is related to Firebase SDK or to Unity. If this issue is not related to the Firebase SDK - tell me, ill create a ticket somewhere on the Unity side. Below is additional information to help understand the problem.

I tried to reproduce it on different Unity versions : 2021 - Success. 2022, 2023 - FAIL.

I tried to reproduce it with different settings : Build AAB, โ€œSplit application binaryโ€ is enabled - FAIL. Build AAB, โ€œSplit application binaryโ€ is disabled - Success. Build APK, โ€œSplit application binaryโ€ is enabled - Success. Build APK, โ€œSplit application binaryโ€ is disabled - Success.

Log :

`FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task โ€˜:launcher:checkReleaseDuplicateClassesโ€™.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class android.support.v4.app.INotificationSideChannel found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.๐Ÿ˜‡ and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.๐Ÿ˜‡ and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.๐Ÿ˜‡ and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.IResultReceiver found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.๐Ÿ˜‡ and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.๐Ÿ˜‡ and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.๐Ÿ˜‡ and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.ResultReceiver found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.๐Ÿ˜‡ and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.ResultReceiver$1 found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.๐Ÿ˜‡ and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.๐Ÿ˜‡ and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules androidx.core.core-1.2.0-runtime (:androidx.core.core-1.2.๐Ÿ˜‡ and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class com.google.android.gms.actions.ItemListIntents found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.actions.NoteIntents found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.actions.ReserveIntents found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.actions.SearchIntents found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.AccountPicker found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.BlockingServiceConnection found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.ConnectionResult found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.Feature found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.FirstPartyScopes found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.GoogleApiAvailabilityLight found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.GooglePlayServicesNotAvailableException found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.GooglePlayServicesRepairableException found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.GooglePlayServicesUtilLight found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.GoogleSignatureVerifier found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.ProGuardCanary found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.Scopes found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.UserRecoverableException found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.annotation.KeepForSdk found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.annotation.KeepForSdkWithFieldsAndMethods found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.annotation.KeepForSdkWithMembers found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.annotation.KeepName found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.ApiException found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.CommonStatusCodes found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.Releasable found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.ResolvableApiException found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.ResolvingResultCallbacks found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.Response found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.Result found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.ResultCallback found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.ResultCallbacks found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.Scope found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.Status found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.UnsupportedApiCallException found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.internal.BackgroundDetector found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.internal.BackgroundDetector$BackgroundStateChangeListener found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.internal.GoogleServices found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.internal.LifecycleActivity found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.internal.LifecycleCallback found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.internal.LifecycleFragment found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.internal.StatusExceptionMapper found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.internal.zza found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1) Duplicate class com.google.android.gms.common.api.internal.zzb found in modules com.google.android.gms.play-services-basement-18.1.0-runtime (:com.google.android.gms.play-services-basement-18.1.๐Ÿ˜‡ and play-services-basement-16.0.1-runtime (com.google.android.gms:play-services-basement:16.0.1)`

Steps to reproduce:

  1. Create a new Unity android project
  2. Add Firebase Analytics component.
  3. In player settings enable โ€œSplit application binaryโ€
  4. In build settings enable โ€œBuild App Bundleโ€
  5. In build settings press the โ€œBuildโ€ button

Relevant Code:

sc

Issue Analytics

  • State:open
  • Created 6 months ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
chkuang-gcommented, Apr 18, 2023

@RaoulRb12 @streaminspace

I think both of you are experiencing the same issue mentioned here. https://github.com/googlesamples/unity-jar-resolver/issues/594

Key way to identify this is some message like

Could not find com.xxx.xxx
Searched in the following locations:

Basically, Unity changed the place to specify Maven Repo from mainTemplate.gradle to settingsTemplate.gradle from Unity 2022.2+ . And this change in EDM4U should fixed it.

I am working on a release once I sort out all the failed test in EDM4U.

At the meantime, here is my recommendation

  1. Upgrade to Unity 2022.2.10+ if you are using Unity 2022.2. Unity 2022.2.1 to 2022.2.9 has bugs that template variable like **DIR_UNITYPROJECT** does not work in settingsTemplate.gradle. If you HAVE to use those versions, convert all local custom Maven repo paths to full absolute path like /user/someone/path/to/unity_project\... or C:\User\someone\path\to\unity_project\... for what will be described in the next part.
  2. Enable Custom Settings Gradle Template, which is added in 2022.2.10 and 2023.1. And move all Maven repos added in mainTemplate.gradle to that dependencyResolutionManagement block. You can see this as an example. Would be great if you can keep that // Android Resolver Repos Start and // Android Resolver Repos End lines so that newer version of EDM4U can patch this block properly for you.

Let me know if this works for you.

1reaction
paulinoncommented, Mar 30, 2023

Hi @streaminspace,

Thanks for reporting this issue. I was able to reproduce this issue on my end using version 10.6.0 of the SDK on a 2023 version of the Unity editor. That said, Iโ€™ll be relaying my observations to the team, and Iโ€™ll let you know of any updates via this thread. For now, let me mark this as a bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug - Building .aab with splitted binary not longer possible ...
You can build with this combination successfully, but not with enabled "Split Application Binary". Then you get this "ย ...
Read more >
Application freezes or throws errors when built as an .AAB file ...
Player > Publishing Settings and enable Split Application Binary 3. Go to Build Settings and enable Build App Bundle (Google Play)
Read more >
Problem with AAB file and AR Foundation in Unity
I have read about problems related to AR with the AAB file when the Split Application Binary option is enabled. But this is...
Read more >
Unable to select split application binary ? : r/Unity3D
I am using unity 202.3, according to documentation, I should be able to pick split binary for .aab file (since google doesnt accept...
Read more >
About Android App Bundles
Build point of interest, internet of things, and navigation apps for cars. Using the Android for Cars App Library ยท Build point of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found