Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[SOLVED]Android crash reporting not working, other platforms OK

Discussion in 'Unity Cloud Diagnostics' started by Kurt-Dekker, Apr 7, 2017.

  1. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    I've got my "crashtest" app reporting crashes in the editor and on iOS (IL2CPP). This is verified to work perfectly.

    I am using a basic null reference access as my test crash code.

    However, I built to Android and I am not getting crash reports at all.

    I'm running Unity 5.5.1f1 and the services window reports that Android is supported.

    I confirmed the Android device has internet access, and I even visited the unity3d.com website (and a few others) from the phone in order to verify internet connectivity.

    I also used 'adb logcat' and verified that the crash happens:

    D/dalvikvm(14225): GC_CONCURRENT freed 414K, 5% free 9275K/9728K, paused 5ms+4ms, total 54ms
    I/Unity (14225): DoCrash1();
    I/Unity (14225):
    I/Unity (14225): (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    I/Unity (14225):
    I/Unity (14225): NullReferenceException: Object reference not set to an instance of an object
    I/Unity (14225): at crashtest1.DoCrash1 () [0x00000] in <filename unknown>:0
    I/Unity (14225): at UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) [0x00000] in <filename unknown>:0
    I/Unity (14225): at UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0
    I/Unity (14225): at UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0
    I/Unity (14225): at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <filename unknown>:0
    I/Unity (14225): at UnityEngine.UI.Button.Press () [0x00000] in <filename unknown>:0
    I/Unity (14225): at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <filename unknown>:0
    I/Unity (14225): at UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <filename unknown>:0
    I/Unity (14225): at UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, U
    E/Unity (14225): java.lang.SecurityException: Permission denied (missing INTERNET permission?)
    E/Unity (14225):
    E/Unity (14225): (Filename: Line: 386)
    E/Unity (14225):
     
    Last edited: Apr 7, 2017
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    Wait... I just spotted the problem at the bottom of my own report...

    java.lang.SecurityException: Permission denied (missing INTERNET permission?)

    Is that expected? Do I just have to use the WWW class in my project to get access?? Do I need a custom AndroidManifest.xml? (Please say no!)

    Or is that error completely unrelated?
     
  3. thomasn_unity

    thomasn_unity

    Unity Technologies

    Joined:
    Jun 21, 2016
    Posts:
    60
    There's a setting in the Android Player Settings to require internet access. That should give your app the internet permission so the crash reports can be sent.
     
    Kurt-Dekker likes this.
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    BAM... thanks. Didn't see that. But... I just added a WWW access to the program and presto I'm getting crash reports. Makes sense from a permissions approach.

    May I humbly suggest that the enabling of crash reports automagically trip the above setting you mention?

    Awesome... now I'm gonna go write my very first bug!
     
  5. arielsan

    arielsan

    Joined:
    Dec 3, 2013
    Posts:
    47
    Are you aware that all your stacktrace lines are 0? I mean:

    I/Unity (14225): NullReferenceException: Object reference not set to an instance of an object
    I/Unity (14225): at crashtest1.DoCrash1 () [0x00000] in <filename unknown>:0

    @thomasn_unity Is this normal? do you know if that could affect also the crash report? In my case the crashes I see in the crash reporter have all line 0 in the report and it is complicating things when searching for a bug.
     
  6. thomasn_unity

    thomasn_unity

    Unity Technologies

    Joined:
    Jun 21, 2016
    Posts:
    60
    I believe the line number information is unavailable in IL2CPP builds in order to reduce the size of the deployed player. I'm hoping to be able to re-populate the line number information on the server side at some point in the future, but I don't have an ETA on that.