ProGuard stops with a lot of warnings:
Warning: there were 1221 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 37 instances of library classes depending on program classes. You must avoid such dependencies, since the program classes will be processed, while the library classes will remain unchanged. (http://proguard.sourceforge.net/manual/troubleshooting. html#dependency) 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)
Error: Please correct the above warnings first.
But my jar runs correctly. I am not quite familiar with proguard setting. Any suggestion?
I'm going to quote a very relevant part of your question (namely the answer).
If your code works fine without the missing classes, you can suppress the warnings with '-dontwarn' options
So, run it with -dontwarn
since my jar runs correctly.
Documented (per your question) here there is also the option -libraryjars
which you can use if you have external libraries you want to add.
The best thing to do here is adding the libraries in progyard configuration file. At the top of it, just after the input and output jar paths, put lines like this one, one for each library jar you use:
-libraryjars 'path/to/jar/file.jar'
This tells proguard to load the missing classes from the specified jars.
There are warnings above like
Warning: class A: can't find referenced class B
For which you can either use -keep class com.package.** { *; }
to prevent it from being obfuscated, or if you're sure that this is not a problem, you can use -dontwarn com.package.**
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With