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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

NotSupportedException get_HasShutdownStarted - "This icall is not supported by il2cpp

Discussion in 'iOS and tvOS' started by tomerpeledNG, Sep 12, 2017.

  1. tomerpeledNG

    tomerpeledNG

    Joined:
    Jul 14, 2017
    Posts:
    81
    Hi,

    I'm getting the following exception from my iOS App:


    NotSupportedException: /Users/builduser/buildslave/unity/build/External/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System/Environment.cpp(166) : Unsupported internal call for IL2CPP:Environment::get_HasShutdownStarted - "This icall is not supported by il2cpp

    This is the C# stackstrace that I have:

    System.Threading.ThreadPoolWorkQueueThreadLocals.Finalize () (at <00000000000000000000000000000000>:0)
    System.UnhandledExceptionEventHandler:Invoke(Object, UnhandledExceptionEventArgs)

    Anything I can do?
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    Unfortunately, there is not much you can do to correct this issue. It is a known bug on our side which we have corrected. The fix for it should in the 2017.1.1p3 patch release.
     
  3. tomerpeledNG

    tomerpeledNG

    Joined:
    Jul 14, 2017
    Posts:
    81
    Ok, Thanks!
     
  4. CptDustmite

    CptDustmite

    Joined:
    Jun 17, 2014
    Posts:
    61
    I am still getting the same error in Unity 2017.2.0f2 on iPad Air 2 build from Xcode.

    NotSupportedException: /Users/builduser/buildslave/unity/build/External/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System/Environment.cpp(166) : Unsupported internal call for IL2CPP:Environment::get_HasShutdownStarted - "This icall is not supported by il2cpp."\
    at System.Threading.ThreadPoolWorkQueueThreadLocals.Finalize () [0x00000] in <00000000000000000000000000000000>:0 \
    UnityEngine.UnhandledExceptionHandler:printException(String, Exception)\
    UnityEngine.UnhandledExceptionHandler:HandleUnhandledException(Object, UnhandledExceptionEventArgs)\
    System.UnhandledExceptionEventHandler:Invoke(Object, UnhandledExceptionEventArgs)\
    \
    (Filename: currently not available on il2cpp Line: -1)\
     
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    I fix did not make the 2017.2 release. It will be in the 2017.2.0p2 patch release, when that is available (it should be soon). You can find the patch releases here: https://unity3d.com/unity/qa/patch-releases
     
    CptDustmite likes this.
  6. tomerpeledNG

    tomerpeledNG

    Joined:
    Jul 14, 2017
    Posts:
    81
    Hi,

    I've updated to version 2017.2.0p2 and the above error is gone.
    However, now I'm getting the following exception and my app crash :(

    /Users/builduser/buildslave/unity/build/External/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System/AppDomain.cpp(189) : Unsupported internal call for IL2CPP:AppDomain::InternalIsFinalizingForUnload - "This icall is not supported by il2cpp"

    Is this a known issue? Can I do something to solve it?
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    Yes, this is a different known issue. A fix is on the way to a patch release soon.
     
  8. tomerpeledNG

    tomerpeledNG

    Joined:
    Jul 14, 2017
    Posts:
    81
    OK, is there something that we can do to workaround this? Or maybe we're doing something wrong? When does the above method get called?

    We waited for the mentioned patch, really bad, and now we're just getting the same behavior but with different exception...
    Now our iOS app crashes all the time, due to this missing implementation...
     
  9. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    You're not doing anything wrong - it is a bug on the Unity side. I think this only occurs with the new scripting runtime and .NET 4.6 though. If possible you can switch to the old scripting runtime and .NET 2.0 - this problem should go away.
     
  10. tomerpeledNG

    tomerpeledNG

    Joined:
    Jul 14, 2017
    Posts:
    81
    Switching back to the old scripting runtime is not an option for us...
     
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    Ok, the fix for this will be landing in a patch release soon then. In meantime, you might be able to work around this by modifying the generated C++ code in the Xcode project. Search the generated code for "*InternalIsFinalizingForUnload_m*". That generated method should call the unimplemented version of the InternalIsFinalizingForUnload method in the runtime. You can return false in the generated code instead of making the call into the runtime.

    This is not a great workaround, but I think it will work.
     
  12. tomerpeledNG

    tomerpeledNG

    Joined:
    Jul 14, 2017
    Posts:
    81
    Ok, I'll try that, thanks.
     
  13. mcarriere

    mcarriere

    Joined:
    Sep 14, 2012
    Posts:
    106
    Can you be more specific about which patch release?
     
  14. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    It should be fixed in 2017.2.1p1 and the first 2017.3 patch release. It probably will not make the 2017.3 full release though.
     
  15. HaakonL

    HaakonL

    Joined:
    Mar 13, 2014
    Posts:
    123
    NotSupportedException: /Users/builduser/buildslave/unity/build/External/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System/Environment.cpp(166) : Unsupported internal call for IL2CPP:Environment::get_HasShutdownStarted - "This icall is not supported by il2cpp

    Getting this in 2017.2.0p3. Did you not say it was fixed in p2?
     
  16. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    Sorry, there was a delay getting our fixes into the patch release. I've just checked the release branch for 2017.2, and the fix is there, so this should be in the next patch release.
     
  17. HaakonL

    HaakonL

    Joined:
    Mar 13, 2014
    Posts:
    123
    Alright, thanks :)
     
  18. aliak

    aliak

    Joined:
    Jan 2, 2017
    Posts:
    12
    Hi. Is there any version/patch of Unity which does not have these bugs today?
     
  19. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    579
    2017.3p1 still the same error. :-(
     
  20. rulk

    rulk

    Joined:
    Aug 1, 2015
    Posts:
    13
    Hi,
    I'm still getting this

    Non-fatal Exception: /Users/builduser/buildslave/unity/build/External/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System/AppDomain.cpp(189)
    Unsupported internal call for IL2CPP:AppDomain::InternalIsFinalizingForUnload - "This icall is not supported by il2cpp."

    /Users/builduser/buildslave/unity/build/External/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System/AppDomain.cpp(189)
    0 (Missing) 0x0 Finalize (System.Threading.ThreadPoolWorkQueueThreadLocals)


    This is serious problem for us can you please provide some details. Is this somehow connecting with exception handling or maybe UdpClient?

    Version is 2017.3.0f3

    Also is exception handling on iOS is going to be stable any time soon?
    System libraries like UdpClient rely on Exceptions, would we get more stable results if we switch to Berkley sockets and native c++ implementation?
     
    Last edited: Feb 1, 2018
  21. IQpierce

    IQpierce

    Joined:
    Jan 24, 2011
    Posts:
    43
    I am seeing this as well. My team is using Unity 5.6.3p4 and would greatly prefer to avoid updating to 2017.2 in the immediate future. This was not happening until we switched to the 4.6 version of .NET. We cannot switch back since our UWP app must support Xbox Live to be shipped on the Xbox, and the XboxServices plugin provided specifically requires building against .NET 4.6.

    Is there any way we can work around this problem? Modifying the IL2CPP build's contents is problematic for our automated build process.

    This may not be the best venue, but I'd also like to ask a broader question. Did anyone at Unity actually test building a UWP IL2CPP app that authenticates to Xbox Live and uses their SSO (both required for Xbox submission) and confirm that the app could build, run, and potentially be accepted by Microsoft? I ask because I am several weeks in to trying to do this and this is not the first blocking problem I've encountered in doing so. It would be great if Unity could test doing that, fix the problems that come up, and basically provide an engine that produces a shippable game for this console platform.

    Here are some other, unrelated changes that might have made this process easier:
    * Provide a way to sign in and request SSO tokens for Xbox Live without having to upgrade to .NET 4.6 at all, since doing so has led to us encountering multiple land mines.
    * Provide a way for Unity to merge the XboxServices.config into the visual studio project, instead of this being a(nother?) manual step that must be done in each build
    * Fix the fact that any attempt to use the class System.Net.ServicePointManager leads to runtime errors ("The 'ExeConfigFilename' argument cannot be null.") - or at least let me know how on earth I could hack around this problem (this was another .NET 4.6 land mine) (I just reported it as a bug, #1008073)
     
  22. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    Unfortunately we're not shipping public 5.6 patch releases any longer. I believe that we can do private builds in some cases, but you'll need to contact Unity support about those builds.
     
  23. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    Yes. We have thousands of tests that test various IL2CPP parts which relate to Windows Runtime interop and a dozen of integration tests that confirm that the player is working with plugins and passes WACK.


    Windows Runtime support is not feasible without .NET 4.6, unfortunately. The only other way to access those APIs is through C++.

    This is actually on our roadmap.

    Thanks for the report. This year we're focusing on making IL2CPP on UWP rock solid (since we want to get rid of .NET scripting backend eventually), so all these reported issues will get addressed in one form or another.
     
  24. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    @IQpierce

    Sorry, I was wrong about 5.6 patch releases, it seems that we are still shipping them, so we can correct this. Can you submit a bug report and let me know the number? I want to make sure that we correct the specific issue you see. Thanks!
     
  25. Manufacture43

    Manufacture43

    Joined:
    Apr 21, 2017
    Posts:
    140
    What is that step exactly? Is it only for UWP titles or ERA too? I can't find anything for xbox apps on how to do that. I tried copying the file everywhere and I still get errors about it being missing.
     
  26. IQpierce

    IQpierce

    Joined:
    Jan 24, 2011
    Posts:
    43
    See the second troubleshooting point here: https://docs.microsoft.com/en-us/wi...th-partner/partner-add-xbox-live-to-unity-uwp

    And though it's for non-Unity games, there are more details on this page, see step 6: https://docs.microsoft.com/en-us/wi...artner/get-started-with-visual-studio-and-uwp
     
  27. Manufacture43

    Manufacture43

    Joined:
    Apr 21, 2017
    Posts:
    140
    Yeah but that's for UWP. I'm building for native xbox with IL2CPP, if I open the UserAssembly_2015.sln, it doesn't compile. So there's no point in changing anything in there. Anyway, just copying the file manually to the build folder seems to work.
     
  28. asadmubashr

    asadmubashr

    Joined:
    Feb 10, 2021
    Posts:
    29
    This icall is not supported by il2cpp

    I am facing this issue on iOS now but works fine on Android and unity editor, using unity version 2019.4.19f1
     
  29. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    Can you provide a specific call stack when the error occurs? This might be a different unsupported method from the ones in this thread.