Android的工作室 - 1.2.RC Proguard的广场上的奥基奥库参考警告 [英] Android-Studio-1.2.RC Proguard warnings on Square's Okio library reference

查看:1875
本文介绍了Android的工作室 - 1.2.RC Proguard的广场上的奥基奥库参考警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与Android工作室:1.2.RC

WIth Android Studio: 1.2.RC

我启用的ProGuard在.gradle:
```

I enabled proguard in .gradle: ```

minifyEnabled=true


并添加这些规则到我的proguard-rules.pro:

-dontwarn com.squareup.**
-dontwarn okio.**


并补充这些皮棉规则,我.gradle文件:

warningsAsErrors false
abortOnError false
disable 'InvalidPackage'

```

但我仍然得到这些的警告,当我尝试运行在调试模式下的应用程序:

But I still get these warning when I try to run the app in debug mode:

```
Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning: okio.Okio: can't find referenced class java.nio.file.Files
Warning: okio.Okio: can't find referenced class java.nio.file.Files
Warning: okio.Okio: can't find referenced class java.nio.file.Files
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning: there were 14 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)
:app:proguardDebug FAILED

```

这是如此怪异,因为我还添加了这些规则/选项依赖OkHttp /毕加索所有的库模块,我不知道哪里出了问题,也许这是一个Android Studio中的错误?没有人有任何线索,这个问题?

It's so weird since I also added these rules/options to all my library modules that depend on OkHttp/Picasso, I don't know where went wrong, perhaps this is a Android Studio bug ? Does anyone have any clues to this problem ?

我已经在GitHub上打开了一个问题

I have opened an issue on github.

推荐答案

哦基督,我忘了指定我的调试版本ProGuard的文件,添加了proguardFiles的规则可以解决这个问题:

Oh Christ, I forgot to specify the proguard file for my debug build, adding the 'proguardFiles' rule would solve the problem:

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable false
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            applicationIdSuffix ".debug"
        }
    }

一,你搜索很难钥匙的时刻,这是正确的在你的口袋里。

One of those moments you searched hard for your keys and it's right in your pocket.

这篇关于Android的工作室 - 1.2.RC Proguard的广场上的奥基奥库参考警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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