Coder Social home page Coder Social logo

addressables-sample's Issues

Sample presents glitches in Android in "Use Existing Build" play mode script mode

Hi,
I'm basically experiencing the issue explained here. The thing is, while I understand that there are shaders that can only be rendered in specific platforms, shouldn't the sample work right away without these visual glitches? The exact same project works just fine when the platform is iOS.

I sadly lost a couple of days trying to figure out why it looked like my project wasn't properly loading some random textures until I tested the sample project only to find out that the same issue happened there.

I'd appreciate any explanation to try to avoid this issue in the future.
Many thanks,

Addressables AssetReference "None" value is not saved in Editor when used in Prefab

  1. There is a public field of Addressables.AssetReference type in MonoBehaviour component.
    This component is attached to a GameObject that is converted into prefab. Then prefab instance is added to the Scene. Changing field value to anything except "None" (empty) works fine. But after the value has been changed to anything it can not be changed back to "None" (empty value).
    Changing value inside of the Prefab to anything except "None" partially solves the problem, but that's not a solution because it forces the prefab to keep reference to some object.
  2. Steps to reproduce:
    2.1. Open project attached.
    2.2. Open the SampleScene and select ObjectWithReference instance on the Scene.
    2.3. In Inspector change value of field "Asset Reference" to "None".
    2.4. Save the Scene.
    2.5. Reload the Scene.
    2.6. Select ObjectWithReference instance on the Scene.
    2.7. Result: the value is not "None" but the reference to the object that was set before.
    Expected result: the value is set to "None".

Not all references are being released

var comp = arg.Result.GetComponent<TComponent>();

AsyncOperationHandle<TComponent> GameObjectReady(AsyncOperationHandle<GameObject> arg)
{
        var comp = arg.Result.GetComponent<TComponent>();
        return Addressables.ResourceManager.CreateCompletedOperation<TComponent>(comp, string.Empty);
}

Using the AssetReferenceComponent i see some references to things i have released still sticking around.
Adding this extra release here seems to allow things to load and the other references i was seeing are going away now.

AsyncOperationHandle<TComponent> GameObjectReady(AsyncOperationHandle<GameObject> arg)
    {
        var comp = arg.Result.GetComponent<TComponent>();
        Addressables.Release(arg);
        return Addressables.ResourceManager.CreateCompletedOperation<TComponent>(comp, string.Empty);
    }

Is this a correct fix?

How to manage AddressableGroups by script

With a great amout of assets, I want to manage assets by script instead of creating groups and drag the assets inside by hand.
Please tell me some examples or how to do it.
Thanks

Play Asset Delivery sample silently fails if bundle names conflict

The Play Asset Delivery example has a number of issues, such as failing silently if a bundle name already exists during build. So if you have the same bundle name in two different paths, when it condenses it all down into the PlayAssetDelivery/Build folder it conflicts and throws an error that you never see because the build process clears the console window afterward. This exception handler is also outside of the loop, so it just fails and skips the rest of the bundles entirely instead of ignoring the conflicting bundle. This causes the PAD build process to abort but the rest of the build to continue, so you end up with a broken build containing only some of your assets and no indication as to why.

See PlayAssetDeliveryBuildProcessor.cs (MoveDataForAppBundleBuild)

So if you are building and yet only some bundles are actually making it into the AAB file even though it seems to succeed, this could be why. This is also across ALL groups so if one group has the problem, any subsequent groups will not build.

SyncBundleProvider never actually releases bundles.

Investigating the possible use of the sync addressables for a PC game production, I noticed that bundles were actually never released from memory. A quick investigation designated the SyncBundleProvider as the culprit.

It does not override the Release method, which tries to cast our SyncAssetBundleResource into a AssetBundleResource.

Adding the two documented methods -Unload and Release- in the code sample below seemingly fixes the issue!

public class SyncBundleProvider : AssetBundleProvider
{

    class SyncAssetBundleResource : IAssetBundleResource
    {
        AssetBundle m_AssetBundle;

        public AssetBundle GetAssetBundle()
        {
            return m_AssetBundle;
        }

        internal void Start(ProvideHandle provideHandle)
        {
            m_AssetBundle = AssetBundle.LoadFromFile(provideHandle.Location.InternalId);
            if(m_AssetBundle == null)
                Debug.LogError("the bundle failed " + provideHandle.Location.InternalId);
            provideHandle.Complete(this, m_AssetBundle != null, null);
        }

        /// <summary>
        /// Unloads all resources associated with this asset bundle.
        /// </summary>
        public void Unload()
        {
            if (m_AssetBundle != null)
            {
                m_AssetBundle.Unload(true);
                m_AssetBundle = null;
            }
        }
    }
    
    public override void Provide(ProvideHandle providerInterface)
    {
        new SyncAssetBundleResource().Start(providerInterface);
    }

    /// <inheritdoc/>
    public override void Release(IResourceLocation location, object asset)
    {
        if (location == null)
            throw new ArgumentNullException("location");
        if (asset == null)
        {
            Debug.LogWarningFormat("Releasing null asset bundle from location {0}.  This is an indication that the bundle failed to load.", location);
            return;
        }
        var bundle = asset as SyncAssetBundleResource;
        if (bundle != null)
        {
            bundle.Unload();
            return;
        }
        return;
    }
}

