While I'm trying to obfuscate simple DataLoader.class file in ProGuard I get this error:
Reading program directory [C:\Users\uzytkownik\Documents\NetBeansProjects\ProTest\build\classes\Files\DataLoader.class]
Warning: class [DataLoader.class] unexpectedly contains class [Files.DataLoader]
Warning: there were 1 classes in incorrectly named files.
You should make sure all file names correspond to their class names.
The directory hierarchies must correspond to the package hierarchies.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unexpectedclass)
If you don't mind the mentioned classes not being written out,
you could try your luck using the '-ignorewarnings' option.
Please correct the above warnings first.
Here is the project: http://www49.zippyshare.com/v/14668241/file.html
I will be grateful for your help.
The given class file contains a definition for the given class, but the directory name of the file doesn't correspond to the package name of the class. ProGuard will accept the class definition, but the current implementation will not write out the processed version. Please make sure your input classes are packaged correctly.
Notably, class files that are in the WEB-INF/classes directory in a war should be packaged in a jar and put in the WEB-INF/lib directory. If ProGuard is not keeping the right classes or class members, make sure you are using fully qualified class names.
Warning: class unexpectedly contains class Note: duplicate definition of program class Note: there were 20 duplicate class definitions. (http://proguard. sourceforge. net/manual/troubleshooting. html#duplicateclass) Warning: there were 21 classes in incorrectly named files.
By default, ProGuard obfuscates the code: it assigns new short random names to classes and class members. It removes internal attributes that are only useful for debugging, such as source files names, variable names, and line numbers. Specifies to print the mapping from old names to new names for classes and class members that have been renamed.
Warning: class [META-INF/versions/9/module-info.class] unexpectedly contains class [module-info]
This is the issue I had and I tried few options mentioned below:
The option worked for me is 3.
Not sure why but it solves my problem and I am able to make the jar.
This issue comes when you upgrade something like I upgrade the spring-boot version and the project starts failing.
Please check the maven dependencies as well.
With the options -injars
and -libraryjars
, you should specify the proper base directory (or jar) of your classes, just like a classpath. In this case: classes
, not classes\Files\DataLoader.class
.
See the ProGuard manual > Troubleshooting > Warning: class file ... unexpectedly contains class ...
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