When you create a new project with android studio, you choose between various templates to begin your project with., and with each new release of android studio, this subtly changes.
As I am taking a udemy course on android development with compose that was made prior to material3’s release, this is a problem because the narrator’s steps cannot be copied exactly.
A simple method around this is to download an older android studio that has older templates. This worked for a while but eventually there were dependency issues (e.g. some libraries were compiled with a newer version of kotlin, etc.).
So, briefly, how can I work with Material (not material3) in the latest android studio? Are there templates for android studio available to download that set up a Material (version 2) project that I can download?
Or, failing that, what is the latest version of android studio I can download that will allow me to set up a material 2 project that will work with the latest versions of kotlin, gradle, etc?
2
Answers
I noticed that older releases (e.g. Dolphin) include the Material2 templates, and that the most recent, updated versions of these releases work with all the latest updates to the underlying libraries. Newer releases, such as Hedgehog, don't offer the Material2 templates.
So, the answer is, don't download the latest version of the latest release, but download the latest release of an older version, such as Dolphin.
In your app build.gradle file, just replace
with
Don’t forget to then sync your gradle files.