Nothing in FilteredRefenrence

Hello, I see nothing special in scene FilteredReference.
Is this repo up to date ?
I guess FilteredReference allows to list addressable assets in the drop down list with some criteria like labels ?
Thanks for your great work addressable sounds to be a great feature !

Play Asset Delivery sample does not properly load from fast-follow Asset Pack

In the build (with Google AAB enabled and Split Binary Enabled) I get this error:

2022/07/21 02:46:24.286 18827 18893 Error Unity Unable to open archive file: jar:file:///data/app/~~gxXApkMk8ruxFu9eaUAgMQ==/com.squadbuilt.af-uz7s-6oSaqWPZBUrYokMNQ==/split_UnityDataAssetPack.apk!/assets/aa/map_assets_all_a7a80834016864ae22e9f95f6478a5c2.bundle

This is what entries in BuildProcessData.json look like

{"BundleBuildPath":"Library/com.unity.addressables/aa/Android/map_assets_all_a7a80834016864ae22e9f95f6478a5c2.bundle","AssetsSubfolderPath":"AFSFastFollow.androidpack\map_assets_all_a7a80834016864ae22e9f95f6478a5c2.bundle"}

This is what the entries in CustomAssetPacksData.json look like

{"Entries":[{"AssetPackName":"AFSFastFollow","DeliveryType":2,"AssetBundles":["map_assets_all_a7a80834016864ae22e9f95f6478a5c2"]}]}

This is what AppBundleTransformFunc returns as location.InternalId

jar:file:///data/app/~~gxXApkMk8ruxFu9eaUAgMQ==/com.squadbuilt.af-uz7s-6oSaqWPZBUrYokMNQ==/split_UnityDataAssetPack.apk!/assets/aa/map_assets_all_a7a80834016864ae22e9f95f6478a5c2.bundle

