Search Unity

Bug Building .aab with splitted binary not longer possible (CheckDuplicatesRunnable Error)

Discussion in 'Android' started by Axel-F, Apr 3, 2023.

  1. Axel-F

    Axel-F

    Joined:
    Mar 20, 2009
    Posts:
    224
    I'm trying to build an .aab with splitted binary - witch results now in a DuplicatesRunnable Error. I guess there is something wrong with gradle, as I do not have the mentioned .aar files in my project.
    Furthermore I have no custom gradle templates in use.

    The problems sounds very similar to this one.
    Just that I’m using the lates PlayGames plugin, and not Firebase.
    Anybody else with this bug? I tried the latest Unity 2023 and 2022.

    Forcing Jetifier and androidx in a gradle properties template results in a similar error.

    E.g. I have in my project the
    androidx.core.core-1.2.0 AAR - and the mentioned duplicate support-compat-26.1.0 AAR was added by gradle when building the AAB. I’ve found the duplicate in the gradle cache directory.


    stderr[
    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.0:) 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.0:) 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.0:) 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.0:) 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.0:) 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.0:) 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.0:) 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.0:) 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.0:) 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.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) 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.0.0-runtime (:com.google.android.gms.play-services-basement-18.0.0:) and play-services-basement-16.0.1-runtime
     
    Last edited: Apr 4, 2023
    3dpowermax and FrozenN like this.
  2. Axel-F

    Axel-F

    Joined:
    Mar 20, 2009
    Posts:
    224
    To answer my own question - and after 2 days research - I had to add these lines to my "Main Gradle Template":

    Code (CSharp):
    1. configurations.implementation {
    2.     exclude(group : "com.android.support")
    3.     exclude(group : "com.google.android.gms")
    4. }
    And, as I do not use a custom template - I had to alter the template created by Unity via IPostGenerateGradleAndroidProject in the following C# AndroidPostBuildProcessor.cs script:

    Code (CSharp):
    1. using System.IO;
    2. using UnityEditor.Android;
    3. using UnityEngine;
    4.  
    5. public class AndroidPostBuildProcessor : IPostGenerateGradleAndroidProject
    6. {
    7.     public int callbackOrder
    8.     {
    9.         get
    10.         {
    11.             return 999;
    12.         }
    13.     }
    14.  
    15.     void IPostGenerateGradleAndroidProject.OnPostGenerateGradleAndroidProject(string path)
    16.     {
    17.         Debug.Log("Bulid path : " + path);
    18.  
    19.         string gradlePropertiesFile = path + "/build.gradle";
    20.         string content = File.ReadAllText(gradlePropertiesFile);
    21.         if (!content.Contains("configurations.implementation"))
    22.         {
    23.             content += "\r\nconfigurations.implementation {\r\n    exclude(group : \"com.android.support\")\r\n\texclude(group : \"com.google.android.gms\")\r\n}";
    24.             File.WriteAllText(gradlePropertiesFile, content);
    25.         }
    26.     }
    27. }
    Now I can build APK and AAB with splitted application binaries again.
     
  3. rmgalante

    rmgalante

    Joined:
    Nov 21, 2009
    Posts:
    59
    This worked for me. Thanks.
     
  4. Samsle

    Samsle

    Joined:
    Mar 31, 2020
    Posts:
    110
    Worked for me too, thank you!

    My case:
    PlayGameServices actual needs the package com.unity.modules.androidjni.
    Without, it throws errors like this
    Code (CSharp):
    1. The type name 'AndroidJavaProxy' could not be found in the namespace 'UnityEngine'.
    2. This type has been forwarded to assembly 'UnityEngine.AndroidJNIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
    3. Enable the built in package 'Android JNI' in the Package Manager window to fix this error.
    You can build with this combination successfully, but not with enabled "Split Application Binary".
    Then you get this "checkReleaseDuplicateClasses Exception".
    For me it was some of these errors (First I got actual the same error as the thread author, but with enabled custom gradle this different one)
    Duplicate class
    android.support.v4.graphics.drawable.IconCompatParcelizer
    found in
    modules core-1.0.0-runtime (androidx.core:core:1.0.0)
    and
    jetified-androidx.core.core-1.2.0-runtime (androidx.core.core-1.2.0)


    So "androidx.core:core:1.0.0" is actual from the package com.unity.modules.androidjni and "androidx.core.core-1.2.0" from PlayGameServices.
     
    mdbtfw likes this.
  5. Nith666

    Nith666

    Joined:
    Aug 1, 2012
    Posts:
    57
    @Axel-F You, Sir, saved my day :) Awesome, many thanks for spending 2 days of research on this!
     
  6. Axel-F

    Axel-F

    Joined:
    Mar 20, 2009
    Posts:
    224
    You are welcome.
     
  7. zh1996

    zh1996

    Joined:
    Sep 17, 2018
    Posts:
    2
    thank you very much.
    I seem to have one more duplicate citation than yours:
    Code (CSharp):
    1. configurations.implementation {
    2.     exclude(group : "com.android.support")
    3.     exclude(group : "com.google.android.play")
    4.     exclude(group : "com.google.android.gms")
    5. }
     
  8. joelatsproutel

    joelatsproutel

    Joined:
    Jun 10, 2015
    Posts:
    7
    Thank you very much @Axel-F for sharing this! I also had this issue: in a project with Firebase (like the link in your first post). I wasn't able to solve it with the approach discussed in that link, but your fix solved things for me.
     
  9. Axel-F

    Axel-F

    Joined:
    Mar 20, 2009
    Posts:
    224
    I'm happy I could help!
     
  10. joelatsproutel

    joelatsproutel

    Joined:
    Jun 10, 2015
    Posts:
    7
    @Axel-F Have you submitted an official Unity Bug Report for this? Hopefully this can be fixed for 2022.3 LTS.

    I don't understand the full impact of excluding those groups, and where potential issues might appear for thorough testing and QA. So far, all of the services/features in my app appears to be functioning as expected. If you could share any thoughts around that, I'd be grateful!
     
    Last edited: Aug 15, 2023
  11. voyantsimulator

    voyantsimulator

    Joined:
    Jan 13, 2023
    Posts:
    2
  12. jhlee8

    jhlee8

    Joined:
    Feb 12, 2020
    Posts:
    1
    Cause: Starting with Unity 2022, the PlayCore library changes from com.google.android.play:core:1.10.0 → com.google.android.play:asset-delivery:2.0.0.
    com.google.android.play:asset-delivery:2.0.0 is using play-services-basement:16.0.1.
    And a library added elsewhere uses play-services-basement-18.0.0.
    The two dependency libraries conflict with each other.
     
    Last edited: Aug 22, 2023
  13. rastleks

    rastleks

    Joined:
    Jul 17, 2014
    Posts:
    49
    Almost same problem, but nothing helped :( Maybe someone give me some intel on how to solve it?

    Code (CSharp):
    1.   java.lang.RuntimeException: Duplicate class com.google.android.play.core.common.IntentSenderForResultStarter found in modules jetified-core-1.10.0-runtime.jar (com.google.android.play:core:1.10.0) and jetified-core-common-2.0.2-runtime.jar (com.google.android.play:core-common:2.0.2)
    2.   Duplicate class com.google.android.play.core.common.LocalTestingException found in modules jetified-core-1.10.0-runtime.jar (com.google.android.play:core:1.10.0) and jetified-core-common-2.0.2-runtime.jar (com.google.android.play:core-common:2.0.2)
    3.   Duplicate class com.google.android.play.core.common.PlayCoreDialogWrapperActivity found in modules jetified-core-1.10.0-runtime.jar (com.google.android.play:core:1.10.0) and jetified-core-common-2.0.2-runtime.jar (com.google.android.play:core-common:2.0.2)
    4.   Duplicate class com.google.android.play.core.listener.StateUpdatedListener found in modules jetified-core-1.10.0-runtime.jar (com.google.android.play:core:1.10.0) and jetified-core-common-2.0.2-runtime.jar (com.google.android.play:core-common:2.0.2)
    5.   Duplicate class com.google.android.play.core.review.ReviewInfo found in modules jetified-core-1.10.0-runtime.jar (com.google.android.play:core:1.10.0) and jetified-review-2.0.1-runtime.jar (com.google.android.play:review:2.0.1)
    6.   Duplicate class com.google.android.play.core.review.ReviewManager found in modules jetified-core-1.10.0-runtime.jar (com.google.android.play:core:1.10.0) and jetified-review-2.0.1-runtime.jar (com.google.android.play:review:2.0.1)
    7.   Duplicate class com.google.android.play.core.review.ReviewManagerFactory found in modules jetified-core-1.10.0-runtime.jar (com.google.android.play:core:1.10.0) and jetified-review-2.0.1-runtime.jar (com.google.android.play:review:2.0.1)
    8.   Duplicate class com.google.android.play.core.review.model.ReviewErrorCode found in modules jetified-core-1.10.0-runtime.jar (com.google.android.play:core:1.10.0) and jetified-review-2.0.1-runtime.jar (com.google.android.play:review:2.0.1)
    9.   Duplicate class com.google.android.play.core.review.testing.FakeReviewManager found in modules jetified-core-1.10.0-runtime.jar (com.google.android.play:core:1.10.0) and jetified-review-2.0.1-runtime.jar (com.google.android.play:review:2.0.1)
     
  14. Nith666

    Nith666

    Joined:
    Aug 1, 2012
    Posts:
    57
    If you're on Unity 2022+ it might help to activate the custom gradle properties, custom gradle settings and custom gradle template in the Publishing settings
     
  15. rastleks

    rastleks

    Joined:
    Jul 17, 2014
    Posts:
    49
    Im on Unity 2021 :( And this settings all activated.
     
  16. CtrlAltDel_te

    CtrlAltDel_te

    Joined:
    Aug 11, 2020
    Posts:
    1
    I look at com.google.android.play:*version*, can you check, maybe your project have 2 versions of one plugin? If yes - try to delete one of them, it should help.
     
  17. digifoxreg

    digifoxreg

    Joined:
    Sep 25, 2018
    Posts:
    6
    Posting this as future help for others, here is a slightly modified version of @Axel-F's code:
    Code (CSharp):
    1. using System.IO;
    2. #if UNITY_EDITOR
    3. using UnityEditor.Android;
    4.  
    5. public class AndroidPostBuildProcessor : IPostGenerateGradleAndroidProject
    6. {
    7.     public int callbackOrder => 999;
    8.  
    9.     void IPostGenerateGradleAndroidProject.OnPostGenerateGradleAndroidProject(string path)
    10.     {
    11.         UnityEngine.Debug.Log("Bulid path : " + path);
    12.  
    13.         string gradlePropertiesFile = path + "/build.gradle";
    14.         string content = File.ReadAllText(gradlePropertiesFile);
    15.         int index = content.IndexOf("configurations.implementation");
    16.         if (index >= 0) content = content[0..index];
    17.         content += "\r\n" +
    18.             "configurations.implementation " +
    19.             "{\r\n    " +
    20.             "exclude(group : \"com.android.support\")\r\n" +
    21.             "exclude(group : \"com.google.android.gms\")\r\n" +
    22.             "exclude(group : \"com.google.android.play\")\r\n" +
    23.             "}";
    24.         File.WriteAllText(gradlePropertiesFile, content);
    25.     }
    26. }
    27. #endif
    All I changed is the way Unity's gradle file is updated, before it was updated only for the first time you tried to build the game. In my case, I was missing "exclude(group : "com.google.android.play")" attribute which wasn't added afterwards due to this if statement:
    Code (CSharp):
    1. if (!content.Contains("configurations.implementation"))
    Try this out if you are still getting errors with "com.google.android.play" library! Again big thanks to @Axel-F for finding this out!
     
  18. SKGowrob

    SKGowrob

    Joined:
    Sep 12, 2021
    Posts:
    11
    Thank you so much bro. It fixed my issue.
     
  19. chaosmonger

    chaosmonger

    Joined:
    Jan 23, 2019
    Posts:
    71
    Hello... Similar problem here. I'm using Unity 2021.3.24.
    The only package I imported from Google Play is the integrity one.
    Build has no errors if "Split Application Binary" is unchecked, but then it fails on the backend due to the size being over 150MB.
    If "Split Application Binary" is checked, I get the following error while building:


    If I follow what's suggested, I get an error on console, saying "Resolve Failed" and suggests me to check also Custom Gradle Properties Template. So I check also that (therefore in my Publish Settings I've both Custom Main Gradle and Custom Gradle Properties checked).
    Then all the plugins are wiped away from the plugins/Android folder, and just the two templates are there (gradleTemplate and mainTemplate).
    If I build that way, I get no errors, but my app doesn't include the android libraries, and when requesting an integrity token, I get this error in the android logcat: "java.lang.ClassNotFoundException: com.google.android.play.core.integrity.IntegrityManagerFactory" which indicates that the plugin is not there.

    What am I doing wrong and how can I solve it?
    I read on this thread about the AndroidPostBuildProcessor... Shall I change something there and exclude the integrity ("com.google.play.integrity")? Or am I doing something wrong with that script or how to use it (not sure where to put exactly the configuration lines on my mainTemplate)? Can someone give me some guidance?

    This happens also on a totally blank project.

    Thanks a lot.
     
  20. matthklo

    matthklo

    Joined:
    Jun 1, 2017
    Posts:
    2
    Guys, it seems Unity has finally fixed this issue in the 2022.3.12f1. Quoted from the release notes of 2022.3.12f1:

    https://unity.com/releases/editor/whats-new/2022.3.12
     
    su32132 likes this.
  21. chaosmonger

    chaosmonger

    Joined:
    Jan 23, 2019
    Posts:
    71
  22. mcarriere

    mcarriere

    Joined:
    Sep 14, 2012
    Posts:
    106
    This is in the "Known Issues" portion of the release notes. This is an acknowledgement of the problem, not a fix.

    That being said, we can confirm that the grade post build processor is working for us to resolve this issue. (Thanks!)
     
  23. frozenwolfstudio9

    frozenwolfstudio9

    Joined:
    Jun 7, 2023
    Posts:
    15
    Any news on this? None of the answers from above worked for me, unfortunately :/
     
  24. chaosmonger

    chaosmonger

    Joined:
    Jan 23, 2019
    Posts:
    71
    I'm bumping it too, especially at least for some clarification to how to use the solutions (for the ones that made it work thanks to some workaround, see my other post above). Maybe I'm simply applying wrongly the suggested fixes...
     
  25. go3000

    go3000

    Joined:
    Feb 17, 2020
    Posts:
    6
    For these who still struggle in this issue:

    https://github.com/firebase/firebase-unity-sdk/issues/661#issuecomment-1803420952

    the fix from Unity that works for me (I use only GooglePlayGames and GoogleMobileAds plugins):

    1 - clean up all aar and jar files and also their metafiles from Assets/Plugins/Android folder
    2 - delete Library/Bee/Android/Prj/IL2CPP/Gradle folder
    3 - open project
    4 - check that Custom Main Gradle Template, Custom Gradle Settings Template, Custom Gradle Properties Template are turned on in Player settings
    5 - run Assets/Eternal Dependency Manager/Android Resolver/Resolve (it should end immediately, there should be no new files in Assets/Plugins/Android appear)
    6 - build AAB

    This works perfect for me, and with minimist adjustment.
     
    pandolfini likes this.
  26. citronovafuska

    citronovafuska

    Joined:
    Jul 7, 2020
    Posts:
    4
    @Axel-F I cannot thank you enough. Spent the whole day trying various stuff and your solution finally fixes it so it is buildable. It is ridiculous that workaround like this must be done. Unity should have already adressed this, it is severe issue making the game not deployable and it has been here some time already.

    When you have aab below 150MB everything is fine. Otherwise. When splitting aab, it does always this dupplicates in new Unity version. Custom graddle should fix that, but with this, android resolver doesnt work at all, android resolver only works in default gradle (atleast for me and i tried unity 2022.3 and 2023.1). When i tried using resolver in default and then switched to custom gradle, it always hanged on building scene 0. Looking manually through duplicates one by one and deleting them also didnt work, game was built but crashed instantly on launch.

    So thank you again for your script :)
     
    pandolfini likes this.
  27. pandolfini

    pandolfini

    Joined:
    Feb 5, 2020
    Posts:
    17
    This works properly. I would not use the other solutions above. Unity also should fix the underlying issue.
     
  28. 3dpowermax

    3dpowermax

    Joined:
    Sep 9, 2013
    Posts:
    111
    thanks works for me !