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
> Task :app:minifyReleaseWithR8 FAILED
ERROR: <snip>/moshix-sealed-missing-proguard-rules/app/build/intermediates/generated_proguard_file/release/proguard.txt:10:1-27: R8: Expecting '-keep' option after '-if' option.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
> Compilation failed to complete, position: Text range from: 'offset: 365, line: 10, column: 1', to: 'offset: 391, line: 10, column: 27', origin: <snip>/moshix-sealed-missing-proguard-rules/app/build/intermediates/generated_proguard_file/release/proguard.txt
Rules generated under resources/META-INF/proguard:
-if class com.example.app.data.model.Message$Success
-keepnames class com.example.app.data.model.Message$Success
-if class com.example.app.data.model.Message$Success
-keep class com.example.app.data.model.Message_SuccessJsonAdapter {
public <init>(com.squareup.moshi.Moshi);
}
moshi-com.example.app.data.model.Message.pro:
# Conditionally keep this adapter for every possible nested subtype that uses it.
-if class com.example.app.`data`.model.Message.Success
-keep class com.example.app.data.model.MessageJsonAdapter {
public <init>(com.squareup.moshi.Moshi);
}
-if class com.example.app.`data`.model.Message.Unknown
-keep class com.example.app.data.model.MessageJsonAdapter {
public <init>(com.squareup.moshi.Moshi);
}
Rules for the latter were previously missing (see #556), which was fixed in #603. (Thanks!).
However, note:
the escaped `data` in the package of the if clauses, causing the syntax to be malformed.
the invalid reference to the nested classes Success and Unknown: . instead of $.
Comparing the contents of the two files, it seems like the rules for the nested class Success itself are correctly generated , but not the sealed class in which it is nested.
In case it's relevant: the package declaration of the generated JsonAdapters also contains `data`:
packagecom.example.app.`data`.model`
The text was updated successfully, but these errors were encountered:
This is a follow-up on #556.
I've updated the previously shared sample to use
0.27.1
, but now seem to be running into #415:Rules generated under
resources/META-INF/proguard
:moshi-com.example.app.data.model.Message.Success.pro:
moshi-com.example.app.data.model.Message.pro:
Rules for the latter were previously missing (see #556), which was fixed in #603. (Thanks!).
However, note:
`data`
in the package of theif
clauses, causing the syntax to be malformed.Success
andUnknown
:.
instead of$
.Comparing the contents of the two files, it seems like the rules for the nested class
Success
itself are correctly generated , but not the sealed class in which it is nested.In case it's relevant: the package declaration of the generated
JsonAdapter
s also contains`data`
:The text was updated successfully, but these errors were encountered: