-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switching to guava 20.0 make Proguard fails when shrink and minify #2926
Comments
@eldk Have you tried updating to the latest version of |
(You can find the Maven/Gradle co-ordinates for |
I have tryed with Guava 19.0 and 23.0-android with same result as 20.0 : Proguard complains about unresolved dependencies. Less warning for 23.0-android. |
Thanks for letting me know the results of applying 23.0-android @eldk! This is out of my league now unfortunately, so let's wait for someone from the Guava team to reply. |
Thanks @jbduncan |
We need to publish our Proguard configurations someday (#2117). For this particular problem, you can add:
(We have a fallback for systems on which |
Hello, With : In #2117 the link to that topic https://stackoverflow.com/questions/9120338/proguard-configuration-for-guava-with-obfuscation-and-optimization gives the solution for Guava 20.0 .
Thanks @cpovirk , @breyed, @gengjiawen Eric |
Those rules are vastly overly keep-y. Why are you suppressing warnings and
then also keeping for each?
…On Mon, Aug 28, 2017 at 3:32 PM eldk ***@***.***> wrote:
Hello,
With :
-dontwarn java.lang.ClassValue
Proguard (4.7) still throw errors.
In #2117 <#2117> the link to that
topic
https://stackoverflow.com/questions/9120338/proguard-configuration-for-guava-with-obfuscation-and-optimization
gives the solution for Guava 20.0 .
-dontwarn com.google.common.base.**
-keep class com.google.common.base.** {*;}
-dontwarn com.google.errorprone.annotations.**
-keep class com.google.errorprone.annotations.** {*;}
-dontwarn com.google.j2objc.annotations.**
-keep class com.google.j2objc.annotations.** { *; }
-dontwarn java.lang.ClassValue
-keep class java.lang.ClassValue { *; }
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-keep class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement { *; }
Thanks @cpovirk <https://github.com/cpovirk> , @breyed
<https://github.com/breyed>, @gengjiawen <https://github.com/gengjiawen>
Eric
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2926 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEd066G4sdYg6jNJBXp_KKzdvtGQIks5scxWwgaJpZM4PDKt0>
.
|
Hello, You are right, -keep are not needed. I will spend more time on it. https://www.guardsquare.com/en/proguard/manual/troubleshooting#unresolvedclass With -keep at right, without to left : Thanks, Eric |
I'm a bit confused (maybe because my understanding is not complete): why are all the "keep"s unnecessary? My feeling is that only those can be safely removed (i.e. have fallback) should not be "keep"(-ed), but the only one with fallback is |
Hello,
Switching to Guava 20.0 as suggested in Android Studio make release build failed when it's done with Proguard shrinkRessources or/and minifyEnabled enabled.
Rollback to Guava 18.0 "solves" it.
Warning: com.google.common.util.concurrent.FuturesGetChecked$GetCheckedTypeValidatorHolder$ClassValueValidator$1: can't find superclass or interface java.lang.ClassValue Warning: com.google.common.base.AbstractIterator: can't find referenced class com.google.errorprone.annotations.CanIgnoreReturnValue
(...)
Warning: there were 696 unresolved references to classes or interfaces. You may need to add missing library jars or update their versions. If your code works fine without the missing classes, you can suppress the warnings with '-dontwarn' options.
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first. :app:transformClassesAndResourcesWithProguardForRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details
Android Studio 2.3.3
Gradle 3.3
Proguard 4.7
JRE1.8.0_122
Thanks,
Eric
The text was updated successfully, but these errors were encountered: