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
Proguard support #317
Comments
I have an idea in mind on how we could upload proguard mapping files. Currently Fabric's Crashlytics (which is what we're using for Android) has an Android Studio plugin which seems to automatically upload your mapping file:
An Android Studio plugin could be created that has the same behaviour. The plugin should be relatively easy to make. We would only need to figure out how to trigger some code to run when a signed APK is made and allow for the developer to input some values. But then I'm also wondering what we should do if someone generates 2 signed APKs and only uploads the first one? This might be an issue for the core. I haven't worked with sentry-cli yet, but another option would be to be able to offer a plugin to the user that triggers that a script containing sentry-cli stuff. I feel that Sentry should be as easy as Crashlytics when it comes down to ease-of-use and integration with existing tools. You're also right that nothing difficult needs to be done in order to obtain the mapping file. |
My guess is we extend sentry-cli and then invoke that as part of the build process in android studio. Missing proguard files (with reprocessing enabled) can be dealt with in a delayed fashion if users want that. |
I think an Android Studio plugin is a good long term goal, but I think for now just offering @AndreasBackx I'm not sure what you mean about generating 2 APKs and uploading one. Is generating multiple APKs from an Android project common? Or are you referring to something else? |
@bretthoerner I'm referring to an edge case that should perhaps be considered. I personally haven't really looked into whether mappings change that much between builds and whether this should even be considered. But it was a question worth asking imo. @mitsuhiko sounds reasonable. I would perhaps be up for making the Android Studio plugin. Perhaps not in this repository depending on the opinions about that here. I'd be my first IntelliJ/Android Studio plugin and I guess it would be a relatively easy plugin to get started there. |
@bretthoerner @AndreasBackx There are many cases of multiple APKs and their mappings really change. I can generate multiple APKs from the same project, and its quite common. There are cases for free/pro version, different processor architecture versions or simply slightly different staging/production code. Nice reference of how complex it can be. This system, usually use different versionCodes for architecture and different package names for things like free/pro-staging/production, so I don't think it will be an issue if some version misses, as it is easy to track which one. @AndreasBackx I may be wrong, but I believe using a Gradle Plugin instead of an Android Studio plugin could be easier to get started and can even be better, as it can be used in CI servers and have higher integration with the build system, making it easier to upload the right mappings, it is also easy to make settings like "fail build if uploading failed", "uploading retry count" and so on. It can be just a wrapper around The Android Studio plugin, for me, fits in the same realm as a Fastlane plugin for example, nice for the long term, will be harder to reason about (multiple apks, UI, installation) than Gradle itself, kind of get out of scope and the Bottom line, it all comes down to the Would be nice to hear @mitsuhiko thoughts on this. |
My preference would be to load this all into |
@Hazer I'll check out the reference later tonight when I'm home. Thank you. Regarding the AS/Gradle plugin, a Gradle plugin would definitely be better. The AS plugin could simply use that Gradle plugin even. I think Fabric adds the Gradle plugin during the AS plugin's setup, can't check right now. |
Proguard support was merged (with a Gradle plugin). Both to be released shortly, would love if anyone on this thread gave it a whirl. |
See docs here: https://docs.sentry.io/clients/java/modules/android/ Need to publish the Gradle plugin and do a |
@bretthoerner great to hear this! I'll be moving from Crashlytics to Sentry for Android and then all of our projects will be using Sentry. Are there any gotchas that I perhaps need to look out for? |
No gotchas that I know of. I just pushed |
Hi guys! Landed here looking for solutions for a crash I'm getting during the build process on our continuous integration machine. I'll probably also submit a bug and look into the issue myself, but until I do that, here is the stacktrace
I should say that the plugin works as expected on my machine. Great job, btw! We are using circleCI and the build step it fails at is |
That is interesting. Looks like the resource loader is unavailable (at least that's why As a temporary workaround you can download
|
Thanks for the quick reply and workaround. After looking at the code I think it is also worth mentioning that my local machine is a mac os and circleCI is a linux machine |
For anyone landing here with similar issues, adding |
Found the underlying issue btw: #455 |
Hi, I recently switched from firebase crash to sentry and I'm having some problems when I try to generate a signed apk(note this has proguard enabled). I followed your guide https://docs.sentry.io/clients/java/modules/android/#proguard but I keep getting an invalid token 401 like so
My sentry.properties, just like its suggested in the docs is
I generated my auth token from https://sentry.io/api/ and have the same on sentry.properties file. Can someone please confirm if that is the right auth.token that i should be putting in? |
Yes, that's where you get the auth token from. I would recommend running sentry-cli separately from the shell eg: |
When I run the above command I get this
|
That looks like no auth token is actually sent. Did you point the |
Oops, had the wrong path, this is the result with corrected path
|
Sounds like your token is not valid. Are you sure you did not accidentally make a copy paste error? |
Is there anyway I can log which auth is being sent from sentry-cli? I pretty sure I copy-pasted the proper auth |
@Shashank58 you can see the truncated auth token in the log above. |
Yup, that's the same auth (The 'Bearer' not included though). |
The only suggestipn I have is to recreate the token. Maybe it corrupted somehow but that's a stretch. In any case that would be a server error and I suggest opening a support ticket. |
Hello everyone. |
Hey @huck1eberry, If you use the Sentry Android Gradle Plugin as documented here: https://docs.sentry.io/clients/java/modules/android/ It will generate a All Proguard mappings are kept Sentry-side so multiple versions can be running concurrently in the wild and will be deobfuscated for you. Does that answer the question? |
Sounds great! Thank you for your prompt reply. |
If the UUID is the same the last upload should overwrite and "win." |
Hi, I have problem with proguard mapping implementation. I try to use the plugin for auto updating mapping file. I create sentry.properties under project level root. Not: it is for an android library project
|
@adarzulfu This issue is closed. Please open a new issue. If possible, please provide a repro to make it faster for us to investigate. |
Just taking public notes here. The work will actually span multiple repos.
My understanding is we need (roughly):
I'm not sure what else is necessary yet. Proguard is nice in that the mapping files are generated locally when you do a build, so I don't think we need to do any of the difficult stuff we do for iOS as far as chasing down symbol files on someone else's server...
@mitsuhiko is the real expert on Sentry (re-)processing and mobile so maybe he can chime in here.
The text was updated successfully, but these errors were encountered: