You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we combine MoshiX's Kotlin Compiler plugin with realm using transformer api, our production build misses generated JsonAdapters. Adding a custom rule for R8 adds them back. So the best guess is that realm is somehow blocking Moshi from generating custom rules or removing custom rules, tbh no idea.
I tried to investigate the app/build/outpus/mapping/release/configuration.txt and it seems like the MoshiX defined rules are not picked up when you apply the realm-plugin. After dumping the inputs and outputs of app:mergeReleaseGeneratedProguardFiles with and without applying the realm-plugin it shows that the MoshiX generated rules are not added as inputs when applying the plugin.
I can't find the tasks that actually generates that output, so have a hard time tracing the dependencies. Maybe the files are attached to a task that is somehow not triggered when the new transformer pipeline is in effect. (Or maybe we somehow fail to pick up the resource files.) But the convention about putting the proguard configuration in resource/META-INF/ seems off, so wouldn't expect it to be the way to go and would think that the wiring of generated proguard rules to the mergeReleaseGeneratedProguardFiles should be reworked to match the new transformer API in MoshiX.
As a workaround you could maybe just add the generated proguard configuration to android.buildTypes.release.proguardFiles and add the appropriate task dependencies if you can locate the task that generates it.
How frequently does the bug occur?
Always
Description
When we combine MoshiX's Kotlin Compiler plugin with realm using transformer api, our production build misses generated JsonAdapters. Adding a custom rule for R8 adds them back. So the best guess is that realm is somehow blocking Moshi from generating custom rules or removing custom rules, tbh no idea.
Originally reported here: ZacSweers/MoshiX#396
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
The reproduction is attached.
moshigradlecrash-full.zip
Version
10.13.3-transformer-api
What Atlas App Services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
MacOS
Build environment
Android Studio version: AS 2022.1.1
Android Build Tools version: AGP's default.
Gradle version: AGP 7.4
The text was updated successfully, but these errors were encountered: