Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

IL2CPP exception in 2017.3.0p2 prevents iOS build

Discussion in 'Editor & General Support' started by mikejohnstn, Jan 16, 2018.

  1. mikejohnstn

    mikejohnstn

    Joined:
    Dec 9, 2016
    Posts:
    10
    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?
     
  2. mikejohnstn

    mikejohnstn

    Joined:
    Dec 9, 2016
    Posts:
    10
    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.
     
  3. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are you using Unity IAP in this project?
     
  4. mikejohnstn

    mikejohnstn

    Joined:
    Dec 9, 2016
    Posts:
    10
    No we're not using any Unity Services.
     
  5. mikejohnstn

    mikejohnstn

    Joined:
    Dec 9, 2016
    Posts:
    10
    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.
     
  6. mikejohnstn

    mikejohnstn

    Joined:
    Dec 9, 2016
    Posts:
    10
    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!
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,762
    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.
     
  8. mikejohnstn

    mikejohnstn

    Joined:
    Dec 9, 2016
    Posts:
    10
    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.
     
  9. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,762
    Thanks, we will investigate this.
     
  10. Ignas83

    Ignas83

    Unity Technologies

    Joined:
    Mar 26, 2013
    Posts:
    28
    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).
     
    mikejohnstn and Peter77 like this.