缺少类型参数。 Proguard的?

时间:2016-05-26 19:23:09

标签: android android-proguard

自从我更新了我的Android Studio后,我得到了应用程序的某些部分: "缺少类型参数。"

我在Stack Overflow上找到了这个答案: How do you stop Proguard from removing type parameters? 或这个 proguard Missing type parameter

但即使在添加建议的行

之后
-renamesourcefileattribute SourceFile
-keepattributes  Signature,SourceFile,LineNumberTable
-keep public class * extends android.app.Application

在我的proguard-android.txt中我仍然得到错误。我甚至都不知道为什么,对于大多数人来说,似乎使用Gson的课程失败了,但我使用Gson的大多数课程都工作正常。

我甚至不知道我指定使用Proguard的位置,在我的Module Gradle文件中没有指定任何内容,只有一些库在那里有gradle。

1 个答案:

答案 0 :(得分:0)

不确定你是否还有这个问题,但我终于明白了为什么我会这么做。在build.gradle文件中,我从未在buildTypes中包含proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - >调试。所以这就是我的样子:

buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
相关问题