Error:Execution failed for task #39;:app:packageRelease#39;. gt; Unable to compute hash of /../AndroidStudioProjects/../classes.jar(错误:任务“:app:packageRelease执行失败.gt;无法计算/../AndroidStudioProjects/../classes.jar 的哈希值)
问题描述
我正在尝试在 Android 应用上进行发布"构建,但我不断收到以下错误:
I'm trying to do a 'release' build on an Android app and I keep on getting this error of:
无法计算/../AndroidStudioProjects/../classes.jar 的哈希
Unable to compute hash of /../AndroidStudioProjects/../classes.jar
然后,当我查看classes.jar"的目录时,该文件不存在.我是否必须使用 gradle 任务自己创建此文件?
And then when I look into that directory for 'classes.jar' the file isn't there. Do I have to create this file myself with a gradle task?
这里的 proguard 发生了一些事情,但除了无法计算哈希......"之外,它没有提供太多有用的信息.
There's something going on with proguard here but it's not giving much useful information other than 'Unable to compute hash...."
这是我的 gradle.build 文件:
Here's my gradle.build file:
如果有人可以帮助我调试这个问题,那就太好了.
If someone could help me debug this issue that'd be great.
推荐答案
我发现问题了:
为您的项目打开 proguard-rules.pro
并将其添加到底部:
Open up the proguard-rules.pro
for your project and add this to the bottom:
基本上我是如何解决这个问题的,我试图在发布"模式下运行我的应用程序,但遇到了一堆类似于这个人的错误:https://github.com/square/okio/issues/144
Basically how I solved it was this I tried to run my app in 'release' mode and got a bunch of errors similar to this guy here: https://github.com/square/okio/issues/144
我几乎按照他说的做了.
I pretty much followed what he said and fixed it.
希望这可以帮助其他人生成他们的 APK!
Hope this can help others with generating their APK's!
这篇关于错误:任务“:app:packageRelease"执行失败.>无法计算/../AndroidStudioProjects/../classes.jar 的哈希值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!