Hyperion-Android icon indicating copy to clipboard operation
Hyperion-Android copied to clipboard

R8 warnings

Open jakoss opened this issue 6 years ago • 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"}

jakoss avatar Sep 24 '19 07:09 jakoss

@Kritarie @evant @Jawnnypoo

https://github.com/willowtreeapps/Hyperion-Android/issues/183#issue-497500561

↑ I got the same warning.

Android Studio: 3.5.1
Grade : 3.4.1
R8 compiler_version: 1.4.94

LeoAndo avatar Oct 23 '19 01:10 LeoAndo

@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>();
}

LeoAndo avatar Oct 23 '19 06:10 LeoAndo

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

HBiSoft avatar Dec 04 '19 05:12 HBiSoft

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

jakoss avatar Dec 04 '19 06:12 jakoss

@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.

HBiSoft avatar Dec 04 '19 09:12 HBiSoft

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

jakoss avatar Dec 04 '19 09:12 jakoss

@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..

HBiSoft avatar Dec 04 '19 09:12 HBiSoft

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.

jakoss avatar Dec 04 '19 09:12 jakoss

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

HBiSoft avatar Dec 04 '19 09:12 HBiSoft