Hello there,
So here’s my problem, I have an application on Android that downloads medias from a server. To give a visual to the player I use the UnityWebRequest.downloadProgress. Everything was working fine while I was using Mono but as I wanted to release this app in the Google Play Store I had to switch my Scripting Backend to IL2CPP and that’s when things got tricky.
So I switched to IL2CPP and built an apk to test it on mobile before anything else and nothing moved on my downloading screen.
I logged the downloadprogress of my UnityWebRequest and the returning float was always 0 but all the medias were downloading correctly in the background.
This leads me to think that it’s the Scripting Backend switch that is the cause so I tried to do some researches on the internet but I couldn’t find anything helpful.
Do you guys have ever experienced this or do you have any clue on what’s going on ?
Here’s a part of my code :
private IEnumerator IEDOwnload(S3DownloadingInfo downloadInfo, Action callbackSuccess) {
UnityWebRequest request =
UnityWebRequest.Get(downloadInfo.url);
request.downloadHandler = new FileDownloadHandler(new byte[256 * 1024], downloadInfo.filePath);
request.SendWebRequest();
if (request.isNetworkError) {
Log.Error("S3Client - IEDownload - NetworkError : " + request.error);
downloadInfo.status = DownloadStatus.NetworkError;
} else if (request.error != null) {
Log.Error("S3Client - IEDownload - RequestError : " + request.error);
downloadInfo.status = DownloadStatus.RequestError;
} else {
Log.Info("S3Client - IEDownload : " + request.url + "\n" + request.downloadHandler.text);
downloadInfo.status = DownloadStatus.Downloading;
while (!request.isDone) {
downloadInfo.progress = request.downloadProgress;
yield return null;
}
downloadInfo.status = DownloadStatus.Done;
callbackSuccess.Invoke();
}
}
Thank you for you time,
Cheers