Search Unity

Resolved First build does not export Addressables to Android device

Discussion in 'Addressables' started by c8theino, Apr 27, 2021.

  1. c8theino

    c8theino

    Joined:
    Jun 1, 2019
    Posts:
    20
    Hi, I have come across a strange bug. For some reason, every time I build my Unity project for the first time to Android device, the Addressables do not work. Then if I just simply press "Build And Run" again, they work just as intended. What is strange about this problem, is that it only seems to happen if I have taken around 30-60 minutes break from my last build. I have tried spamming the build 5 times after Addressables have failed, but it's always only the first build which fails.

    I have a simple GameObject prefab in Addressables Default Local Group which I spawn using this pooling system: https://github.com/ivan70f/ObjectPoolingWithAddressables

    I have tried all of these and none of them have helped:
    1. Clicking the Build -> New Build -> Default Build Script in the Addressables menu.
    2. Setting the Managed Stripping Level to "Disabled".
    3. Adding this link.xml file:
    Code (xml):
    1. <linker>
    2.     <assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null preserve="all">
    3.     <type fullname="UnityEngine.ResourceManagement.ResourceProviders.LegacyResourcesProvider" preserve="all" />
    4.     <type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
    5.     <type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
    6.     <type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
    7.     <type fullname="UnityEngine.ResourceManagement.AsyncOperations" preserve="all" />
    8.     </assembly>
    9.     <assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
    10.     <type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
    11.     </assembly>
    12. </linker>
    Here are all the error messages I have gotten from the AndroidPlayer:
    • Exception encountered in operation Resource<ResourceManagerRuntimeData>(settings.json), status=Failed, result= : TextDataProvider unable to load from url jar:file:///data/app/<app-name>-IGEWd8sOnMQzovsaq4CYpw==/base.apk!/assets/aa/settings.json, result='HTTP/1.1 404 Not Found'.
    • RuntimeData is null. Please ensure you have built the correct Player Content.
    • Addressables - Unable to load runtime data at location UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[[UnityEngine.AddressableAssets.Initialization.ResourceManagerRuntimeData, Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]].
    • Exception encountered in operation InitializationOperation, status=Failed, result= : Addressables - Unable to load runtime data at location UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[[UnityEngine.AddressableAssets.Initialization.ResourceManagerRuntimeData, Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]
    • Exception encountered in operation CompletedOperation, status=Failed, result= : Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=608a9882a27665842b7577523d28497a, Type=UnityEngine.GameObject
    • Default constructor not found for type UnityEngine.ResourceManagement.ResourceManager+CompletedOperation

    OS: Windows 10
    Unity Version: 2020.3.5f1
    Addressables version: 1.17.17

    Edit: It must have been an coincidence, but it seems to be totally random when it fails at building the Addressables.
     
    Last edited: Apr 29, 2021
  2. niielle

    niielle

    Joined:
    Mar 19, 2021
    Posts:
    2
    are you using google platform as your bundle server?
    google often have a 9-15min delayed after upload
     
  3. javierfed

    javierfed

    Joined:
    Apr 10, 2015
    Posts:
    50
    bump
    I am getting this exception from addressables...

    2021/06/09 14:18:28.369 19457 24612 Error Unity RemoteProviderException : TextDataProvider : unable to load from url : jar:file:///data/app/~~s0s0mP1DC_aLjV0MXCvloQ==/<app-name>-T2K6sx3fubkomX71fB3YuQ==/base.apk!/assets/aa/settings.json

    I am using addressables to load the files from a remote server (firebase) but this exception is trying to load from local filestore. I am employing the link.xml script as above.
     
  4. javierfed

    javierfed

    Joined:
    Apr 10, 2015
    Posts:
    50
    after clearing all cache, rebuilding the addressables bundles, then building and deploying those onto our firebase storage, and finally installing it on device, somehow this is resolved.
     
  5. arufolo-wellovate

    arufolo-wellovate

    Joined:
    Jul 5, 2022
    Posts:
    5
    We experienced this same issue. Factory resetting our Android device solved the problem. Even after uninstalling/reinstalling the application, the issue occurred. Really strange.