0

Since I updated my Android Studio, I get at certain parts of my App this exception: "Missing type parameter."

I found on Stack Overflow this answer: How do you stop Proguard from removing type parameters? or this proguard Missing type parameter

But even after adding the suggested lines

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

in my proguard-android.txt I still get the error. I dont even know why, for most people it seemed to fail with classes which use Gson, but most of my classes using Gson work fine.

I also dont even know where I specified to use Proguard, in my Module Gradle file nothing is specified, just some libraries have it in there gradle.

Community
  • 1
  • 1
Luca Thiede
  • 3,229
  • 4
  • 21
  • 32

1 Answers1

1

Not sure if you still have this issue but I finally figured out why I was getting it. In the build.gradle file I never included proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' in the buildTypes -> debug. So this is what mine looks like:

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'
    }
}
Sonu
  • 166
  • 2
  • 11