willowtreeapps/Hyperion-Android

R8 warnings

jakoss opened this issue · 9 comments

I'm using hyperion in release builds with QA flavor. When building i get this warning from R8 phase:

AGPBI: {"kind":"warning","text":"The rule `-keep class * implements com.willowtreeapps.hyperion.plugin.v1.Plugin {\r\n  *;\r\n}` uses implements but actually matches extends.","sources":[{}],"tool":"R8"}
AGPBI: {"kind":"warning","text":"The rule `-keep class * implements com.willowtreeapps.hyperion.plugin.v1.PluginModule {\r\n  *;\r\n}` uses implements but actually matches extends.","sources":[{}],"tool":"R8"}
AGPBI: {"kind":"warning","text":"The rule `-keep class * implements com.willowtreeapps.hyperion.attr.collectors.TypedAttributeCollector {\r\n  <init>();\r\n}` uses implements but actually matches extends.","sources":[{}],"tool":"R8"}
AGPBI: {"kind":"warning","text":"The rule `-keepclassmembers class * implements javax.net.ssl.SSLSocketFactory {\r\n  private final javax.net.ssl.SSLSocketFactory delegate;\r\n}` uses implements but actually matches extends.","sources":[{}],"tool":"R8"}

@Kritarie @evant @Jawnnypoo

#183 (comment)

↑ I got the same warning.

Android Studio: 3.5.1
Grade : 3.4.1
R8 compiler_version: 1.4.94

@Kritarie @evant @Jawnnypoo

the warning log did not disappear even when the proguard was set ↓.

-keep class * implements com.willowtreeapps.hyperion.plugin.v1.Plugin {
  *;
}
-keep class * implements com.willowtreeapps.hyperion.plugin.v1.PluginModule {
  *;
}
-keep class * implements com.willowtreeapps.hyperion.attr.collectors.TypedAttributeCollector {
  <init>();
}

Gradle plugin >3.4.0 no longer uses ProGuard to perform compile-time code optimization. Instead, it works with R8. It seems like these warnings happen because R8 has more strict rules.

You can ignore these messages

I created this issue specifically because i know that warnings aren't there for fun and getting rid of them is just a good practise. I know i can ignore them, but i don't want to

@NekroMancer

I created this issue specifically because ...

Exactly. This has nothing to do with this library. You created an issue on a library where the problem is with Gradle.

According to this issue report, it was fixed in Gradle 3.5.0-beta05.

Upgrade your Gradle version, I think the latest version is 3.5.2.

I'm using the newest gradle version, but that's not the point. You are talking about ignoring and supression of the warnings. And ok - if warnings cannot be prevented by R8 configuration change (and i'm not sure that they can't) then the library should have suppresion setup.

But you cannot tell me that every single library client should setup R8 warning supression code, it's pointless. If library have R8 setup then it should have supressions too.

As right know - using library is causing warnings. This to me is a bad behavior, and that's what i created issue for.

If warning ignoring/suppresion is "the right thing" here then i would be glad to hear that from library maintainers

@NekroMancer

It's a few lines of -dontwarn in your proguard-rules and you are done.

But if you would like to wait for the library maintainer/owner to confirm this then you are welcome to do so.

I do agree that the library owner can add it to the library, but you can also do it yourself and submit a pull request..

You, i could. And i also can create a low-priority issue that may or may not be taken over. And that's what i did.

Look, i just gave a feedback to a library maintainers that the issue is here. I'm not blocked by this in any way. I'm not rushing them in any way. I just made a feedback.

@NekroMancer
I understand. I was just giving my 2 cents with the hopes of helping someone at least.
Anyways, all the best.