IL2CPP exception in 2017.3.0p2 prevents iOS build

We can no longer build our iOS version due to the following IL2CPP exception:

The same code was working fine in 2017.1. In 2017.3.0p2, it works fine in the editor and we can also build to PC/Mac (Mono) Standalone successfully. It’s only iOS/IL2CPP that causes problems. Strangely, we don’t have any XRSettings enabled, so I’m not sure why VRModule.dll would be causing a problem.

I’m not sure if this helps, but if we disable Strip Engine Code, we get a similar error in a different module:

We tried all the obvious things (resetting cache, reimporting all assets, new project) but without success. Any other suggestions?

Does anyone have suggestions for how we might narrow down the cause of this exception? It’s a large project, so it’s impractical to keep removing scripts until it compiles.

Are you using Unity IAP in this project?

No we’re not using any Unity Services.

If we remove most of our scripts, the project compiles successfully. As I mentioned, it’s impractical to remove scripts in chunks unfortunately, so we can’t pinpoint the exact file, but it seems like a good clue. We know it’s either in our code or (more likely?) something our code is referencing, and not in the project config itself.

After some painstaking picking apart of our project, we narrowed it down to a few 3rd-party libraries that were causing this problem, plus one more IL2CPP exception (this time with System.Byte).

We used the new assembly definition feature to isolate the offending code to non-iOS, and now our iOS build is working again.

A more helpful error message from IL2CPP would’ve helped a lot!

We would love to improve the IL2CPP error message, so that you can get to the root cause of the issue faster. Can you submit a bug report with the project that causes this issue. We’ll see how we can improve the message.

I pieced together a sample project in 2017.3.0p3 and submitted a bug report: Case 991045

Weirdly, the resulting IL2CPP exception in the sample is related to String. We only see problems with XRSettings and Byte in our production project. All very mysterious, but hopefully you can track down what’s happening and improve the error message.

Thanks, we will investigate this.

Just a quick update. Error messages should be better now. Underlying problem was in the rt-voice plugin. It’s not that this plugin was broken but we removed WWWAudioExtensions class and that caused some problems. It’s now fixed (not sure which exact patch release will contain the fix yet).

2 Likes