【问题标题】:ProGuard: Warning: butterknife.internal.InjectViewProcessor:ProGuard:警告:butterknife.internal.InjectViewProcessor:
【发布时间】:2015-10-01 11:02:26
【问题描述】:

我在使用idea13生成apk时遇到了这个错误

ProGuard:  Warning: butterknife.internal.InjectViewProcessor: can't find superclass or interface javax.annotation.processing.AbstractProcessor

【问题讨论】:

    标签: android


    【解决方案1】:

    即使您没有发布实际问题,我假设您希望该警告消失。

    将以下行添加到您的 ProGuard 配置中:

    -dontwarn butterknife.internal.**
    -keep class **$$ViewInjector { *; }
    -keepnames class * { @butterknife.InjectView *;}
    

    source

    【讨论】:

    • 如果我们保留黄油刀类,为什么我们需要 -dontwarn 行?为什么还会出现警告?
    • 请注意,“-keepnames class *”意味着您的所有类名都不会被混淆。
    【解决方案2】:

    如果有人确实遇到了 Proguard 和 Butterknife 的问题,请使用http://jakewharton.github.io/butterknife/index.html#proguard提供的以下内容

    -keep class butterknife.** { *; }
    -dontwarn butterknife.internal.**
    -keep class **$$ViewBinder { *; }
    
    -keepclasseswithmembernames class * {
        @butterknife.* <fields>;
    }
    
    -keepclasseswithmembernames class * {
        @butterknife.* <methods>;
    }
    

    【讨论】:

    猜你喜欢
    • 2023-01-01
    • 2015-06-02
    • 1970-01-01
    • 1970-01-01
    • 2011-10-07
    • 1970-01-01
    • 1970-01-01
    • 2017-10-27
    • 1970-01-01
    相关资源
    最近更新 更多