iOS Crash On AssetBundle Load Fail

Hi,

We have a problem with a lot of crashes on iOS each time we deploy a new assetbundle for our users to download. We pinpointed the problem (using crashlytics) to the WWW class in the Unity native implementation (WWWConnection.m). However we can’t figure out whats the real cause for the issue.

We’re using Unity 5.3.6f1

Hi @Adeon93111 ,
I have been able to reproduce your issue. I will post a workaround, if possible, here for you and will notify you of when it will make it into a patch release.
Cheers,
Chris

Thats great, we sorely need this fix as it affects thousands of our users.

Hi @Adeon93111 ,
Please try the file attached on this thread

Let me know if this fixes your issue. It will be going into a patch release soon.
Cheers,
Chris

Thank you for the fix, we will deploy it in our next version. I’ll update how it went.

1 Like

@christophergoy Follow up on this issue:

After deploying this fix and publishing new content, I can confirm that this issue is resolved and
overall stability of our game has increased. We still see crashes from a different source, but
it has a much lower impact.

Thank you Chris for resolving our issue.

For anyone struggling with how to change the WWWConnection.mm automatically at build time, here
is a small script to help you:

public class ChangeWWWPostBuild
{
private const string NEW_WWW_FILE_PATH = “Editor/WWWConnection.mm”;
private const string OLD_WWW_FILE_PATH = “Classes/Unity/WWWConnection.mm”;

[PostProcessBuild(200)]
public static void OnPostprocessBuild(BuildTarget buildTarget, string buildPath)
{
if (buildTarget != BuildTarget.iOS) return;

var newWwwFilePath = Path.Combine(Application.dataPath, NEW_WWW_FILE_PATH);
var oldWwwFilePath = Path.Combine(buildPath, OLD_WWW_FILE_PATH);
FileUtil.ReplaceFile(newWwwFilePath, oldWwwFilePath);
}
}

Hi @Adeon93111 ,
Glad to hear it. Another, more robust, fix was released in the latest 5.4.3p4 patch. Happy game making!
Cheers,
Chris

Hi @Adeon93111 ,
Was this issue fixed for you in the release?
Cheers,
Chris