unity-technologies / addressables-sample Goto Github PK
View Code? Open in Web Editor NEWDemo project using Addressables package
Demo project using Addressables package
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,
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?
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
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.
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;
}
}
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 !
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(Func
1)
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:
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.
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.
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!
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:
Reproduction steps:
The problem is that it doesn't wait for the asset to load and check right away if the object.IsDone resulting in a failed to load
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
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)
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",
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
need
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
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.AsyncOperationHandle
1[TObject].get_Result () (at <00000000000000000000000000000000>:0) UnityEngine.AddressableAssets.Initialization.InitializationOperation.Execute () (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].InvokeExecute () (at <00000000000000000000000000000000>:0) System.Action
1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1+<>c__DisplayClass58_0[TObject].<add_CompletedTypeless>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle
1[TObject] s) (at <00000000000000000000000000000000>:0) System.Action1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0) DelegateList
1[T].Invoke (T res) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].InvokeCompletionEvent () (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase
1[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.AsyncOperationBase
1[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.Action
1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0) DelegateList1[T].Invoke (T res) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase
1[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.Action
1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1+<>c__DisplayClass58_0[TObject].<add_CompletedTypeless>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle
1[TObject] s) (at <00000000000000000000000000000000>:0) System.Action1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0) DelegateList
1[T].Invoke (T res) (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1[TObject].InvokeCompletionEvent () (at <00000000000000000000000000000000>:0) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase
1[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.AsyncOperationBase
1[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) DelegateList
1:Invoke(T) System.Action1:Invoke(T) DelegateList
1:Invoke(T) System.Action1:Invoke(T) DelegateList
1:Invoke(T) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:Complete(TObject, Boolean, String) AddressablesPlayAssetDelivery.PlayAssetDeliveryInitializeOperation:CompleteOverride(String) UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
At the moment I am getting a status AndroidAssetPackStatus.Unknown when I try using AndroidAssetPacks.DownloadAssetPackAsync to download the pack.
How is this supposed to work?
Forum entry: https://forum.unity.com/threads/error-when-using-addressables-and-aws-mobile-sdk-for-unity.697352/
Reproduce:
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? :)
`[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
I have some lua script packed with Addressabe in remote server. I download the lua assetbundle with DownloadDependenciesAsync, I need a way to load lua script synchronously from the downloaded cache.
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.
Any ideas?
I understand I should use Sync Fast mode.
But I need load from remote path.
When I build my project , it isn't use Sync Fast mode , but it Use Existing Build mode.
So SyncAddressables is not working in this case.
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.
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?
Basic AssetReference - Android Bug.zip
Note that this only happens on the Android platform. Standalone PC is fine.
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!
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.
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 arenot 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 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?
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;
}
}
}
`
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!)
i guess something woring with inherit the UIBehaviour,
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:
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:
I am not able to see any Play asset delivery API referenced , does this not require those API, How to download asset packs on demand kindly let me know.
"Build Addressables content on Player Build" setting does not generate custom asset packs.
<Good example>
There are three asset packs: CustomFastFollow
, CustomOnDemand
, and UnityDataAssetPack
.
<Bad example>
BuildScriptPlayAssetDelivery.DoBuild
is executed.
But, there is only UnityDataAssetPack
.
I want use addressable in hololens,but i can't see anything
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);
Well, I mean that is self explanatory.
The error in question is "The AssetBundle 'bundle name' can't be loaded because another AssetBundle with the same files is already loaded".
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)
Please provide a basic example of implementing some basic level of encryption. Thanks.
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:
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.
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.
Unity 2019.1.1f1
Adressables 0.7.5
To reproduce. try add scene example.
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)
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}
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.