question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Addressables and AsyncOperationHandle

See original GitHub issue

How do I get the AsyncOperationHandle in the current build? I’m doing the following:

TextAsset myAsset = await Addressables.LoadAssetAsync<TextAsset>("myAssetLabel");

This actually skips the step of getting the AsyncOperationHandle, which is needed when you want to call Addressables.Release(asyncOperationHandle); later.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
neuecccommented, Jun 14, 2020
var handle = Addressables.LoadAssetAsync<TextAsset>("myAssetLabel");
var asset = await handle;
0reactions
Merglaschcommented, May 12, 2023

@neuecc , @albertogomezr91 This currently happens to me with Addressables 1.21.12

Both of these approaches

var locations = await Addressables.LoadResourceLocationsAsync(tag);

var handle = Addressables.LoadAssetAsync<TextAsset>(“myAssetLabel”); var asset = await handle;

result in this error: Cannot assign ‘void’ to an implicitly-typed local variable

The confusing thing is I can access the GetAwaiter and ToUnitask extensions on the handle, so I’d argue the UNITASK_ADDRESSABLE_SUPPORT define has to be active. Anything I am missing here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

AsyncOperationHandle | Package Manager UI website
The AsyncOperationHandle struct is returned from several methods in the Addressables API. The main purpose of the AsyncOperationHandle is to allow access to...
Read more >
Struct AsyncOperationHandle | Addressables | 1.16.19
Struct AsyncOperationHandle. Non typed operation handle. This allows for reference counting and checking for valid references.
Read more >
Check if an AsyncOperationHandle has been released?
I have always assumed that async operation handle `handle.IsValid()` will return false if the async operation has been released.
Read more >
The type or namespace name 'AsyncOperationHandle ...
Just got started trying to work with Addressables in unity, but I've been provided with the "namespace not found" exception, even though I...
Read more >
Loader script for caching addressables to load syncronously.
// Each would need to be loaded Async by the default system. Debug.Assert(embeddedRef.Asset == null);. // However its value has already been cached....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found