Stack Trace:
2022/07/21 02:46:24.281 18827 18869 Info Unity AppBundleTransformFunc (jar:file:///data/app/~~gxXApkMk8ruxFu9eaUAgMQ==/com.squadbuilt.af-uz7s-6oSaqWPZBUrYokMNQ==/split_UnityDataAssetPack.apk!/assets/aa/map_assets_all_a7a80834016864ae22e9f95f6478a5c2.bundle)
2022/07/21 02:46:24.281 18827 18869 Info Unity AddressablesPlayAssetDelivery.PlayAssetDeliveryInitializeOperation:AppBundleTransformFunc(IResourceLocation)
2022/07/21 02:46:24.281 18827 18869 Info Unity UnityEngine.ResourceManagement.ResourceProviders.AssetBundleRequestOptions:ComputeSize(IResourceLocation, ResourceManager)
2022/07/21 02:46:24.281 18827 18869 Info Unity UnityEngine.ResourceManagement.ResourceProviders.AssetBundleResource:get_BytesToDownload()
2022/07/21 02:46:24.281 18827 18869 Info Unity UnityEngine.ResourceManagement.ResourceProviders.AssetBundleResource:GetDownloadStatus()
2022/07/21 02:46:24.281 18827 18869 Info Unity UnityEngine.ResourceManagement.AsyncOperations.ProviderOperation1:SetDownloadProgressCallback(Func1)
2022/07/21 02:46:24.281 18827 18869 Info Unity UnityEngine.ResourceManagement.ResourceProviders.AssetBundleResource:Start(ProvideHandle)
2022/07/21 02:46:24.281 18827 18869 Info Unity UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider:Provide(ProvideHandle)
2022/07/21 02:46:24.281 18827 18869 Info Unity UnityEngine.ResourceManagement.AsyncOperations.ProviderOperation`1:Execute()

Now, in the AAB file, the file path is

/AFSFastFollow/assets/map_assets_all_a7a80834016864ae22e9f95f6478a5c2.bundle

I even copied the asset packs directly from my phone after deployment, and AFSFastFollow-master.apk has the same file path. The bundle files exist there.

Why is it trying to load the incorrect file path, and how do I specify the correct one? Is it as simple as changing the Asset group's Load path? I tried doing that and it didn't work but maybe I need to specify something specific?

Current Project:

  • Unity 2021.3.6f1 (also tried 2021.3.4 and 2021.3.1)
  • Addressables 1.19.19

Any ideas on how to get this fast-follow pack to load properly? I think it should be referencing AFSFastFollow.apk, not split_UnityDataAssetPack.apk, as the former is the fast-follow data and the latter is the install-time data. The install-time data works fine.

Here is the AAB file structure
image

How do I get the scene name?

There is a sign near my transfer platform. It indicates the target of this transport platform.
If I load the scene, it's easy to get the name. But I don't want to load the scene.
All scene files are filled in the edit window. I should be able to get the file name, but I didn't find the corresponding API.

Loading/Unloading Addressable Prefabs based on Camera Location

On this forum here, this is mentioned:

In our own prototyping the best model we've come up with is a script that takes all the game objects on a scene, makes them prefabs, then replaces them with a proxy. That proxy can then have a script on it that instantiates the addressable prefab based on the camera's location. We don't yet have a clean and shareable version of this script, but are working on a demo to put in our Samples github.

Is this the repo that code would be in? I can't seem to find it. I'm trying to do something like this in order to help with memory management for a webgl build, so even having the non-clean version of wherever that was left off at would be helpful.

Thanks!

Addressables are not working on WebGL on new Unity versions

Hi,

as said in the title, addressables are not working on WebGL. Tested on 2 examples from this repository: Scene Loading and Sprite Land. They work on their original version (2019.4.9f1) and on 2020.3.33f. When I bump the version to 2022.1.23f1 I'm getting the errors listed below:

Asset Bundle download is complete, but no data have been received

RemoteProviderException : Unable to load asset bundle from : [http://localhost:8000/StreamingAsse...s_all_f4ba373f651003dcc29897ae4302b413.bundle](http://localhost:8000/StreamingAssets/aa/WebGL/defaultlocalgroup_assets_all_f4ba373f651003dcc29897ae4302b413.bundle) UnityWebRequest result : ConnectionError : Received no data in response ResponseCode : 200, Method : GET url : [http://localhost:8000/StreamingAsse...s_all_f4ba373f651003dcc29897ae4302b413.bundle](http://localhost:8000/StreamingAssets/aa/WebGL/defaultlocalgroup_assets_all_f4ba373f651003dcc29897ae4302b413.bundle)

I've checked on versions:

  • 2022.1.23f1
  • 2022.2.0b15
  • 2023.1.0a19

Reproduction steps:

  1. Get example code from this repository
  2. Open Scene Loading or Sprite Land
  3. Bump the unity version to one of the listed above
  4. Fix any errors that occurred because of version change
  5. See the errors
  6. Lower the version to 2020.3.33f
  7. See no errors

Update a previous build fails every time with the example unity addressables demos

Unity: 2019.2.7f2
Addressables: 1.3.3 and 1.3.8

Update a previous build fails every time with the example unity addressables demos

  1. How we can reproduce it using the example you attached

Window->asset management->Addressables->groups

Build->update a previous build
point to: AddressableAssetsData\Windows->addressables_content_state.bin

in recent releases of addressables this always fails

tested with both 1.3.3 and 1.3.8 of addressables

Tested with Bundle naming set to: Append Hash, No Hash, and Only Hash. It fails the same way with all 3 settings

Dump:

FileNotFoundException: Library/BuildCache/b1/b1ecc6112fa791c152b4b447d215d591/3a3c198b9b43f5ecb13fd72358de6006/cff6f55b67135de451348b26e8a5b9a8_assets_done_bolt-enemy.bundle_f4d87e80087fef875556e834572f714d does not exist
System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) (at <599589bf4ce248909b8a14cbe4a2034e>:0)
UnityEditor.Build.Pipeline.Tasks.ArchiveAndCompressBundles.SetOutputInformation (System.String writePath, System.String finalPath, System.String bundleName, UnityEngine.Build.Pipeline.BundleDetails details) (at Library/PackageCache/[email protected]/Editor/Tasks/ArchiveAndCompressBundles.cs:204)
UnityEditor.Build.Pipeline.Tasks.ArchiveAndCompressBundles.Run () (at Library/PackageCache/[email protected]/Editor/Tasks/ArchiveAndCompressBundles.cs:189)
UnityEditor.Build.Pipeline.BuildTasksRunner.Run (System.Collections.Generic.IList`1[T] pipeline, UnityEditor.Build.Pipeline.Interfaces.IBuildContext context) (at Library/PackageCache/[email protected]/Editor/Shared/BuildTasksRunner.cs:50)
UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32) (at C:/buildslave/unity/build/Editor/Mono/GUI/GenericMenu.cs:121)

dependencies in texture variations examlpe

The package contains dependencies from another project.

    "com.unity.addressables": "file:../../../AddressablesDemo_cds/AddressablesDemo/Packages/com.unity.addressables",
    "com.unity.scriptablebuildpipeline": "file:../../../AddressablesDemo_cds/AddressablesDemo/Packages/com.unity.scriptablebuildpipeline",
    "com.unity.scriptablebuildpipeline.experimental": "file:../../../AddressablesDemo_cds/AddressablesDemo/Packages/com.unity.scriptablebuildpipeline.experimental",

Sync addressables dont work in 2019.3.15f, addressables version 1.9.2

Getting the following error in the build:

