Skip to content

Incorrect line number in Sentry event when running app on release mode. #4040

@rodolfoBee

Description

@rodolfoBee

Integration

sentry-android

Build System

Other

AGP Version

NA

Proguard

Enabled

Version

6.23.0

Steps to Reproduce

  1. Create a simple Android app
  2. Run the following code in debug mode to trigger a ArrayIndexOutOfBoundsException
    Image
  3. Note the line number in Sentry is correct (525)
  4. Run the same code again but now in release mode

Expected Result

The line number in the crash report from release mode is the same is in the debug mode. This is the screenshot from the debug mode:

Image

Actual Result

The line number in the crash report is incorrect (line 3)
Image

Proguard mapping is uploaded to the project and applied to the affected event:
Event:

"uuid": "123e8712-e89b-12d3-a456-426614174910",
"type": "proguard"
Image

The result using retrace also shows line 3 as the affected line:

java -jar retrace.jar mapping.txt stacktrace.txt
java.lang.ArrayIndexOutOfBoundsException: length=3; index=5
    at com.sp.[redacted].views.fragment.ConsentFragment$onclickListener$1.invoke(ConsentFragment.java:3)
    at com.sp.[redacted].views.fragment.ConsentFragment$onclickListener$1.invoke(ConsentFragment.java:1)
    at i.o$a.invoke(o.java:30)
    at com.sp.[redacted].utilities.SPUtilsKt$sam$androidx_lifecycle_Observer$0.onClick(SPUtilsKt.java:5)
    at android.view.View.performClick(View.java:7441)
    at android.view.View.performClickInternal(View.java:7418)
    at android.view.View.access$3700(View.java:835)
    at android.view.View$PerformClick.run(View.java:28676)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7842)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.[redacted].main([redacted].java:1003)

Links to events and project are available in the internal ticket.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions