1
\$\begingroup\$

We're using Unity 2020.3.18f1 and Addressables 1.19.4 (we've also tried 1.18.15)

Google requires us to split the game up before uploading it to the google play store. We built the game into an .apk and an .obb file and after installing it, the game crashes immediately with Addressables errors.

Installation Procedure:

  1. Build the game with split binary option checked
  2. adb install game.apk
  3. adb push main.4.studio.shortsleeve.game.obb /sdcard/Android/obb/studio.shortsleeve.game/

I verify that the obb file is there, then I run the game and get the following errors. I've also tried the build & run option to make sure the OBB ends up in the correct location.

09-15 10:50:56.639 27740  2255 E Unity   : RemoteProviderException : TextDataProvider : unable to load from url : jar:file:///data/app/~~689q54a8zSXXloEqeqgmbA==/studio.shortsleeve.voodoodetective-XMFOqP0J2uMakI-c6HOVJQ==/base.apk!/assets/aa/settings.json
09-15 10:50:56.639 27740  2255 E Unity   : UnityWebRequest result : ProtocolError : HTTP/1.1 404 Not Found
09-15 10:50:56.639 27740  2255 E Unity   : ResponseCode : 404, Method : GET
09-15 10:50:56.639 27740  2255 E Unity   : url : jar:file:///data/app/~~689q54a8zSXXloEqeqgmbA==/studio.shortsleeve.voodoodetective-XMFOqP0J2uMakI-c6HOVJQ==/base.apk!/assets/aa/settings.json
09-15 10:50:56.639 27740  2255 E Unity   :
09-15 10:50:56.639 27740  2255 E Unity   : System.Action`2:Invoke(T1, T2)
09-15 10:50:56.639 27740  2255 E Unity   : UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:set_OperationException(Exception)
09-15 10:50:56.639 27740  2255 E Unity   : UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:Complete(TObject, Boolean, Exception, Boolean)
09-15 10:50:56.639 27740  2255 E Unity   : UnityEngine.ResourceManagement.ResourceProviders.InternalOp:CompleteOperation(String, Exception)
09-15 10:50:56.639 27740  2255 E Unity   : UnityEngine.ResourceManagement.ResourceProviders.InternalOp:RequestOperation_completed(AsyncOperation)
09-15 10:50:56.639 27740  2255 E Unity   : System.Action`1:Invoke(T)
09-15 10:50:56.639 27740  2255 E Unity   : UnityEngine.AsyncOperation:InvokeCompletionEvent()
09-15 10:50:56.639 27740  2255 E Unity   :
09-15 10:50:56.640 27740  2255 E Unity   : RuntimeData is null.  Please ensure you have built the correct Player Content.
09-15 10:50:56.640 27740  2255 E Unity   : UnityEngine.ResourceManagement.AsyncOperations.InitalizationObjectsOperation:Execute()
09-15 10:50:56.640 27740  2255 E Unity   : UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:InvokeExecute()
09-15 10:50:56.640 27740  2255 E Unity   : System.Action`1:Invoke(T)
09-15 10:50:56.640 27740  2255 E Unity   : UnityEngine.ResourceManagement.AsyncOperations.<>c__DisplayClass57_0:<add_CompletedTypeless>b__0(AsyncOperationHandle`1)
09-15 10:50:56.640 27740  2255 E Unity   : System.Action`1:Invoke(T)
09-15 10:50:56.640 27740  2255 E Unity   : DelegateList`1:Invoke(T)
09-15 10:50:56.640 27740  2255 E Unity   : UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:InvokeCompletionEvent()
09-15 10:50:56.640 27740  2255 E Unity   : UnityEngine.ResourceManagement.ResourceManager:ExecuteDeferredCallbacks()
09-15 10:50:56.640 27740  2255 E Unity   : UnityEngine.ResourceManagement.ResourceManager:Update(Single)
09-15 10:50:56.640 27740  2255 E Unity   : System.Action`1:Invoke(T)
09-15 10:50:56.640 27740  2255 E Unity   :
09-15 10:50:56.641 27740  2255 E Unity   : OperationException : 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]].
09-15 10:50:56.641 27740  2255 E Unity   : System.Action`2:Invoke(T1, T2)
09-15 10:50:56.641 27740  2255 E Unity   : UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:set_OperationException(Exception)
09-15 10:50:56.641 27740  2255 E Unity   : UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:Complete(TObject, Boolean, Exception, Boolean)
09-15 10:50:56.641 27740  2255 E Unity   : UnityEngine.AddressableAssets.Initialization.InitializationOperation:Execute()
09-15 10:50:56.641 27740  2255 E Unity   : UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:InvokeExecute()
09-15 10:50:56.641 27740  2255 E Unity   : System.Action`1:Invoke(T)
09-15 10:50:56.641 27740  2255 E Unity   : UnityEngine.ResourceManagement.AsyncOperations.<>c__DisplayClass57_0:<add_CompletedTypeless>b__0(AsyncOperationHandle`1)
09-15 10:50:56.641 27740  2255 E Unity   : System.Action`1:Invoke(T)
09-15 10:50:56.641 27740  2255 E Unity   : DelegateList`1:Invoke(T)
09-15 10:50:56.641 27740  2255 E Unity   : UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:InvokeCompletionEvent()

I've verified that the game runs when it's built into a standard .apk. As far as I am aware, the addressables library should be assigned to the auto-generated streaming assets pack by default. That's from an official Unity representative.

Since Addressables moves all content to StreamingAssets during a player build, by default all your Addressables content will be assigned to the auto-generated streaming assets pack. The sample project primarily demonstrates how to assign content to custom fast-follow or on-demand asset packs. We have also taken the approach of assigning any content meant for install-time delivery to the streaming assets pack.

But that doesn't seem to be the case? Or something else is going wrong? We're a little stumped over here and there's very little documentation. Any help would be appreciated.

UPDATE 1: All Resources.Load() calls are failing to load data too.

\$\endgroup\$

2 Answers 2

0
\$\begingroup\$

This is a bug in Unity for specific Android devices (in this case, Galaxy S21).

https://issuetracker.unity3d.com/issues/android-streamingassetspath-and-datapath-return-the-path-to-apk-instead-of-obb-when-split-application-binary-is-enabled

\$\endgroup\$
0
\$\begingroup\$

Just to drop my issue and solution to it, it might help some other addressables wonderer :)

I also had an issue with loading settings.json from the first Exception in the log posted in the question. The reason for it was that we are exporting android project and then performing build from Android Studio (apk + obb) and then deploying manually on the phone. I believe that settings.json ends up in the the .obb (since it gets copied in StreamingAssets during Player build) and that is why it had trouble loading it. In order to make the work, the following steps should be respected:

  1. Connect the phone to PC
  2. Copy .apk
  3. Install .apk and launch the game (not sure if launching is mandatory)
  4. During install the folder will be created in [your phone]\Internal shared storage\Android\obb\[bundle id]. This folder is recreated each time you install the apk so you'll need to copy it each time you reinstall apk
  5. Find your .obb created by Android Studio and rename it to main.[build version].[bundle id].obb
  6. Copy it to the folder from step 4.
  7. Launch the game and it should work
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .