Problem Statement
Description
When using sentry-dotnet 6.1.0 on Android (with sentry-java 8.29.0), a non-fatal NullPointerException occurs during Sentry initialization when reading the last ANR marker file. Sentry still initializes and ANR monitoring works, but the error appears in logs and can be confusing.
Environment
- Sentry .NET version: 6.1.0
- Sentry Android SDK (sentry-java): 8.29.0
- Target framework: .NET 10 (net10.0-android)
- Platform: Android
Error:
SentryLogger | Error | Android: Error reading last ANR marker --> Java.Lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
Stack trace:
at io.sentry.android.core.cache.AndroidEnvelopeCache.lastReportedAnr(AndroidEnvelopeCache.java:165)
at io.sentry.android.core.AnrV2Integration$AnrProcessor.run(AnrV2Integration.java:...)
Root cause
In sentry-java 8.28.0 and 8.29.0, AndroidEnvelopeCache.lastReportedAnr does not handle a null return from FileUtils.readText(). The fix was added in getsentry/sentry-java#4979.
Request
Please update the Sentry Android bindings in sentry-dotnet to use a sentry-java version that includes this fix.
Solution Brainstorm
No response
Problem Statement
Description
When using sentry-dotnet 6.1.0 on Android (with sentry-java 8.29.0), a non-fatal
NullPointerExceptionoccurs during Sentry initialization when reading the last ANR marker file. Sentry still initializes and ANR monitoring works, but the error appears in logs and can be confusing.Environment
Error:
Stack trace:
Root cause
In sentry-java 8.28.0 and 8.29.0,
AndroidEnvelopeCache.lastReportedAnrdoes not handle a null return fromFileUtils.readText(). The fix was added in getsentry/sentry-java#4979.Request
Please update the Sentry Android bindings in sentry-dotnet to use a sentry-java version that includes this fix.
Solution Brainstorm
No response