'Unity Addressables: RemoteProviderException : TextDataProvider : unable to load from url /base.apk!/assets/aa/settings.json

I have followed closely the samples for using the play asset delivery in my project as it is from here: https://github.com/Unity-Technologies/Addressables-Sample

I have prepared a single addressable package with a few scenes in it and marked it On-Demand. When I test in the editor (via Addressables.InitializeAsync() and Addressables.DownloadDependenciesAsync) all works fine. The pack is loaded and scene displayed. When I upload the instant app to the play console (internal testing) and run it on device, I get the following error 404 and other errors after that (see below). It seems looking for the settings.json in the base apk, but that file is in the bundle. How can I fix this? Tried with two devices and got the same error.

quote RemoteProviderException : TextDataProvider : unable to load from url : jar:file:///data/app/~~ZhQZpprHVhrDt8BlKkhj-Q==/com.xxx.yyy-fghV3Mdrsb3j3mBwDmAVsg==/base.apk!/assets/aa/settings.json 05-02 22:28:26.378 14876 14929 E Unity : UnityWebRequest result : ProtocolError : HTTP/1.1 404 Not Found 05-02 22:28:26.378 14876 14929 E Unity : ResponseCode : 404, Method : GET 05-02 22:28:26.378 14876 14929 E Unity : url : jar:file:///data/app/~~ZhQZpprHVhrDt8BlKkhj-Q==/com.xxx.yyy-fghV3Mdrsb3j3mBwDmAVsg==/base.apk!/assets/aa/settings.json ... RuntimeData is null. Please ensure you have built the correct Player Content. ... Addressables - Unable to load runtime data at location UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle1[[UnityEngine.AddressableAssets.Initialization.ResourceManagerRuntimeData, Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]. 05-02 22:28:26.380 14876 14929 E Unity : OperationException : Addressables - Unable to load runtime data at location UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle1[[UnityEngine.AddressableAssets.Initialization.ResourceManagerRuntimeData, Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]. ... OperationException : ChainOperation failed because dependent operation failed 05-02 22:28:26.417 14876 14929 E Unity : UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown. No Location found for Key=MainMenu



Solution 1:[1]

I could try to provide some more info hopefully to help someone else who had the same issue.

The "Split Application Binary" (enabled) option in Player Settings is responsible for dividing the aab and adding a part called asset-slices. If the addressables groups and .androidpack folders (I missed that part) are not setup properly, unity will move the settings.json file to the asset-slices folder and this will result to this error, because the json is no longer part of the base apk.

So to fix this, make sure "Split Application Binary" is disabled and the .androidpack folders are into place.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 userq