Skip to content

find dex task when shrinking resources#722

Merged
bruno-garcia merged 1 commit intogetsentry:masterfrom
codeniko:shrinkRes
Jun 17, 2019
Merged

find dex task when shrinking resources#722
bruno-garcia merged 1 commit intogetsentry:masterfrom
codeniko:shrinkRes

Conversation

@codeniko
Copy link
Copy Markdown

@codeniko codeniko commented Jun 2, 2019

I have an android project where my release builds also shrink unused resources using shinkResources true. Sentry isn't able to find my dex task since it becomes transformClassesAndDexWithShrinkResForRelease.

@bruno-garcia
Copy link
Copy Markdown
Member

This was added via #684 and later rolled back with #687
According to the reason to rollback:

It turns out that DexGuard doesn't use those tasks for mapping.txt generation: rather, both the mapping and apk packaging are done within the same dexguard task.
The aforementioned approach only worked when there was a cached mapping.txt present.

@bruno-garcia bruno-garcia added Help Wanted Extra attention is needed invalid and removed Help Wanted Extra attention is needed labels Jun 4, 2019
@codeniko
Copy link
Copy Markdown
Author

codeniko commented Jun 5, 2019

@bruno-garcia Nowhere in either of those PRs can you find the task that I'm adding transformClassesAndDexWithShrinkResFor${variant.name.capitalize()}. Note ShrinkRes in mine, not Resources.

This is what I have for my builds to generate and correctly package the sentry asset file into my apk

 def proguardTask = project.tasks.findByName("transformClassesAndResourcesWithR8ForRelease")
 def dexTask = project.tasks.findByName("transformClassesAndDexWithShrinkResForRelease")

I use R8, minification, and resource shrinking

@bruno-garcia
Copy link
Copy Markdown
Member

@codeniko You're right. I had the task names wrong.
Thanks for the fix!
/cc @justacodefan Could you please make sure this doesn't affect your fix for AGP 3.4.0?

@bruno-garcia bruno-garcia self-requested a review June 5, 2019 12:27
@bruno-garcia bruno-garcia requested review from fdrabek and removed request for fdrabek June 12, 2019 16:22
@bruno-garcia bruno-garcia merged commit 0c75fb0 into getsentry:master Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants