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. Dismiss Notice

No error handling on Gradle Builds?

Discussion in 'Android' started by andrew210, Apr 3, 2018.

  1. andrew210

    andrew210

    Joined:
    Apr 23, 2014
    Posts:
    241
    After giving up with the standard internal build system which is an abomination in itself, I've started trying to use gradle. This appears to ignore any try { } catch statements:



    The code doesn't throw any error on any other platform, but here even when it's surrounded by try / catch statements it will stop and break the app at this point. Is there any way to get around this? Is this normal for Gradle?

    Patience was lost with the internal build system because everytime I reimported or update aar files I'd have to hack them all a bunch of times to get them to actually work. Gradle builds but has this error when the app is running. I have tried with .NET 3.5 and .NET 4.6 for this. The above is an example of one place where it crashes the game but it happens at every try / catch statement where an error is trying to be thrown.
     
  2. RD_Dev

    RD_Dev

    Joined:
    Jun 25, 2013
    Posts:
    10
    I will rise this topic. I use unity gradle building but got the same problem:
    try
    {
    GameObject litleKitten = null;
    litleKitten.GetComponent<CharacterMain>().AddHealth(20);
    }
    catch
    {
    ErrorsManager.IncrementError();
    }

    Crashes my app.
     
  3. RD_Dev

    RD_Dev

    Joined:
    Jun 25, 2013
    Posts:
    10
    So. I found the issue.
    In my case problem was in Unity Performance reporting Service..
    Switching off this service solved android device crashing.
    my Unity ver is 2017.2.2.

    But I realy has been dissapointed by this hack. I realy need perfomance reporting and I bought Unity for this.
     
  4. RD_Dev

    RD_Dev

    Joined:
    Jun 25, 2013
    Posts:
    10
    problem was fixed in unity ver 2017.4.4