How can I force Proguard to keep my .xml resource file?

前端 未结 3 1293
广开言路
广开言路 2020-12-03 17:33

I am succesfully using proguard for my Android apps.

However, with one app I am having trouble.

This app uses a java library that has a .xml fi

3条回答
  •  长情又很酷
    2020-12-03 17:50

    First of all, It turned out that using ant and my build.xml script didn't process the .xml resource file at all. You'll need to manually add a copy action to the build.xml for the resource files to be copied to the output dir.

    Still, having solved that, proguard messed up my work. Solution was:

     -keeppackagenames the.package.where.the.file.is.kept
    

    This made sure that the .xml file could be found by calling the Library.class.getResource.

提交回复
热议问题