Unity-Technologies / Addressables-Sample

Demo project using Addressables package
1.31k stars 300 forks source link

Play Asset Delivery example breaks when using ARCore package #58

Open jmaliauka-gigxr opened 3 years ago

jmaliauka-gigxr commented 3 years ago

Hello!

I see the disclaimer that these examples are not guaranteed to work, but I am seeing a very strange issue when trying to use Addressables with Play Asset Delivery.

It seems like splitting the application binary causes an issue with the Unity Android build where a copy of UnitySubsystemsManifest.json is duplicated in both the base APK and the generated asset pack. I have only seen this happen while using the ARCore XR plugin so far.

Steps to reproduce:

  1. Open the PlayAssetDelivery SampleScene
  2. Install ARCore XR Plugin 4.1.7 or 4.2.0 through the Unity package manager UI
  3. Go through the setup steps as described in the Addressables-Sample project's README
  4. Ensure 'Split Application Binary' is checked in Player / Publishing settings
  5. Build the AAB

In a shell script:

bundletool="java -jar bundletool-all-1.8.0.jar"
$bundletool build-apks --bundle=$name.aab --output=$name.apks
$bundletool install-apks --apks=$name.apks

When I don't split the application binary, everything works fine! But when I do, I get the following error:

[BT:1.8.0] Error: Both modules 'base' and 'UnityDataAssetPack' contain asset entry 'assets/bin/Data/UnitySubsystems/UnityARCore/UnitySubsystemsManifest.json'.
com.android.tools.build.bundletool.model.exceptions.InvalidBundleException: Both modules 'base' and 'UnityDataAssetPack' contain asset entry 'assets/bin/Data/UnitySubsystems/UnityARCore/UnitySubsystemsManifest.json'.
        at com.android.tools.build.bundletool.model.exceptions.UserExceptionBuilder.build(UserExceptionBuilder.java:58)
        at com.android.tools.build.bundletool.validation.EntryClash
   ....

Unity version: 2020.3.15f2 Bundletool version: 1.8.0

Example of someone seeing the same issue: https://answers.unity.com/questions/1859871/unityarcore-android-app-bundle-split-binary-issue.html

The Addressable plugin's Analyze tool does not seem to mention this issue. (same warnings in both situations, never related to ARCore or Subsystems)

I can provide more information as needed. The issue is fairly simple to reproduce, the only difference is that the ARCore plugin is installed.

kirstenpilla commented 2 years ago

Hi @jmaliauka-gigxr I believe this issue has been fixed here! https://issuetracker.unity3d.com/issues/android-build-fails-when-using-arcore-xr-plugin-and-build-app-bundle-google-play-is-selected This appears to be a general engine bug rather than related to the sample project itself.

For any future bugs, please reporting them through the regular bug submission process https://unity3d.com/unity/qa/bug-reporting