Android Proguard java.io.IOException:无法读取 [proguard.ClassPathEntry

发布于 2024-10-15 19:45:51 字数 974 浏览 9 评论 0原文

大家好 当为 android 启用 proguard 时,在构建签名的 jar 时,我得到以下转储:

[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)

无法在网络上找到任何相关内容。有什么想法吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

夜声 2024-10-22 19:45:51

ProGuard 无法找到(或读取)输入 jar 之一。如果你安装 ProGuard 4.5.1 而不是 4.4,它会打印出正确的文件名,这样你就可以找出它丢失的原因。

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.

森林散布 2024-10-22 19:45:51

下载最新的 ProGuard 并将基本 sdk 工具文件夹(例如 c:/android-sdk/tools/proguard)中现有的 lib 文件夹替换为您下载的新文件夹。

就像埃里克说的,它会告诉你缺少了什么。您很可能在 -libraryjars 命令中使用了错误的路径。尝试删除

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

花开半夏魅人心 2024-10-22 19:45:51

更新 ProGuard 确实有助于追踪问题。就我而言,这与我的 Mac 上的 JDK 配置有关,并且 rt.jar 和 jsse.jar 文件没有位于通常的位置。

我在这里找到了解决方案

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

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 .
独夜无伴 2024-10-22 19:45:51

检查.jar的路径名中是否有空格。我刚刚遇到了同样的问题,升级到 ProGuard 4.6 并在错误消息中获得了更多信息,但问题仍然存在。然后我想可能是因为我的路径名中存在空格,我将路径名中的所有空格字符替换为“-”,ProGuard 再次像魅力一样工作:)

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 :)

蔚蓝源自深海 2024-10-22 19:45:51

在 JDK1.8 中,两个 JAR 文件与 Proguard 期望的位置不同,通过符号链接修复它们:

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文