当前位置: 代码迷 >> Android >> proguard之后打开文件异常
  详细解决方案

proguard之后打开文件异常

热度:97   发布时间:2016-04-28 07:09:28.0
proguard之后打开文件错误
AssetManager localAssetManager = null;
localAssetManager= getApplicationContext().getAssets();
localAssetFileDescriptor = localAssetManager.openFd("res/map3_style.txt.png");

以上这段代码在正常打包的情况下可以正常运行,但是通过proguard打包的情况下,运行的时候会报一个java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed


我反编译了一下,res目录里存在res/map3_style.txt.png这个文件,不知道为什么会报异常

------解决方案--------------------
这个文件是不是过大了,改成.mp3的后缀试试
  相关解决方案