Keep dev tools up to date with each Android Studio version.
Search Jetpack libraries in Jetpack homepage.
English language pages should show newer library version than the Chinese.
Type a library name in module dependencies block, libraries with the latest version will be suggested.
New version dependencies generally require new kotlin version, find latest kotlin version from Kotlin website.
Each version of Android Studio requires specific versions of AGP, pay especially attention to the maximum supported AGP version from AGP releases and latest AGP version from AGP in MvnRepository.
AGP version supported by Giraffe is 3.2-8.1. Patch releases like 8.1.x are also included.
Find the minimum required version from Update gradle section and the latest gradle version from Gradle website.
AGP 8.1 requires JDK not older than 17, Gradle not older than 8.0.
A comprehensive explanation on Java versions in Android builds.
A Project is an ExtensionAware Object that has an ExtensionContainer field implemented as Map<String, Object>
.
android
block in build.gradle file represents an extension of type BaseAppModuleExtension
created and added to the project in AppPlugin
.
BaseAppModuleExtension
has fields like defaultConfig
, buildTypes
etc.,buildFeatures
and namespace
are indirectly implemented by extensions when they implement the new public extension interfaces via delegates.
To view AGP source code, add the following dependencies to the app module build.gradle:
compileOnly gradleApi()
compileOnly 'com.android.tools.build:gradle:$agp'
Follow these steps, view Migrating build logic from Groovy to Kotlin for detail documentation.
- Searching for ' and replacing by "
- Disambiguating function invocations and property assignments
- Naming script file build.gradle.kts
- Configuring plugins, tasks and dependencies
- Creating tasks or custom configurations
Best practices:
- Applying plugins in the
plugins {}
block - Putting local build logic in the build’s buildSrc directory