yanchenko
yanchenko

Reputation: 57206

Exclude BuildConfig.class from Android library jar in Gradle

When building an Android Library Project with Gradle, what's the correct way to exclude BuildConfig.class from the resulting .jar?

Upvotes: 5

Views: 2968

Answers (2)

guness
guness

Reputation: 6656

here is a way to exclude from AAR:

apply plugin: 'com.android.library'

afterEvaluate {
  generateReleaseBuildConfig.enabled = false
}

here is the source from reddit

Upvotes: 1

yanchenko
yanchenko

Reputation: 57206

Solved with android.packageBuildConfig = false which is deprecated according to http://tools.android.com/tech-docs/new-build-system

Upvotes: 1

Related Questions