Can I disable R8 just for some flavors without using command line?

301 views Asked by At

I'm trying to release my app on amazon and apparently I can't use R8 if I want to use IAP.

Currently I'm handling pretty much everything just using Gradle flavors. So how can I tell it to not use R8 for my Amazon flavor on Gradle?

Thanks.

1

There are 1 answers

1
sgjesse On BEST ANSWER

I don't think that there is a way to use different shrinkers on a flavor level.

However, the issue with Amazon IAP has been fixed (see https://issuetracker.google.com/134766810), and is included in Android Studio 3.6, which is avaliable as a release candidate on https://developer.android.com/studio/preview.

If you want to use the fix in Android Studion 3.5 you can get that to use a newer version of R8 by adding the following to you top level build.gradle file:

buildscript {

    repositories {
        maven {
            url "http://storage.googleapis.com/r8-releases/raw"
        }
    }

    dependencies {
        classpath 'com.android.tools:r8:1.6.67'  // Must be before the Gradle Plugin for Android.
        classpath 'com.android.tools.build:gradle:X.Y.Z'     // Your current AGP version.
     }
}