Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

2017.2.0p4 + .NET 4.6, crashes on script debugging enabled build.

Discussion in 'Experimental Scripting Previews' started by horeaper, Dec 10, 2017.

  1. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    46
    TLDR: Crashes on game startup (Android build) and shutdown (Windows build) when script debugging is enabled in build settings.

    How I reproduce this bug:
    1. Create a new 3D project named as "TestUnityProject"
    2. Player Settigns: Change the runtime to .net 4.6
    3. Player Settings: Assign a Package Name for standalone and Android build
    4. Save the scene
    5. Build Settings: Enable "Development Build" and "Script Debugging"
    6. Build for Windows and Android

    Result:
    Windows build runs fine, but will crash when shutdown by pressing Alt+F4. (But one time it doesn't crash, just once...)
    Android build crash on startup.

    System Info:
    PC: Windows 8.1 x64 (6.3.9600), i7-4700MQ, DDR3-1600 16G
    Android: XiaoMi MI5 (Qualcomm Snapdragon 820 + 3GB RAM), MIUI 9.1.3.0 (Android 7.0)

    More Info:
    When "Script Debugging" is unchecked, everything is fine, even "Development Build" are still checked.
    It happens on both 2017.2.0f3 and 2017.2.0p4
    Android was build using the latest SDK Tools (26.1.1) and Platform-Tools (27.0.0)
    Didn't try how IL2CPP build behaves since my project requires Mono runtime, and I don't have the appropriate NDK installed.

    Attachments:
    Include the entire project, the build result, full memory dump file (for Windows) and logcat (for Android)
    For the included windows build, I also selected "Copy PDB Files" when building it.

    Download address are included in the attachment file (I don't want bots to rampage that machine), download size are 98.3MB.
    Reply me if the download address are inaccessible, or you need more information.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    Thanks for reporting this. I think that we have corrected this issue, and the fix is on its way to an upcoming patch release.
     
  3. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    46
    Great! Looking forward to that.
     
  4. AETechron

    AETechron

    Joined:
    Aug 9, 2016
    Posts:
    6
    I'm running into this issue as well.

    Upon starting the Android app (with Script Debugging enabled) after a few seconds at a black screen I get a dialog that says "Unfortunately, ProductName has stopped." The app never starts.

    Here are my findings:
    • I've run into the problem on 2017.2.0f3, 2017.2.0p4, 2017.2.1f1, 2017.2.1p1, and 2017.3.0f3.
    -◦ I upgraded from 5.5.4 to 2017.2.0f3 so I'm not sure when the problem truly began. The problem obviously wasn't in 5.5.4 as .NET 4.6 wasn't available yet.
    -◦ I've only tested on Android 4.4.4.
    • Only happens with .NET 4.6.
    • Doesn't happen with IL2CPP.
    • Only happens with Script Debugging checked.
    • Doesn't seem to be related to the Stripping setting. I've seen reports floating around that disabling Assembly Stripping fixes the problem; not for me. I've never enabled it.

    This is the only thing keeping us from adopting .NET 4.6 to be honest. Everything in our app works fine other than debugging.

    If someone wants to debug a .NET 4.6 project on Android the only method I know of is to build with the very slow IL2CPP at this time.
     
    Last edited: Dec 22, 2017
  5. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    We are actively looking into fixing the Android debugging issue. Will be a bit delayed due to holiday break at the moment.
     
  6. AETechron

    AETechron

    Joined:
    Aug 9, 2016
    Posts:
    6
    Thank you much for the response! I refresh this thread every day, so if you release a patch I would be forever grateful if you would let us know in this thread.

    Thanks again.
     
  7. MorCompediaNet

    MorCompediaNet

    Joined:
    Jan 22, 2017
    Posts:
    21
    Just adding that it still doesn't work in 2017.3.
    And 2018..1.0b3 has a different issue where instead of just crashing, the app hangs on a black screen and says "Failed to load Mono"
     
  8. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    Android issues will be fixed in 2017.3.0p4
     
  9. MorCompediaNet

    MorCompediaNet

    Joined:
    Jan 22, 2017
    Posts:
    21
    That's great news!
    Is there any news about the release date for that?
     
  10. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    This release is scheduled to be out by the end of the week.
     
  11. MorCompediaNet

    MorCompediaNet

    Joined:
    Jan 22, 2017
    Posts:
    21
    Great! Thanks a lot!
     
  12. MorCompediaNet

    MorCompediaNet

    Joined:
    Jan 22, 2017
    Posts:
    21
    Just reporting back on this:
    App is indeed not crushing anymore, and the ability to connect the console window to the device is back in order.

    Debugging still isn't working though, once you start debugging via Visual Studio the app will just freeze until you stop the debugging process, at which point it'll go back to running as usual.
     
  13. MorCompediaNet

    MorCompediaNet

    Joined:
    Jan 22, 2017
    Posts:
    21
    Any update on this?
     
  14. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    No, we don't have an update on this. Can you submit a new bug report for this issue?
     
  15. waltran

    waltran

    Joined:
    Feb 23, 2017
    Posts:
    36
    Any update on this? we have never used .net 4.6 in our project yet our android builds are crashing when null ref is raised or dev+script debugging build opened. (2017.2.1p2 and 2017.2.1p4, no problem on 5.6.5p2 shipping is already delayed...)
     
  16. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    @waltran

    The original issue in this thread was directly related to the new scripting runtime and the .NET 4.6 profile. We're not aware that 2017.2 has a problem with Android and script debugging enabled. Can you submit a bug report? We will take a look at the issue.
     
  17. waltran

    waltran

    Joined:
    Feb 23, 2017
    Posts:
    36
    using unity ------- crashes android builds when nullref is raised. give me my 4 days of debugging and ruined hairs back. thanks.
    i changed my message do you own debugging and find your crashes.
     
    Last edited: Feb 28, 2018
  18. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    Were you able to resolve the issue? If so, what change was necessary to do so? We'd like to avoid any need to debug a problem for 4 days!
     
  19. MechEthan

    MechEthan

    Joined:
    Mar 23, 2016
    Posts:
    166
    It sounds like his issue is related to one we found & filed (unrelated to .NET 4.6): https://fogbugz.unity3d.com/default.asp?980176_4qglrsnooci4kfeh

    Edit: here's the issue it got de-duped to: https://issuetracker.unity3d.com/is...null-value-with-performance-reporting-enabled

    Apparently it's fixed in the 2018 beta but not pushed down to existing releases yet, but I'm not certain.
     
  20. waltran

    waltran

    Joined:
    Feb 23, 2017
    Posts:
    36
    open a blank project
    switch platform to android
    write a real piece of code that will give you a null reference exception (not with throw new..)
    activate unity performance reporting
    there you have it.
    yes it was this problem.
    WHY unity doesnt have another list on the MAIN page that says CRASHING BUGS so we can know what to disable at first....
     
    Last edited: Mar 1, 2018
  21. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    Ho god THANK YOU.

    My setup :

    * Unity 2018.1
    * .NET 4.6
    * Incremental compiler

    With the Performance Reporting tool enabled, the app is freezing ... ho the irony
     
    waltran likes this.
  22. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    @JoshPeterson any news on this ? Were you able to reproduce the issue ?
     
  23. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
  24. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    Hi,

    Thanks. I had the issue 10 days ago, when was the backporting done for 2018.1 ?

    Because my issue was exactly the one described : as long as I activating the Performance Reporting service, my app was crashing as soon as it met an exception.

    I did not try again, but somebody was also asking (may 23) if it was backported
     
  25. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,930
    It looks like this will be landing in 2018.1.2f1, which was just released on 25 May. Sorry, I thought the fix had made 2018.1 earlier.
     
  26. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    @JoshPeterson
    I think there has been a regression in 2019.3.0f5.
    Script debugging makes black screen even before the Unity animation.
    No error in the logs
     
  27. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035