Proguard failed after support library updated to 26.0.1 - android

I have updated my support lib to 26.0.1, but release build is failed.
logs
Note: there were 3 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 63 unkept descriptor classes in kept class members.
You should consider explicitly keeping the mentioned classes
(using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 29 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 1 class casts of dynamically created class instances.
You might consider explicitly keeping the mentioned classes and/or
their implementations (using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclasscast)
Warning: there were 30 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.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 1 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile the code.
:purplleAndroid:transformClassesAndResourcesWithProguardForRelease FAILED
Not understanding due to which library proguard is failing.
proguard file
app level build.gradle
Error log

It's not support library issue,
I using library called branch.io ,i am added it's dependency end with "+".So it's updated and that has some progaurd rules.

Related

Proguard broke react native android

After enabling proguard in my react native project, I've been getting countless notes and errors from all the packages, com.facebook.react, okhttp3, okio, and every other 3rd party library that I'm using including org.reactnative.camera, com.lwansbrough.RCTCamera, com.horcrux.svg and more. Shouldn't the default proguard rules already take care of some of the default packages?
After countless hours looking for solution that includes the obvious -dontnote and -dontwarn, as well as attempting to -keep all the classes mentioned, each time I manage to get rid of a couple of the warnings there is always more warnings.
Do I really have to manually go through every single reference to use proguard? Sometimes I don't even know which class to keep and ignore when using other libraries. Please help.
Note: there were 4 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 1 references to unknown class members.
You should check your configuration for typos.
Note: there were 835 unkept descriptor classes in kept class members.
You should consider explicitly keeping the mentioned classes
(using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 70 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Warning: there were 1620 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.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 1 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile the code.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
Thread(Tasks limiter_14): destruction

Proguard warnings about duplicate class definitions, but doesn't print out the duplicate classes

I'm trying to change the version of a library in my app, but I think I'm getting some kind of conflicts with another version of some dependency that another library I'm using is trying to use. It warns me about duplicate class definitions, but then goes on only to print out specific examples of the next warning category (in this case unresolved class definitions).
...
:RedactedApp:proguardDebug
Note: there were 644 duplicate class definitions (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Warning: redacted.package.ClassName: can't find superclass or interface other.redacted.package.ClassName2
...
...
Warning: there were 12 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.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 5 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Is there a way to force proguard to actually print out the names of detected duplicate classes? I already have -verbose enabled in my proguard file.
While I couldn't find a way to get proguard to actually print out the duplicate classes, I was able to get a good view of dependencies via a gradle (2.9) command:
gradle -q dependencies :RedactedAppName:dependencies --configuration compile
This gave me a good graphical view of a lot of redundant imports I had.

Cant debug build app on android 4.4.2 but it works on android 6.0.1

The error I get is:(this is a large project)
Note: there were 10 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 239 unkept descriptor classes in kept class members.
You should consider explicitly keeping the mentioned classes
(using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 27 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Warning: there were 2292 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.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 241 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile the code.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForDebug FAILED
FAILURE: Build failed with an exception.
ThereĀ“s a big log output from Gradle and I know I must clean up the proguard-rules.pro eventually but why does it work on android 6.0.1 and not on android 4.4.2. The log end with "Build failed with an exception" and I try to "Run with --stacktrace " but cant see the exception
I solved it.
The reason was in app build gradle I was using play-services 11.4.0 and firebase 11.4.2.
Somehow I missed syncing them to use the same version..

How do I know the problematic classes Proguard is referring to

I get the following message from Proguard and I suspect the reason my app is not working has to do with them. But I am not sure what to do with the message:
Note: there were 2 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 7 classes trying to access enclosing classes using reflection.
You should consider keeping the inner classes attributes
(using '-keepattributes InnerClasses').
(http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
Note: there were 233 unkept descriptor classes in kept class members.
You should consider explicitly keeping the mentioned classes
(using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 13 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 10 accesses to class members by means of introspection.
You should consider explicitly keeping the mentioned class members
(using '-keep' or '-keepclassmembers').
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)
Warning: there were 35 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.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)

Dispatch library on Android

Trying to build an Android app via SBT, I find that I can android:package just fine unless I add "net.databinder.dispatch" %% "dispatch-core" % "0.11.2" in to libraryDependencies. If I add it, then I get the following (extremely long) Proguard error (full text):
Note: org.jboss.netty.util.internal.ByteBufferUtil: can't find dynamically referenced class java.nio.DirectByteBuffer
Note: org.jboss.netty.util.internal.ByteBufferUtil: can't find dynamically referenced class sun.misc.Cleaner
Note: there were 2 unresolved dynamic references to classes or interfaces.
Warning: there were 1828 unresolved references to classes or interfaces.
You should check if you need to specify additional program jars.
You may need to add missing library jars or update their versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 7 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile the code.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
Warning: there were 8 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
preceded by a few thousand lines. android:compile works fine with or without Dispatch added.
Looking at the dispatch-classic docs suggests that Dispatch does not work well with Android, but mentions that the "future move to a different backend" (presumably implemented in the latest versions of dispatch) will rectify this.
I can't find any information about Dispatch and Android other than what's available for dispatch-classic.
Does the issue still exist? Should I just use a different library? Is it possible to modify my proguard-sbt.txt to make sure android:package can run?
It seems that Dispatch now plays nicely with Android. My issue previously was that, unknown to me, my proguard settings were being re-generated by sbt for every compile. Adding in -donwarn ** to my proguardOptions in my .sbt file fixes the above errors (although I should probably track down the more specific packages that need to be -dontwarn'd in the future).
With that being said, it seems that Dispatch's heavy-duty dependencies do pose a problem with the Android development pipeline: running android:package maxes out all 6 of my CPUs and uses > 1 GB of memory. I'm way over the 65k dex limit. I think I'll go in a different direction.

Categories

Resources