Tim Strehlow
Tim Strehlow

Reputation: 188

Disable R8 for specific flavors

I want to disable R8 for a specific flavor of my app (so setting android.enableR8=false). Does anybody know how to do it, or if it is even possible? Can I maybe somehow have designated gradle.properties files, or how would that work?

Upvotes: 5

Views: 1515

Answers (1)

Tim Strehlow
Tim Strehlow

Reputation: 188

I now solved this problem by passing the parameter from command line. This overrides the setting in gradle.properties. Since I have a script at hand that creates a release build for a specific flavor this works well. Depending on the flavor I pass either:

./gradlew -P android.enableR8=false assemble[...]Release

or

./gradlew -P android.enableR8=true assemble[...]Release

This does the trick for me now :)

Upvotes: 1

Related Questions