Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentry 5.7.2 with timber integration crashes the app when formats a message with args #1985

Closed
sdex opened this issue Apr 12, 2022 · 3 comments · Fixed by #1986
Closed

Sentry 5.7.2 with timber integration crashes the app when formats a message with args #1985

sdex opened this issue Apr 12, 2022 · 3 comments · Fixed by #1986

Comments

@sdex
Copy link

sdex commented Apr 12, 2022

Integration

sentry-android-timber

Build System

Gradle

AGP Version

7.1.3

Proguard

Disabled

Version

5.7.2

Steps to Reproduce

  1. Add the log:
    Timber.d("test %s, %s", 1, 1);
  2. The app crashes.

Version 5.7.1 works fine. It seems like the #1974 PR causes this. The args is passed incorrectly - missing asterisk.

Expected Result

A log message:
test 1 1

Actual Result

Caused by: java.util.MissingFormatArgumentException: Format specifier '%s'
            	at java.util.Formatter.format(Formatter.java:2522)
            	at java.util.Formatter.format(Formatter.java:2458)
            	at java.lang.String.format(String.java:2842)
            	at timber.log.Timber$Tree.formatMessage(Timber.kt:172)
            	at timber.log.Timber$Tree.prepareLog(Timber.kt:161)
            	at timber.log.Timber$Tree.d(Timber.kt:51)
            	at io.sentry.android.timber.SentryTimberTree.d(SentryTimberTree.kt:60)
            	at timber.log.Timber$Forest.d(Timber.kt:292)
            	at timber.log.Timber.d(Unknown Source:2)
            	at the.app.MainActivity.onCreate(MainActivity.java:109)
@bruno-garcia bruno-garcia moved this to Needs Discussion in Mobile & Cross Platform SDK Apr 12, 2022
@sdex sdex changed the title Sentry 5.7.2 with timber integration crahes the app when formats a message with args Sentry 5.7.2 with timber integration crashes the app when formats a message with args Apr 12, 2022
@romtsn
Copy link
Member

romtsn commented Apr 12, 2022

Indeed the asterisk is the problem, sorry, this slipped through the review 🙈 Will roll out a fix for that shortly, thanks for reporting!

@romtsn romtsn added Type: Bug Something isn't working timber and removed Status: Untriaged labels Apr 12, 2022
Repository owner moved this from Needs Discussion to Done in Mobile & Cross Platform SDK Apr 13, 2022
@romtsn
Copy link
Member

romtsn commented Apr 13, 2022

@sdex we just released 5.7.3 with this fix, please give it a try. Thanks!

@sdex
Copy link
Author

sdex commented Apr 13, 2022

@romtsn the new version works fine. Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants