Comments (5)
Thank you @asrakan for filing this issue.
@jamcohen, can you please take a look when we're back from holiday next week?
from play-unity-plugins.
Hi @asrakan,
Thanks again for raising this issue. I've got a couple questions that'll help me diagnose the problem.
Could you describe the behavior you're seeing in more detail?
When you call RetrieveAssetBundleAsync, are you checking the returned request over time to see if it succeeds?
Does the status of that request ever change to "Loaded"?
Are there any debug logs you can share?
Best,
Jake Cohen
from play-unity-plugins.
Actually I am handling the logics, but when there are some certain problems in-game I reset the application so all of the coroutines and my caches are get clean. Due to this, I can't reach the currently active requests I made before which are still loading/loaded, I want to access them.
Here is the my code line;
> ` public IEnumerator DownloadCoroutine(AssetBundleRequest request)
> {
> Debug.LogError("dowload coroutine : " + request.AssetBundleData.BundleName);
> request.TriedCount++;
> if (request.TriedCount >= MaxPLayServiceAssetDeliveryTryCount)
> {
> request.AssetBundleData.BundleStatu = BundleStatus.Failed;
> request?.ErrorCallback(request);
> yield break;
> }
> try
> {
> if (request.PlayAssetBundleRequest == null)
> {
> request.PlayAssetBundleRequest = PlayAssetDelivery.RetrieveAssetBundleAsync(request.AssetBundleData.BundleName);
> }
> }
> catch (Exception ex)
> {
> string errorMessage = "BUNDLE SYSTEM - WILL BE HALTED - Play Service delivery problem. TRY COUNT : " + request.TriedCount + " Error : " + ex.Message + "..Status : " + request.PlayAssetBundleRequest.Status + ". Bundle name : " + request.AssetBundleData.BundleName;
> Debug.LogError(errorMessage);
> Crashlytics.LogException(new Exception(errorMessage));
> GameAnalyticsSDK.GameAnalytics.NewErrorEvent(GameAnalyticsSDK.GAErrorSeverity.Critical, errorMessage);
> request.EmptyMonoBehavior.StartCoroutine(HaltRequest(request));
> yield break;
> }
> yield return new WaitForEndOfFrame();
> if (BundleDownloadErrorControl(request))
> {
> yield break;
> }
> //Waiting for play service to handle reuqest
> while (!request.PlayAssetBundleRequest.IsDone)
> {
> if (BundleDownloadErrorControl(request))
> {
> yield break;
> }
> switch (request.PlayAssetBundleRequest.Status)
> {
> case AssetDeliveryStatus.Pending:
> break;
> case AssetDeliveryStatus.Retrieving:
> request.AssetBundleData.BundleStatu = BundleStatus.Downloading;
> request.DownloadProgress = request.PlayAssetBundleRequest.DownloadProgress;
> AssetBundleDownloadPanel.UpdateDataStatic(request.DownloadProgress, request.AssetBundleData.Size, request.AssetBundleData.BundleName, Color.green);
> break;
> default:
> break;
> }
> request.DownloadProgress = request.PlayAssetBundleRequest.DownloadProgress;
> yield return new WaitForEndOfFrame();
> }
> if (BundleDownloadErrorControl(request))
> {
> yield break;
> }
> else
> {
> //Writing like this to simplfy
> if (request.RequestType < BundleRequestTypes.Load)
> {
> request.PlayAssetBundleRequest.AssetBundle.Unload(true);
> request.AssetBundleData.BundleStatu = BundleStatus.Downloaded;
> request.ResultCallback(request);
> }
> else
> {
> request.AssetBundleData.Bundle = request.PlayAssetBundleRequest.AssetBundle;
> request.AssetBundleData.BundleStatu = BundleStatus.Loaded;
> request.ResultCallback(request);
> }
> }
>
> }`
from play-unity-plugins.
Ah, I see. So the issue is that you lose the reference to the PlayAssetBundleRequest and then when you call RetrieveAssetBundleAsync you get an exception because thats asset pack request is still in progress.
I'll explore having that method return the active request instead of throwing that exception.
In the meantime could you maintain a dictionary of request keyed by asset pack names? Then, in the catch block for that exception you could reference the last active request stored in the dictionary. Would that work?
from play-unity-plugins.
Hello, I am basically maintaining the problem for now, but it would be better to have returning active request
from play-unity-plugins.
Related Issues (20)
- BuildBundle fails to copy symbols zip (Unity 2022.3 LTS) HOT 2
- [Play Asset Delivery] 1 Assetpack - Multiple AssetBundles HOT 3
- Issue in InAppUpdate plugin unable to detect User Interaction in App update Popup
- Android apk release play consoleGoogle Unity installation
- Screenshot (Sep 28, 2023 7:35:21 AM)
- Downloads gets stuck from Google play side
- JNI Global Reference Overflow Bug
- Duplicate class com.google.android.play.core.common.IntentSenderForResultStarte HOT 4
- App update rejected due to error on asset pack download : Error(-13) HOT 2
- BundletoolHelper.BuildApkSet doesn't sign apks
- Google Play In-App Review API - Error posting review "Expected UNIVERSAL BIT STRING, but found UNIVERSAL SEQUENCE"
- AssetModuleException: Session not found HOT 14
- Build Problem on CI by Docker
- Pad Issue After Download HOT 1
- Unity 2022.3.14f1 requires com.google.android,play:asset.delivery version 2.1.0 HOT 3
- Asset Delivery : Bundles can't restart/continue downloading after interrupting it in notification bar HOT 11
- Issue with Google Play Games PC InputSDK Integration in Unity
- Crash MissingForegroundServiceTypeException HOT 1
- Play In-App Update Plugin needs update for Android 14 compatibility HOT 11
- Unity 2021.3.34f1 used last play asset delivery libs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from play-unity-plugins.