Does anyone know of a Crash reporting solution tha...
# compose-desktop
s
Does anyone know of a Crash reporting solution that supports proguard / mappings.txt for java?
j
Bugsnag
☝️ 2
s
@jw Does bugsnag support proguard mappings for normal java apps? I’ve been looking at their documentation and I haven’t found anything. Only Android.
j
I can double check in the morning. We use it for a bunch of Java things
👍 2
a
@spierce7 It works with Sentry for sure. You use their CLI to upload your mapping, this generates an id which has to be sent with each error event. They recently improved how this id is bundled/retrieved in the app: https://github.com/getsentry/sentry-java/issues/1236 So for each release you’d do: run Proguard -> upload the mappings.txt to Sentry -> bundle a resource file with the id
👍 1
☝️ 2
t
I asked Bugsnag support and they told me that it is only supported for Android.
I need a crash reporting tool soon. Currently looking into Sentry which looks promising.
Sentry seems to be working with R8 for me. However, I did need to add
-keep class io.sentry.** { *; }
rule in order to work around the error
Discarded unknown attribute
.
j
Surely you can use a more targeted rule than that
👌 1
t
Well I checked the source code and it seems they are using gson all over the place. So lots of rules would be needed. But for me replacing
keep
with
keepclassmembers
does the trick too. Actually the rule I mentioned in my previous comment is the rule they use on Android 🤔
j
Well they're also doing it wrong on Android and as an SDK should strive to ship minimal rules. That existing rule says they don't really care.
2
t
Yes I completely agree. It seems that with sentry java 6.0.0-alpha.4 they dropped GSON and do manual parsing, so no rules are needed anymore!
🙂 1
s
@Asapha thanks for the recommendation. Trying to get it working with them
It’s not as straight forward as I like, but I have a working model in my head I think
t
Just create a gradle task to generate a uuid, use compose jvmArgs option to pass it to your app code, and create another gradle task to upload the generated mapping after obfuscation with the uuid generated. That’s how I did it.
s
I was planning on hashing the mappings.txt and using that as a UUID
t
I guess that could work too. If you look at the source code of their Android gradle plugin you can see that they just generate a new uuid every time.
r
hey, roman from sentry here. I think we could unbundle the Sentry Android gradle plugin from AGP, so it would also work for JVM apps. Thomas, would you be up for filing an issue on github describing the way you set it up for your app? (btw, we’ll reduce our proguard rules to the minimum as part of 6.0.0 as well, thanks for the heads up)
🎉 1
a
@spierce7 were you able to use Sentry on an obfuscated jvm app? if yes, how did you upload the mapping files. I can’t seem to find them in the project
s
I remember I found out how. I never got obfuscation working properly though.
There is a way. I think it was through their rest api
a
I check that there is a cli tool to upload the mappings, but my main issue is where are the mapping files. do i need to run proguard on my own? i see in the documentation that there are tasks that execute obfuscation but there are no mapping files in the build folder after wards
I am talking about the ‘w Proguard’ part of this tutorial
s
I believe you can tell proguard where to output the mappings from the command line client. I don't know where they are with the compose tool. I haven't used that. That just came out. You should ask in the main channel
a
so you used proguard manually?
s
not very successfully
a
I opened an issue on Github for the mapping files. I hope they are there and I missed it somehow
s
It seems more likely there is a setting somewhere you aren't configuring
I'd ask in the channel
a
i have asked in the #compose-desktop channel. that’s the one you mean right? https://kotlinlang.slack.com/archives/C01D6HTPATV/p1667715244225299
a
Try to add
-printmapping
in your config file. See https://www.guardsquare.com/manual/configuration/usage
a
@Asapha it worked! I did
-printmapping mapping.txt
and it generated the mapping file in the location of the
.pro
file. Thanks!