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)
Related
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
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.
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.
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.
How do I resolve this note from proguard. What are the implications of a duplicate definition? Do I need to fix this and if so how? I'm also seeing:
[proguard] Note: there were 625 duplicate class definitions.
[proguard] Initializing...
[proguard] Note: the configuration refers to the unknown class 'com.android.vending.licensing.ILicensingService'
I'm also seeing:
[proguard] Reading program jar [/GoogleAdMobAdsSdk-4.3.1.jar]
[proguard] Note: duplicate definition of program class [com.google.ads.Ad] etc.
taking out
injars bin/classes
helped reduce this down to 200 classes. But for each library jar I am including I am seeing the above. Same for Google analytics jar file.
And I am seeing:
[proguard] Note: duplicate definition of program class [com.test.activities.MyActivity]
Where MyActivity only appears in one of my projects ... how do I get rid of this?
The Proguard manual states the following:
Note: duplicate definition of program/library class
Your program jars or library jars contain multiple definitions of the listed classes. ProGuard continues processing as usual, only considering the first definitions. The warning may be an indication of some problem though, so it's advisable to remove the duplicates. A convenient way to do so is by specifying filters on the input jars or library jars. You can switch off these notes by specifying the -dontnote option.
In my experience it's not so much that you have multiple class definitions, but that you need to configure proguard better. In any case it's not a big problem and things will probably work fine as it is.