I am writing an Android app on my Mac Book Pro (M3 running Sonoma) with a recently downloaded Android Studio. When I start a new Java project, the options for gradle are:
- Kotlin DSL (build.gradle.kts) [Recommended]
- Groovy DSL (build.gradle)
The first has the syntax: implementation(libs.appcompat)
The second has the syntax: implementation libs.appcompat
However, most of the recent online tutorials use the syntax: implementation ‘com.google.android.gms:play-services-ads:23.1.0’
A bit of digging reveals that the syntax I see in the tutorials is the newest one and I should switch to it. But I just downloaded a new Android Studio before posting this note and it didn’t change things. Is there some obvious setting I’m just missing?
I have also consulted Google’s Gemini AI, which suggested I change the project-level gradle file, which it specifically states should be the build.gradle and not the build.gradle.kts file but, when I open my project, I only see two gradle files — and they’re both named build.gradle.kts.
James Wen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.