使用ProGuard客栈Android的工作室后classes.jar未找到 [英] classes.jar not found after using ProGuard inn Android studio

查看:1317
本文介绍了使用ProGuard客栈Android的工作室后classes.jar未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经启用minifyEnabled在build.grade如此。

i have enabled minifyEnabled true in build.grade .

[...]
            Information:Gradle tasks [:app:assembleRelease]
            Warning:com.caverock.androidsvg.SVGImageView: can't find referenced class com.caverock.androidsvg.R$styleable
            Warning:com.caverock.androidsvg.SVGImageView: can't find referenced class com.caverock.androidsvg.R
            Warning:there were 3 unresolved references to classes or interfaces.
                     You may need to add missing library jars or update their versions.
                     If your code works fine without the missing classes, you can suppress
                     the warnings with '-dontwarn' options.
                   (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
            Exception while processing task 
            java.io.IOException: Please correct the above warnings first.
                at proguard.Initializer.execute(Initializer.java:473)
                at proguard.ProGuard.initialize(ProGuard.java:233)
                at proguard.ProGuard.execute(ProGuard.java:98)
                at proguard.gradle.ProGuardTask.proguard(ProGuardTask.java:1074)
                at com.android.build.gradle.tasks.AndroidProGuardTask.doMinification(AndroidProGuardTask.java:137)
                at com.android.build.gradle.tasks.AndroidProGuardTask$1.run(AndroidProGuardTask.java:113)
                at com.android.builder.tasks.Job.runTask(Job.java:48)
                at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41)
                at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:227)
                at java.lang.Thread.run(Thread.java:745)
            :app:dexRelease
            :app:validateExternalOverrideSigning
            :app:packageRelease FAILED
            Error:Execution failed for task ':app:packageRelease'.
            > Unable to compute hash of /Users/sanjay/Desktop/android_project/RestaurantApp/app/build/intermediates/classes-proguard/release/classes.jar
            Information:BUILD FAILED
[...]

可以在这个任何机构帮助吗?
谢谢你是进步....

Can any body help on this? Thanks is advance....

推荐答案

我有同样的问题,读某处解决方法这个问题,这是为 禁用minifyEnabled ,生成APK签署

I had the same issue and read somewhere a workaround to this issue and it was to disable minifyEnabled, generate signed APK.

buildTypes {
    release {
        minifyEnabled false
        shrinkResources true
        proguardFiles 'proguard-project.txt'
    }

我从来没有更新buildTool 23.0之前面对这个问题。

I never face this issue before updating buildTool to 23.0.

另外,在该新版本,你需要添加到你的 Progaurd.txt文件

Also, with this newer version, you need to add this to your Progaurd.txt file.

-keep public class com.google.android.gms.* { public *; }
-dontwarn com.google.android.gms.**

希望这有助于解决您的问题了。

Hope this helps to resolve your issue too.

这篇关于使用ProGuard客栈Android的工作室后classes.jar未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