Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Fail to build App Bundle (.aab file) with ARcore

Discussion in 'AR' started by kfireven, Sep 27, 2021.

Thread Status:
Not open for further replies.
  1. kfireven

    kfireven

    Joined:
    Oct 18, 2016
    Posts:
    38
    There is an issue when building App Bundles with ARcore installed and checking "split application binary", you get this error:

    Code (CSharp):
    1. UnityException: Checking APKs size failed
    2. [BT:1.6.0] Error: Both modules 'base' and 'UnityDataAssetPack' contain asset entry 'assets/bin/Data/UnitySubsystems/UnityARCore/UnitySubsystemsManifest.json'.
    3. com.android.tools.build.bundletool.model.exceptions.InvalidBundleException: Both modules 'base' and 'UnityDataAssetPack' contain asset entry 'assets/bin/Data/UnitySubsystems/UnityARCore/UnitySubsystemsManifest.json'.
    I found more people with the exact same issue here:
    https://githubmemory.com/repo/Unity-Technologies/Addressables-Sample/issues/58
    https://answers.unity.com/questions/1859871/unityarcore-android-app-bundle-split-binary-issue.html

    Are you aware of this? Are there any temporary fixes we can apply until a permanent fix is available?
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
    kfireven likes this.
  3. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    For the record, you can write a build postprocessor to delete the duplicate. Implement
    IPostGenerateGradleAndroidProject
    in an editor file, and
    Directory.Delete(Path.Combine(path, @"../UnityDataAssetPack/src/main/assets/bin/Data/UnitySubsystems"), true);
    .

    If you also do non-AAB builds best check the path exists first.
     
  4. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    That issue is marked as non-reproducible. It's reproducible 100% of the time here, but the repro steps are wrong there. Split Application Binary must be on for Unity to create the UnityDataAssetPack. My actual determination on whether a build has succeeded or not is different too, we don't do build and run, builds succeed every time, what fails is processing of the build when uploading the AAB to the Play Store (which is presumably the same process).
     
  5. HardK

    HardK

    Joined:
    Nov 5, 2016
    Posts:
    7
    Thank you for the workaround @AlkisFortuneFish !

    I made it into a script if anyone needs, just drag & drop to the Editor folder.

    Cheers
     

    Attached Files:

    AlkisFortuneFish likes this.
  6. VoldemortEatsBurgers

    VoldemortEatsBurgers

    Joined:
    Jun 28, 2021
    Posts:
    6
    Guys, for this or almost similar cases (in which problem with the different file direction) I advice you just to delete Library folder from Unity project, then start your project from Unity hub. Unity will rewrite its Library without any problems, and this problem will go away. It helped me to solve this. I always do the Library rewrite in such weird cases. Hope my advice will help other people! :) But remember, if your project is quite large (>40Gb), then it can take really a lot of time. Rewrite of Library takes 1-1.5 hours (but obviously it also depends from your`s PC capacity), switching adain to Android takes 1 hour, first build after that can be up to 1-2 hours.
     
  7. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
Thread Status:
Not open for further replies.