NullReferenceException: Object reference not set to an instance of an object
  at UnityEngine.ResourceManagement.AsyncOperations.InitalizationObjectsOperation.Execute () [0x00014] in C:\Users\tjheuvel\Downloads\Addressables-Sample-master\Advanced\Sync Addressables\Library\PackageCache\[email protected]\Runtime\Initialization\InitializationObjectsOperation.cs:29 
  at UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].InvokeExecute () [0x00001] in C:\Users\tjheuvel\Downloads\Addressables-Sample-master\Advanced\Sync Addressables\Library\PackageCache\[email protected]\Runtime\ResourceManager\AsyncOperations\AsyncOperationBase.cs:413 
  at UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].Start (UnityEngine.ResourceManagement.ResourceManager rm, UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle dependency, DelegateList`1[T] updateCallbacks) [0x00076] in C:\Users\tjheuvel\Downloads\Addressables-Sample-master\Advanced\Sync Addressables\Library\PackageCache\[email protected]\Runtime\ResourceManager\AsyncOperations\AsyncOperationBase.cs:407 
  at UnityEngine.ResourceManagement.ResourceManager.StartOperation[TObject] (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject] operation, UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle dependency) [0x00001] in C:\Users\tjheuvel\Downloads\Addressables-Sample-master\Advanced\Sync Addressables\Library\PackageCache\[email protected]\Runtime\ResourceManager\ResourceManager.cs:411 
  at UnityEngine.AddressableAssets.Initialization.InitializationOperation.CreateInitializationOperation (UnityEngine.AddressableAssets.AddressablesImpl aa, System.String playerSettingsLocation, System.String providerSuffix) [0x000c5] in C:\Users\tjheuvel\Downloads\Addressables-Sample-master\Advanced\Sync Addressables\Library\PackageCache\[email protected]\Runtime\Initialization\InitializationOperation.cs:59 
  at UnityEngine.AddressableAssets.AddressablesImpl.InitializeAsync (System.String runtimeDataPath, System.String providerSuffix, System.Boolean autoReleaseHandle) [0x00110] in C:\Users\tjheuvel\Downloads\Addressables-Sample-master\Advanced\Sync Addressables\Library\PackageCache\[email protected]\Runtime\AddressablesImpl.cs:394 
  at UnityEngine.AddressableAssets.AddressablesImpl.InitializeAsync () [0x00001] in C:\Users\tjheuvel\Downloads\Addressables-Sample-master\Advanced\Sync Addressables\Library\PackageCache\[email protected]\Runtime\AddressablesImpl.cs:403 
  at UnityEngine.AddressableAssets.Addressables.InitializeAsync () [0x00001] in C:\Users\tjheuvel\Downloads\Addressables-Sample-master\Advanced\Sync Addressables\Library\PackageCache\[email protected]\Runtime\Addressables.cs:270 
  at SyncAddressables.Init () [0x00001] in C:\Users\tjheuvel\Downloads\Addressables-Sample-master\Advanced\Sync Addressables\Assets\SyncAddressables\SyncAddressables.cs:19 
 

Error - JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll

  • need

    • need remove jetbrain dlls (or remove Plugins folder)
    • ~/Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll
  • Errror Msg
    Assembly 'Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll' will not be loaded due to errors: Assembly name 'JetBrains.Rider.Unity.Editor.Plugin.Full.Repacked' does not match file name 'JetBrains.Rider.Unity.Editor.Plugin.Repacked'

  • IDE

    • JetBrains Rider 2022.1.1
    • Unity 2021.3.0f1

Play Asset Delivery Integration Attempting to use an invalid operation handle error.

Hi!

I am using Addressables Package "1.19.17" to create asset bundles on "Unity 2020.3.27f1" and I am getting this error:

Exception: Attempting to use an invalid operation handle

Call Stack:
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle1[TObject].get_InternalOp () (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle1[TObject].get_Result () (at <00000000000000000000000000000000>:0) UnityEngine.AddressableAssets.Initialization.InitializationOperation.Execute () (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].InvokeExecute () (at <00000000000000000000000000000000>:0) System.Action1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1+<>c__DisplayClass58_0[TObject].<add_CompletedTypeless>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle1[TObject] s) (at <00000000000000000000000000000000>:0) System.Action1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0) DelegateList1[T].Invoke (T res) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].InvokeCompletionEvent () (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].Complete (TObject result, System.Boolean success, System.Exception exception, System.Boolean releaseDependenciesOnFailure) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].Complete (TObject result, System.Boolean success, System.String errorMsg, System.Boolean releaseDependenciesOnFailure) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].Complete (TObject result, System.Boolean success, System.String errorMsg) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.InitalizationObjectsOperation.b__8_0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle1[TObject] obj) (at <00000000000000000000000000000000>:0) System.Action1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0) DelegateList1[T].Invoke (T res) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].InvokeCompletionEvent () (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].Complete (TObject result, System.Boolean success, System.Exception exception, System.Boolean releaseDependenciesOnFailure) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.GroupOperation.CompleteIfDependenciesComplete () (at <00000000000000000000000000000000>:0) System.Action1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1+<>c__DisplayClass58_0[TObject].<add_CompletedTypeless>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle1[TObject] s) (at <00000000000000000000000000000000>:0) System.Action1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0) DelegateList1[T].Invoke (T res) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].InvokeCompletionEvent () (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].Complete (TObject result, System.Boolean success, System.Exception exception, System.Boolean releaseDependenciesOnFailure) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].Complete (TObject result, System.Boolean success, System.String errorMsg, System.Boolean releaseDependenciesOnFailure) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].Complete (TObject result, System.Boolean success, System.String errorMsg) (at <00000000000000000000000000000000>:0) AddressablesPlayAssetDelivery.PlayAssetDeliveryInitializeOperation.CompleteOverride (System.String warningMsg) (at <00000000000000000000000000000000>:0) System.Action1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0) System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <00000000000000000000000000000000>:0) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <00000000000000000000000000000000>:0) UnityEngine.AndroidJavaProxy.Invoke (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0) UnityEngine._AndroidJNIHelper.InvokeJavaProxyMethod (UnityEngine.AndroidJavaProxy proxy, System.IntPtr jmethodName, System.IntPtr jargs) (at <00000000000000000000000000000000>:0) DelegateList1:Invoke(T) System.Action1:Invoke(T) DelegateList1:Invoke(T) System.Action1:Invoke(T) DelegateList1:Invoke(T) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:Complete(TObject, Boolean, String) AddressablesPlayAssetDelivery.PlayAssetDeliveryInitializeOperation:CompleteOverride(String) UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)

Error when using Addressables and AWS Mobile SDK for Unity

Forum entry: https://forum.unity.com/threads/error-when-using-addressables-and-aws-mobile-sdk-for-unity.697352/

Reproduce:

  1. Get AWS Mobile SDK from https://docs.aws.amazon.com/de_de/mobile/sdkforunity/developerguide/what-is-unity-plugin.html (Download ZIP file and Unzip this).
  2. Load any unity package from the unzipped ZIP file into Unity 2018.4 or higher, importing everything.
  3. Then install "Addressables" from the Package Manager. This results in an error, see screenshot (Error.jpg).

Info:
I "fixed" it by commenting out line 464 from the "Client.cs" script from the "Scriptable Build Pipeline" package (see Fix.jpg). The "Scriptable Build Pipeline" package is installed automatically when you install the "Addressables" package from the Package Manager.

Could you replace "InvalidDataException()" with something else? :)
Error
Fix

WaitForCompletion() not working?

`[ServerRpc]
private void ServerSpawnPlayer()
{
GameObject playerPrefab = Addressables.LoadAssetAsync("Player").WaitForCompletion();

    GameObject playerInstance = Instantiate(playerPrefab);

    Spawn(playerInstance, Owner);
}`

why is this line red? "Addressables.LoadAssetAsync("Player")"

please do not suggest me the link below because ı wrote same thing on the linked example, everything is the same, nothing changes !. I use 2021.1.6f1 version. Please fix the bug as soon as possible.

https://docs.unity3d.com/Packages/[email protected]/manual/SynchronousAddressables.html#api

Build error (bundle does not exist) when building Play Asset Delivery

I'm receiving an error when building the Play Asset Delivery. My version of Addressables is at 1.18.15. I'm also using the exact Unity version (2020.3.15f2) that the sample uses. When I select Build > New Build > Play Asset Delivery, I receive this error:

Library/com.unity.addressables/aa/Android/Android/mountainartstatic_assets_all.bundle does not exist
UnityEditor.GenericMenu:CatchMenu (object,string[],int)
     
Addressable content build failure (duration : 0:00:00)
UnityEditor.GenericMenu:CatchMenu (object,string[],int)

It seems to occur on the first addressable group with "FastFolowContent". AlI of my groups have the Asset Bundle Provider set to use the “Play Asset Delivery Provider”. I tried a few different methods to fix this, such as setting different Bundle Naming Modes on that group, changing the compression method, shortening the name of the group, etc... This is what the offending group looks like.

image

Any ideas?

Missing Examples HTTP build/load setup.

Hi, I followed
https://docs.unity3d.com/Packages/[email protected]/manual/AddressableAssetsHostingServices.html
to the word. But I'm unable to get this working with a server running on the local machine.
Exception encountered in operation Resource(editorhostedpacks_assets_all_3fc51f1662e9e7ea337ef78d2a947322.bundle): RemoteAssetBundleProvider unable to load from url http://162.17.216.37:62868/editorhostedpacks_assets_all_3fc51f1662e9e7ea337ef78d2a947322.bundle, result='Cannot connect to destination host'.

Please add an example for HTTP setup.

ENABLE_CACHING and how to disable caching is never explained.

Disabling caching is essential for development, but is explained nowhere. The release notes mention ENABLE_CACHING, but without explanation. The documentation hints at disabling caching, but without explanation.

I found over 10 questions on Unity forums etc. of users trying to disable caching or deleting entries from the cache. They were all struggling, and none of those questions where answered.

How do you disable caching?

How to resume download

I use DownloadDependenciesAsync to download assets.
It doesn't work when I reset network, I hold an AsyncOperationHandler and it's TaskStatus is WaittingToRun.
How can I resume download or stop the AsyncOperationHandler.
Thanks a lot!

The BuildProcessorData.json and CustomAssetPacksData.json not generated

I ran Build > New Build > Play Asset Delivery

Looked into the PlayAssetDelivery folder -> Build and those files are not there. Moreover, the files which were there got deleted.
Is that correct? It doesn't seem to match what was in the description for this project.

Moreover, aren't the *.bundle files also be placed under the PlayAssetDelivery -> Build folder? I don't see them placed there too.

Official untested examples?

I got to this repo from the Unity's official Addressables how-to page: https://unity.com/how-to/simplify-your-content-management-addressables, where it says:

Where can I learn more about Addressables?
If you want to use Addressables in your project, check out the Addressable Asset System documentation to learn how to get started. Read our blog post, check out the GitHub Samples, or join the discussions on forums.

Where the "GitHub Samples" link leads to this repo. And now I get to this repo and what do I see? The first paragraph of the readme literally says:

These are intended as jumping off points for your own development. These have not been tested, and are not guaranteed to work in your situation. They are just examples, to make some concepts easier to understand, or easier to replicate in your own project. Use at your own risk.

At the moment of writing this:

  • the last commit to the repo was made 3 months ago, which brought some small fix to one of the examples (a824d02)
  • the previous commit before that was 11 months ago

The issue I have with all this is: what am I even implied to think about all this?! Why Unity does not take care to keep a working, verified, updated and guaranteed set of examples of one of its most important new features?

Am I supposed to use these examples, or does Unity know beforehand that they are suboptimal and do not reflect the way of doing things? Why are we left with these examples then? Why doesn't anyone at Unity make real examples that are tested, guaranteed to work and are not risky to use?

Can Unity please make sure that the examples for using its advertised technologies and features are up-to-date, working and are safe to refer to and use when looking to learn the aforementioned technologies?

Having trouble deleting an InstantiateAsync object

Hi,

I have an AR App where when an Image gets detected, it should Instantiate an AssetReference that image is associated with.

But I have another method where if a new Image is detected, I want to first delete the previously instantiated AssetReference, and then instantiate the AssetReference associated with the new Image.

Here is my code:

`
public class MultiTrackedImageManager : MonoBehaviour
{

public static MultiTrackedImageManager Instance { get { return instance; } }
private static MultiTrackedImageManager instance;

private ARTrackedImageManager m_TrackedImageManager;
private GameObject curobject;
private string PREFABFOLDER = "Prefabs/";

AssetBundle myLoadedAssetBundle;
[SerializeField]
private string imageName;
private GameObject prefabToLoad;

public List<MultiTrackedImage> Images = new List<MultiTrackedImage>();

// Addressables necessities for test
GameObject target;
private Vector3 spawnPosition;
GameObject testObj;

private void Awake()
{
    //if (instance != null) { Destroy(instance); }
    instance = this;
    m_TrackedImageManager = GetComponent<ARTrackedImageManager>();
    curobject = null;
    spawnPosition = Vector3.zero;
}
void OnEnable()
{
    m_TrackedImageManager.trackedImagesChanged += OnTrackedImagesChanged;
}

void OnDisable()
{
    m_TrackedImageManager.trackedImagesChanged -= OnTrackedImagesChanged;
}

void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs eventArgs)
{

    foreach (var trackedImage in eventArgs.updated)
    {
        OnImageUpdated(trackedImage.referenceImage.texture.name, trackedImage.name, trackedImage);
    }

    foreach (var trackedImage in eventArgs.added)
    {
        OnImageAdded(trackedImage.referenceImage.texture.name, trackedImage.name, trackedImage);
    }
}

public void OnImageUpdated(string textureName, string name, ARTrackedImage m_ARTrackedImage)
{
    
    for (int i = 0; i < Images.Count; i++)
    {
        //if we have a match for the object and we have regained tracking and the current object is not the one for the trigger we just found
        if (m_ARTrackedImage.trackingState == TrackingState.Tracking)
        {

            //this checks to make sure we are tracking the right image target
            if(!string.Equals(Images[i].target.name, textureName)) { continue; }

            //this checks to see if our current object is equal to the name of the image target so we don't delete and duplicate
            if (string.Equals(curobject.name, Images[i].target.name)) { continue; }

            //for some reason we are getting updates from non visible targets
            if (curobject != null) { Destroy(curobject);}

            GameObject go = GameObject.Find(name);

            //Instantiate the prefab with the position of go
            var addresableTarget = Addressables.InstantiateAsync(Images[i]._prefabReference, go.transform.position, Quaternion.identity);

            if(target != null) {Addressables.Release(target); Addressables.ReleaseInstance(addresableTarget); }
            target = addresableTarget.Result;

            curobject = target;
            curobject.name = Images[i].target.name;

            TextManager.s.txtContent1 = Images[i].txt1 == "" ? "  " : Images[i].txt1;
            TextManager.s.txtContent2 = Images[i].txt2 == "" ? "  " : Images[i].txt2;
            TextManager.s.ResetText();

            Images[i].go = go;
            target.transform.rotation = go.transform.rotation;
            target.transform.SetParent(go.transform);
            target.transform.localPosition = Vector3.zero;
        }
    }
}

public void OnImageAdded(string textureName, string name, ARTrackedImage m_ARTrackedImage)
{

    //PrefabManager.s.ClearPrefabs();
    for (int i = 0; i < Images.Count; i++)
    {
        if (string.Equals(Images[i].target.name, textureName) && Images[i].go == null)
        {
            //Destroy the existing AR Animation
            if (curobject != null) { Destroy(curobject);}

            GameObject go = GameObject.Find(name);

            //Instantiate the prefab with the position of go
            var addresableTarget = Addressables.InstantiateAsync(Images[i]._prefabReference, 
go.transform.position, Quaternion.identity);

            if (target != null) { Addressables.Release(target); Addressables.ReleaseInstance(addresableTarget); }
            target = addresableTarget.Result;

            curobject = target;
            curobject.name = Images[i].target.name;

            TextManager.s.txtContent1 = Images[i].txt1 == "" ? "  " : Images[i].txt1;
            TextManager.s.txtContent2 = Images[i].txt2 == "" ? "  " : Images[i].txt2;
            TextManager.s.ResetText();

            Images[i].go = go;
            target.transform.rotation = go.transform.rotation;
            target.transform.SetParent(go.transform);
            target.transform.localPosition = Vector3.zero;
        }
    }
}

`

Readability issues

Hello, few ux/readability issues (see screenshot below)

  • the labels popup menu is not properly adjusting its size
  • the selected row highlight is not setup for pro skin

image

error display before enter the game

there is my steps:
Test.cs:

using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.U2D;
using UnityEngine.UI;

public class Test : Image
{
// Start is called before the first frame update
protected override void Start()
{
base.Start();

    Addressables.LoadAssetAsync<SpriteAtlas>("Atlas/hero.spriteatlas").Completed += OnCompleted;
}
void OnCompleted(AsyncOperationHandle<SpriteAtlas> op)
{
    sprite = op.Result.GetSprite("hero_icon_004");

    Addressables.Release(op);
}

}

then,play the game in editor, everything right.
but exit the game ,hide unity window and reopen editor window(just refresh) ,
the "hero_icon_004" show in the scene(not playing!)

image

i guess something woring with inherit the UIBehaviour,

Removing a Specific Child Object in a Content Update Causes an Error.

I posted this on the Unity Forums https://forum.unity.com/threads/unusual-behaviour-removing-a-specific-child-object-in-a-content-update-causes-an-error.1285517/ but I decided to put this as an issue for people to notice here.

The details are in the link above. To summarize the context and the problem:
Context: Using Addressables with remote content delivery via Google Cloud Storage (Bucket created using Firebase) and testing it with Unity-chan package fbx models.
Steps:

  1. Create a prefab with the "unitychan" 3D fbx model as a child object.
  2. Build content, upload content into cloud, build player, and play on Android to see it all work fine.
  3. Update the prefab by changing the child object "unitychan" 3D fbx model into something else. A sphere, cube, or whatever.
  4. Update existing build and upload it to cloud.
  5. Play on Android.

Expected result: prefab is updated with whatever was replaced.
What happens: Addressable scene does not even load and this error appears in the Android logcat:
image

Custom asset packs are not generated

"Build Addressables content on Player Build" setting does not generate custom asset packs.

<Good example>

  1. "Do not Build Addressables content on Player Build"
  2. Build > New Build > Play Asset Delivery
  3. build the apk

There are three asset packs: CustomFastFollow, CustomOnDemand, and UnityDataAssetPack.

<Bad example>

  1. "Build Addressables content on Player Build"
  2. build the apk

BuildScriptPlayAssetDelivery.DoBuild is executed.
But, there is only UnityDataAssetPack.

SyncAddressables sample doesn't work 2019.4.17f1 with Addressibles 1.16.16

The SyncAddress sample code doesn't work when loading multiple prefabs.
Simple Repro: Change the FixedUp code to load 2 cubes and the exception throws with the load percentage at 0.5

Exception: Sync Instantiate has null result Cube
SyncAddressables.Instantiate (System.Object key, UnityEngine.Transform parent, System.Boolean instantiateInWorldSpace) (at Assets/SyncAddressables/SyncAddressables.cs:120)
spawner.FixedUpdate () (at Assets/spawner.cs:35)

Repro:

    if (m_Counter == 10)
      {
        var go = SyncAddressables.Instantiate("Cube");
        go.transform.forward = new Vector3(Random.Range(0, 180), Random.Range(0, 180), Random.Range(0, 180));
        m_instances.Add(go);
        
        go = SyncAddressables.Instantiate("Cube");
        go.transform.forward = new Vector3(Random.Range(0, 180), Random.Range(0, 180), Random.Range(0, 180));
        m_instances.Add(go);

Unity 2019.4.10 Addressables 1.15.1 SyncAddressale Demo

It is seem to be wrong with above unity versions.
Exception: Sync Instantiate failed to finish! Cube SyncAddressables.Instantiate (System.Object key, UnityEngine.Transform parent, System.Boolean instantiateInWorldSpace) (at Assets/SyncAddressables/SyncAddressables.cs:57) spawner.FixedUpdate () (at Assets/spawner.cs:34)

Play Asset Delivery example breaks when using ARCore package

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.

PAD sample does not build

The current PAD sample does not build an aab correctly.

Repro steps;
-Build addressables with the PAD script
-Try to build an .aab

The gradle build will fail with main/src/assets not found exception for both custom packs - fast-follow and on-demand.

Changing the build script to put bundles into *.assetpack/src/main/assets makes it build, and the builds "work" when buildintg them using bundletoot with --local-testing, but the assets aren't pulled correctly when the build is downloaded from google play.

UnloadScene exeption, not unloading

Unity 2019.1.1f1
Adressables 0.7.5

To reproduce. try add scene example.

https://github.com/Unity-Technologies/Addressables-Sample/blob/master/Basic/Scene%20Loading/Assets/AddScenes.cs

Exception encountered in operation UnityEngine.ResourceManagement.ResourceManager+CompletedOperation`1[UnityEngine.ResourceManagement.ResourceProviders.SceneInstance], result='', status='Failed': Addressables.UnloadScene() - Cannot find handle for scene UnityEngine.ResourceManagement.ResourceProviders.SceneInstance
UnityEngine.AddressableAssets.Addressables:UnloadScene(SceneInstance, Boolean)

https://github.com/Unity-Technologies/Addressables-Sample/blob/master/Basic/Scene%20Loading/Assets/AddScenes.cs

Request to PGS failed because all packs are unavailable

Hi,
I follow the sample to integrate play asset Delivery. And upload to play store. I got some error log just like below when I launch game which is download from google play store. Is something wrong?

Unity version 2021.3.12f1
Addressables version : 1.19.19
Play core : 1.7.0

Finsky : [77377] gxs.a(8): Request execution failed with error code: -2 12-08 18:54:21.134 5920 15353 E Finsky : com.google.android.finsky.assetmoduleserviceutils.AssetModuleException: Request to PGS failed because all packs are unavailable. 12-08 18:54:21.134 5920 15353 E Finsky : at hhp.hr(Unknown Source:4) 12-08 18:54:21.134 5920 15353 E Finsky : at fhr.q(Unknown Source:55) 12-08 18:54:21.134 5920 15353 E Finsky : at dhn.run(PG:2) 12-08 18:54:21.134 5920 15353 E Finsky : at android.os.Handler.handleCallback(Handler.java:914) 12-08 18:54:21.134 5920 15353 E Finsky : at android.os.Handler.dispatchMessage(Handler.java:100) 12-08 18:54:21.134 5920 15353 E Finsky : at android.os.Looper.loop(Looper.java:224) 12-08 18:54:21.134 5920 15353 E Finsky : at android.app.ActivityThread.main(ActivityThread.java:7560) 12-08 18:54:21.134 5920 15353 E Finsky : at java.lang.reflect.Method.invoke(Native Method) 12-08 18:54:21.134 5920 15353 E Finsky : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) 12-08 18:54:21.134 5920 15353 E Finsky : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 12-08 18:54:21.137 15265 15333 V FA : Connection attempt already in progress 12-08 18:54:21.137 15265 15333 V FA : Connection attempt already in progress 12-08 18:54:21.137 15265 15341 I PlayCore: UID: [12009] PID: [15265] AssetPackServiceImpl : Leaving the connection open for other ongoing calls. 12-08 18:54:21.137 15265 15333 D FA : Connected to remote service 12-08 18:54:21.137 15265 15341 E PlayCore: UID: [12009] PID: [15265] AssetPackServiceImpl : onError(-2) 12-08 18:54:21.138 15265 15333 V FA : Processing queued up service tasks: 7 12-08 18:54:21.138 15265 15349 I PlayCore: UID: [12009] PID: [15265] AssetPackServiceImpl : getChunkFileDescriptor(CustomFastFollow, CustomFastFollow, 0, session=47) 12-08 18:54:21.139 5920 5939 I Finsky : [77086] hec.h(2): getChunkFileDescriptor for package: com.joypoppuzzle.homeblock, chunkId: AssetModuleChunkId{sessionId=47, moduleName=CustomFastFollow, sliceId=CustomFastFollow, chunkIndex=0}

