首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ProGuard -意外包含类

ProGuard -意外包含类
EN

Stack Overflow用户
提问于 2014-06-01 04:38:32
回答 3查看 13.5K关注 0票数 11

当我试图在ProGuard中对简单的DataLoader.class文件进行模糊处理时,我得到了这个错误:

代码语言:javascript
复制
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.

这是一个项目:http://www49.zippyshare.com/v/14668241/file.html

我将非常感谢你的帮助。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2014-06-04 08:32:22

使用选项-injars-libraryjars,您应该指定类的正确基目录(或jar),就像类路径一样。在本例中:classes,而不是classes\Files\DataLoader.class

请参阅ProGuard手册>故障排除> Warning: class file ... unexpectedly contains class ...

票数 5
EN

Stack Overflow用户

发布于 2020-01-27 18:03:22

代码语言:javascript
复制
Warning: class [META-INF/versions/9/module-info.class] unexpectedly contains class [module-info] 

这就是我遇到的问题,我尝试了下面提到的几个选项:

  1. -keep类信息模块-信息

对我有效的选项是3。

不知道为什么,但它解决了我的问题,我能够使罐子。

当你升级了一些东西,比如我升级了spring-boot版本,而项目开始失败时,就会出现这个问题。

请同时检查maven依赖项。

票数 10
EN

Stack Overflow用户

发布于 2021-05-04 19:20:37

如果你在android上工作,添加这个build.gradle

代码语言:javascript
复制
 buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23974367

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档