Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Can't build for Android because of duplicated asset entries

Discussion in 'Addressables' started by yusufdemir2012, Mar 10, 2023.

  1. yusufdemir2012

    yusufdemir2012

    Joined:
    Dec 21, 2013
    Posts:
    49
    We are using Addressables in our project and sometimes we can't take build for android platform.

    The problem only occurs when takes android build(Not addressable build) with using Split Application Binary and Build App Bundle (Google Play) options. If I take a build with unchecked Build App Bundle (Google Play) , then build completes successfully and I can run the apk on any real android device. But if I take a build with Build App Bundle (Google Play) , the final aab is generating and I see a popup in Unity about the size of output aab, If I click the "Compute sizes" button then I see duplicated asset entries error on console. After all, if I try to upload the output aab to google play console then I see same error on google play console after upload completed and the upload fails.

    Knowns:
    • If I delete the Library folder the problem is fixed for one time build. But when I delete this folder, it takes ages because the whole project is re-imported... This solution is working for one time; if I try to take a second build after first build it's fails with same error.
    • I am already tried to take new addressable build, this had no effect.
    • I've been having this problem for the past 1 year at Unity 2020.3.1, 2021.3.2 and 2021.3.20.
    • The problem is completely different from this fixed issue.
    • In stacktrace, seems like problem occurs because of a specific bundle, but it's not. If I remove the bundle that mentioned in stacktrace from the project, then an another bundle gives same error on next build.

    Current Unity Version: 2021.3.20
    Current Addressables Version: 1.19.19
    Stacktrace:

    UnityException: Checking APKs size failed
    [BT:1.6.0] Error: Both modules 'base' and 'UnityDataAssetPack' contain asset entry 'assets/aa/Android/defaultlocalgroup_assets_assets/_game/sounds/vehiclesounds/realisticenginesound/assets/sounds/sounds_exotic/v12_aztamartini/low_off.wav_0e5305263431b7be6bc3d17f484cafb5.bundle'.
    com.android.tools.build.bundletool.model.exceptions.InvalidBundleException: Both modules 'base' and 'UnityDataAssetPack' contain asset entry 'assets/aa/Android/defaultlocalgroup_assets_assets/_game/sounds/vehiclesounds/realisticenginesound/assets/sounds/sounds_exotic/v12_aztamartini/low_off.wav_0e5305263431b7be6bc3d17f484cafb5.bundle'.
    at com.android.tools.build.bundletool.model.exceptions.UserExceptionBuilder.build(UserExceptionBuilder.java:58)
    at com.android.tools.build.bundletool.validation.EntryClashValidator.checkEntryClash(EntryClashValidator.java:85)
    at com.android.tools.build.bundletool.validation.EntryClashValidator.lambda$checkEntryClashes$0(EntryClashValidator.java:64)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
    at com.google.common.collect.CollectSpliterators$1WithCharacteristics.lambda$forEachRemaining$1(CollectSpliterators.java:67)
    at java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:110)
    at com.google.common.collect.CollectSpliterators$1WithCharacteristics.forEachRemaining(CollectSpliterators.java:67)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
    at com.android.tools.build.bundletool.validation.EntryClashValidator.checkEntryClashes(EntryClashValidator.java:60)
    at com.android.tools.build.bundletool.validation.EntryClashValidator.validateAllModules(EntryClashValidator.java:51)
    at com.android.tools.build.bundletool.validation.ValidatorRunner.validateBundleModulesUsingSubValidator(ValidatorRunner.java:75)
    at com.android.tools.build.bundletool.validation.ValidatorRunner.validateBundleUsingSubValidator(ValidatorRunner.java:69)
    at com.android.tools.build.bundletool.validation.ValidatorRunner.lambda$validateBundle$3(ValidatorRunner.java:58)
    at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:406)
    at com.android.tools.build.bundletool.validation.ValidatorRunner.validateBundle(ValidatorRunner.java:58)
    at com.android.tools.build.bundletool.validation.AppBundleValidator.validate(AppBundleValidator.java:106)
    at com.android.tools.build.bundletool.commands.BuildApksCommand.execute(BuildApksCommand.java:678)
    at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:76)
    at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:48)

     
    Last edited: Mar 20, 2023
  2. yusufdemir2012

    yusufdemir2012

    Joined:
    Dec 21, 2013
    Posts:
    49
    Is anyone looking here?
     
  3. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    Hi @yusufdemir2012 does the issue still occur in the latest Addressables (1.21.9)? If so, can you submit a bug report? The bundles folder shouldn't be getting included in the "base" asset pack.
     
  4. usama_unity466

    usama_unity466

    Joined:
    Jan 27, 2022
    Posts:
    4
    i'm using Addressables (1.21.17) and still facing the same issue