skip to Main Content

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


  1. Chosen as BEST ANSWER

    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.


  2. In your app build.gradle file, just replace

    dependencies {
        implementation "androidx.compose.material3:material3:1.1.2"
    }
    

    with

    dependencies {
        implementation "androidx.compose.material:material:1.5.4"
    }
    

    Don’t forget to then sync your gradle files.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search