Android Proguard java.io.IOException: Can't read [proguard.ClassPathEntry

我是研究僧i 提交于 2019-11-29 12:25:55

问题


Hi All When enabing proguard for android, while building the signed jar I get the following dump:

[2011-02-03 11:28:27 - VideoCreator] Proguard returned with error code 1. See console
[2011-02-03 11:28:27 - VideoCreator] java.io.IOException: Can't read [proguard.ClassPathEntry@49b290] (No such file or directory)
[2011-02-03 11:28:27 - VideoCreator]    at proguard.InputReader.readInput(InputReader.java:230)
[2011-02-03 11:28:27 - VideoCreator]    at proguard.InputReader.readInput(InputReader.java:200)
[2011-02-03 11:28:27 - VideoCreator]    at proguard.InputReader.readInput(InputReader.java:178)
[2011-02-03 11:28:27 - VideoCreator]    at proguard.InputReader.execute(InputReader.java:100)
[2011-02-03 11:28:27 - VideoCreator]    at proguard.ProGuard.readInput(ProGuard.java:195)
[2011-02-03 11:28:27 - VideoCreator]    at proguard.ProGuard.execute(ProGuard.java:78)
[2011-02-03 11:28:27 - VideoCreator]    at proguard.ProGuard.main(ProGuard.java:499)

Could not find anything relevant on the net. Any ideas?


回答1:


ProGuard can't find (or read) one of the input jars. If you install ProGuard 4.5.1 instead of 4.4, it will print out the proper file name, so you can find out why it is missing.




回答2:


Download the latest ProGuard and replace the it's existing lib folder in your base sdk tools folder (ex. c:/android-sdk/tools/proguard) with the new one you've downloaded.

Like Eric said, it will then tell you what's missing. More than likely you've used the wrong path in -libraryjars command. Try removing




回答3:


Updating ProGuard did help to track down the problem. In my case it was to do with the JDK configuration on my Mac and the rt.jar and jsse.jar files not being located in the usual place.

I found the solution here.

cd $JAVA_HOME/lib
sudo ln -s ../../Classes/classes.jar rt.jar
sudo ln -s ../../Classes/jsse.jar .



回答4:


Check whether you got spaces in the path name of .jar. I just encountered this same problem, upgraded to ProGuard 4.6 and got more information in the error message but the problem persisted. Then I figured maybe it was because of spaces in my path name, I replaced all space characters in the path name to "-", ProGuard worked again like a charm :)




回答5:


In JDK1.8 two of the JAR files are in a different location to where Proguard expects them to be, symlinking them fixes it:

cd $JAVA_HOME/lib
sudo ln -s ../jre/lib/rt.jar 
sudo ln -s ../jre/lib/jsse.jar


来源:https://stackoverflow.com/questions/4884456/android-proguard-java-io-ioexception-cant-read-proguard-classpathentry

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!