SpaceShooter DynamicInvoke error while playing

Hi, I am new to Addressables and wanted to try the samples in this repo,
When I tried to open SpaceShooter with unity version 2021.2.5f1 and played the bootstrap scene, after few frames I got the following exception in console:

Exception thrown in DynamicInvoke: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at UnityEngine.ResourceManagement.ResourceProviders.AssetDatabaseProvider.LoadAssetAtPath (System.String assetPath, UnityEngine.ResourceManagement.ResourceProviders.ProvideHandle provideHandle) [0x00013] in C:\GitLab\Addressables-Sample\Basic\SpaceShooter\Library\PackageCache\[email protected]\Runtime\ResourceManager\ResourceProviders\AssetDatabaseProvider.cs:46 
  at UnityEngine.ResourceManagement.ResourceProviders.AssetDatabaseProvider+InternalOp.LoadImmediate () [0x000c6] in C:\GitLab\Addressables-Sample\Basic\SpaceShooter\Library\PackageCache\[email protected]\Runtime\ResourceManager\ResourceProviders\AssetDatabaseProvider.cs:112 
  at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <00c558282d074245ab3496e2d108079b>:0 
   --- End of inner exception stack trace ---
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00083] in <00c558282d074245ab3496e2d108079b>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <00c558282d074245ab3496e2d108079b>:0 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <00c558282d074245ab3496e2d108079b>:0 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <00c558282d074245ab3496e2d108079b>:0 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <00c558282d074245ab3496e2d108079b>:0 
  at UnityEngine.ResourceManagement.Util.DelayedActionManager+DelegateInfo.Invoke () [0x00000] in C:\GitLab\Addressables-Sample\Basic\SpaceShooter\Library\PackageCache\[email protected]\Runtime\ResourceManager\Util\DelayedActionManager.cs:46  5 (target=UnityEngine.ResourceManagement.ResourceProviders.AssetDatabaseProvider+InternalOp) InternalOp.LoadImmediate() @7.347976
UnityEngine.ResourceManagement.Util.DelayedActionManager:LateUpdate () (at Library/PackageCache/[email protected]/Runtime/ResourceManager/Util/DelayedActionManager.cs:159)

any suggestions to why it would happen? when I click unpause it resume and then thrown again :(

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.