noe
noe

Reputation: 2144

Kotlin 1.6.0 breaks proguard?

After updating my Android app from Kotlin 1.5.21 to Kotlin 1.6.0, my proguard rules stopped working (i.e. they are ignored). This caused some reflection code to break on release mode. Downgrading to Kotlin 1.5.21 fixes the problem.

Are there any known problems with Kotlin 1.6.0 and proguard ?

Googling around, I see that there are other related problems (see this, this, this).

Upvotes: 5

Views: 1351

Answers (1)

noe
noe

Reputation: 2144

The problem was the version of R8 bundled with the Android Gradle Plugin (AGP).

Following the advice in this related answer, I explicitly set com.android.tools:r8:3.0.77 in my gradle configuration file.

dependencies {
    classpath("com.android.tools:r8:3.0.77")
    classpath 'com.android.tools.build:gradle:7.1.0'
}

Upvotes: 1

Related Questions