There were 229 classes in incorrectly named files

I want to obfuscated and optimize my project, and when i try to do this with ProGuard it pops out this warning:

Warning: there were 229 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.
         (https://www.guardsquare.com/proguard/manual/troubleshooting#unexpectedclass)
         If you don't mind the mentioned classes not being written out,
         you could try your luck using the '-ignorewarnings' option.

But I don’t know what does You should make sure all file names correspond to their class names. mean.
I have to change files names to (example)
C:\users\1\desktop\project\net\example\app\net.example.app.file1.java
Instead of
C:\users\1\desktop\project\net\example\app\file1.java? because it seems weird to me.

Thank you and sorry for noob question and wrong grammar but i am new to ProGuard and kinda new to Java, and i am not mother language.

1 Like

Hi @XfedeX,

Welcome to the ProGuard community and no need to apologise for that.

This warning indicates one or a combination of the two following issue within your project setup;

  • One or multiple classnames do not match their file name e.g. you have a class named MyClass placed in a file named OtherName.java. Instead the class named MyClass should be placed in a file named MyClass.java.

  • At the top of your java files you will have written something similar to package net.example.app;. The class path net.example.app should represent the directory path in your project where that file/class is located (one directory for each sub-package): net/example/app.

Is it possible you renamed some files without renaming the class names or vice versa? Or maybe you moved certain java files within your project structure without changing the package class path?

Kind regards,
Jonas