bin^2

bin^2

discord server
twitter

Android Tips 2022-12-16

Android Tips #2022-12-16#

#Android #Dev #Tip
#Build #Performance #Optimization

In most cases, Library modules in Android projects do not need to generate BuildConfig and custom ResValue. You can speed up the build process by disabling these two BuildFeatures in the Library module.

Configuration for a single module#

  • Add the following code to build.gradle
android{
	buildFeatures{
		buildConfig false
		resValues false
	}
}

Unified configuration#

  • Disable them in gradle.properties
android.defaults.buildfeatures.buildconfig=false  
android.defaults.buildfeatures.resvalues=false
  • Enable them in app/build.gradle
android {
	buildFeatures {
		buildConfig true
		resValues true
	}
}

Unified configuration for Library modules only#

  • Disable them in gradle.properties
android.library.defaults.buildfeatures.buildconfig=false
android.library.defaults.buildfeatures.resvalues=false
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.