There were 173 classes in incorrectly named files

I want to obfuscate my project. When i try to do this with Proguard it is showing below warnings.
Warning: there were 173 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.**
** (ProGuard Manual: Troubleshooting | Guardsquare)**
One of the class example shown below:
FileName: com\services\cache\constants\AppConstants.Java
ClassInformation:
package com.services.cache.constants;
public class AppConstants {

}
please check and provide the solution for this.

Dear @Raghu_Yanamala ,

Welcome to the ProGuard community!

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,

Ewout

1 Like