I am attempting to get the addressables system up and running with our next game idea, and I am having a rough go of it and would like some help figuring out what I am doing wrong.
first off, I am unsure if this is more of a unity answers question or a full on forum thread idea so I am just going with this for now.
I have installed the system via Package Manager, v1.1.5. and I understand how to assign addesses, I am trying to get the bundles to allow me to load them from my online server… but this isn’t working as intended… for right now I am trying to hosting this localy first…
I would think this is a pretty standard configuration… I have the addressables manager set to Packed Play mode, I click to build and the “ServerData/Android” folder gets the Remote catalog but no bundles… odd…
running the game throws
Exception encountered in operation UnityEngine.AddressableAssets.Initialization.InitializationOperation, result=‘’, status=‘Succeeded’ - Chain<IList1,IResourceLocator>: ChainOperation of Type: System.Collections.Generic.IList1[UnityEngine.Texture] failed because dependent operation failed
Exception of type ‘UnityEngine.AddressableAssets.InvalidKeyException’ was thrown., Key=Backgrounds
UnityEngine.ResourceManagement.ChainOperation2:OnWrappedCompleted(AsyncOperationHandle1)
DelegateList1:Invoke(AsyncOperationHandle1) (at Library/PackageCache/com.unity.addressables@1.1.5/Runtime/ResourceManager/Util/DelegateList.cs:69)
UnityEngine.ResourceManagement.ResourceManager:Update(Single)
MonoBehaviourCallbackHooks:Update() (at Library/PackageCache/com.unity.addressables@1.1.5/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:19)
The “Backgrounds” is supposed to be the name of the group… my code for this loading looks like this
I thought all of this was pretty standard but the remote aspect of it is throwing me for a loop… can anyone assist me in figuring out what is going on?
Sure, it is quite basic and you need to fiddle with it to understand it together with reading the manual. But as it is now, it is still somewhat simple to set it up if you know the do’s and don’ts
Yeah but it’s no matter of making it work, as I see it right now, I would not trust this package to handle something as critical as the downloadable content of a live game. I think the should put as much love in this package as they did with the 2D/UI features or the nested prefabs, those features got nailed right, or the post processing package, those have been nailed properly… maybe someone from the unity store comes with a better solution, I would not be surprised XD (as it never happened before)
They did have a UI overhaul in mind somewhere but yeah its hard to create a tool that fits so many purposes.
Asset Bundle management is not easy…
I think they do a really great job overall. I tried making my own manager for asset bundle but it is a straight hell. Hence addressables came forth.
I’d actually be surprised if someone would get a better job at it on the asset store as it is usually full of non optimal code. Or fits only a single purpose. Non extendable.
Cuz thats what unity is about too… extendability.
I hope they’re going to use UI elements for a neater UI and give it some care. But until then having patience is key…
The tool is working thats what counts to me. Asset bundle management is difficult and I rather have Unity take that job out of my hands than some third party asset on the store
When I do this I still get the same error… if the RemoteBuildPath is set to ServerData, does the hosting service from that folder (Server Data being something they generated)… Build > Build Player Content doesn’t seem to generate an asset bundle… where is the build bundles function?
I click that function I mention and all I get is a catalog json and hash file. neither seems to have my assets.
ServerData is built outside of the Assets folder, one level higher than Assets.
The Local Host needs to be enabled. Theres an Enable Service button.
The Build > Build Player Content is the building Bundles button. Make sure you’ve selected the right profile in the Addressables window at the left of the window’s toolbar.
Set the remote catalog and create a new profile with the settings. (I leave my default as actual default)
Then select the new profile in the addressables window
Enable the hosting service you created under Hosting.
In the addressables window select Packed Mode (Note: Only works for the platform you’re build on. So if you’re on Windows, target the Windows platform. Bundles from Android or iOS or WebGL won’t load properly in the editor when running in Packed mode.)
Make sure the addressable assets are set to remote build & remote load
And at last build the bundles using Build → Build Playercontent (I reached my image limit x’D)
I hope the screenshots help you.
I ran into some of the initial issues you seem to be. The fix for creating bundles was to make sure “include in build” was selected on the remote group / schema and the asset provider was assetbundlesprovider.
I’m still having load asset bundles (was working, now it’s not because of a dependency issue), but otherwise it seems like it’s building at least.
So this works, somewhat… I made a profile for local online and production online (one points to a local copy of my website, where I want to eventually host the data, and the other is the configuration to actually load from my website)
I am also building this for Android but hear me out on the compatability thing…
If I build the content selecting my local version and then run the player in that profile version it actually loads the content and is playable. I switched to my online profile (I have not moved anything to the online server yet) and the content loads anyways! after clearing the cache and trying to run production profile the project doesn’t find stuff… the difference between these profiles is just that the RemoteLoadPath for one is a local IP address (192.168.1.14:25520/[PathToData]) and the other points to my production website (www.lostseraph.com).
the real kicker here is that if I build in the local profile, then run the project in the production profile, the project seems to assume its to load from the local profile location… ignoring the production load location… WHAT THE HECK??!
I did. I do have permission to download the files from the server. the oddity that is throwing me for a loop is that if I build content with one profile, and then switch profiles, the result is the second profile being ignored and loading as if from the first profile. If I clear cache and build and load with the second program it fails to load.
I ran more test and still that baffels me… I am curious if maybe there is a setting somewhere for using cache instead, and if I can just turn that off. I am at work right now so I can’t get screenshots or explore it more.
but it’s not loading from server instead it’s loading from my local folder “http:/” i don’t understand why it’s not loading from my server btw, someone suggested me that after you build it as a RemoteBuild then you have to upload that Platform folder with catalog file manually to server, i tried that but i am not able to find a way to fetch it from server.
Unless you have a custom build script, this won’t work as a build path. We just build bundles and do normal file move stuff to put files in the build path. Our current build script cannot handle the build path being an http something.
Uploading files is generally not as simple as knowing the path. It requires auth, and often should be wrapped in a lot of error protection. So your “RemoteBuildPath” should be some folder outside Assets, that you use as a staging folder for uploads.
@unity_bill
I’m also attempting to get my Addressables hosted on google cloud CDN, but get a ‘InvalidKeyException’. If I test in Editor, it loads fine in ‘Fast’ and ‘Virtual’ modes. When tested in editor with ‘Packed Play Mode’ or in a build on device I get this error:
Please see the attached screenshots of my configuration to help me understand what I may have done wrong…
InvalidKeyException means we couldn’t find “MyPrefabName” in the catalog, which may mean we’re not able to load the catalog.
It could be related to running Android from the editor. But as long as the editor currently knows it’s in Android build target, that should load the catalog. It may not render right (android shaders often won’t work on windows). So in general, you are probably going to get bad results running android packed mode inside the editor, but i don’t think it would lead to this exception.
My suggestion is you set a breakpoint in InstantiateAsync inside AddressablesImpl.cs. That would help you figure out if it’s finding the key. If it is a catalog loading issue, the place to set a breakpoint is in Start in ContentCatalogProvider.cs.
You might have to import the package into your project to get breakpoints to work right. I believe in 2019.3 there’s a button in package manager for that. Earlier versions require you to copy/paste the package from the package cache into /Packages/com.unity.addressables/
If you simply cannot get it to work, you can file a bug against Unity with a repro project, but since it’s reliant on your actual hosting, I understand that may be tough.
Did you figure out the issue on this? I am running into same issue, using s3
Edit: It seems when I created a new group and moved all my assets into that one it caused all the errors. I reverted back to the default group and updated my settings through that and it worked
Sounds like a few of you are having issue with google specifically. As far as I know, they don’t actually host things at the raw URL. You have to use signed URLs. and you maybe need to ask google for today’s URL as they move things around. We’re working on a signed URL provider to help with that part of things. If it’s the base URL that is changing out from under you, you need to use a runtime evaluated variable in your path {myurl} and then set that before addressables initializes.