WAI
Status Update
Comments
il...@google.com <il...@google.com> #2
I'm sorry! More info:
Kotlin 1.3.5.0
lifecyle = 2.2.0-rc02
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycle}"
implementation "androidx.lifecycle:lifecycle-extensions:${versions.lifecycle}"
implementation "androidx.lifecycle:lifecycle-common-java8:${versions.lifecycle}"
class VideoModel(val app: Application) : AndroidViewModel(app) {
// do something
}
Kotlin 1.3.5.0
lifecyle = 2.2.0-rc02
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycle}"
implementation "androidx.lifecycle:lifecycle-extensions:${versions.lifecycle}"
implementation "androidx.lifecycle:lifecycle-common-java8:${versions.lifecycle}"
class VideoModel(val app: Application) : AndroidViewModel(app) {
// do something
}
me...@choco.com <me...@choco.com> #3
This is lifecyle-viewmodel-kts build dependency, where lifecycle-viewmodel is added (as API).
This is lifecycle-viewmodel build, and there proguard rule is applied to all build types.
and finally, this is the configuration:
```
-keepclassmembers,allowobfuscation class * extends androidx.lifecycle.AndroidViewModel {
<init>(android.app.Application);
}
```
Because of that rule, at least instance initializer of your class that extends AndroidViewModel would be kept as long as that class itself is used/kept somehow. That's one notable difference between `-keepclassmemebers` v.s. other keep directives such as `-keep` or `-keepclasseswithmembers`.
But those rules are coming from the library, so I assume it's been there for a while (though you're using lifecycle 2.2.0-rc02, is it something you recently upgraded?) Then, the difference we should track is why `VideoModel` was kept at AGP 3.5.2 and is not now at AGP 3.6.0-beta04.
Could you add the following rule to your `proguard-rules.pro` and build your app again with AGP 3.5.2?
```
-whyareyoukeeping class **.VideoModel
```
To make sure rules from lifecycle-viewmodel is included as well, could you also add the following to literally print all configurations?
```
-printconfiguration all-configurations.txt
```
If you think it reveals too much details of your apps, you can send it to jsjeon@google.com privately, instead of posting it here. Thanks.
Description
Description has been deleted.