How to Import Material Design Library to Android Studio

How do I import material design library to Android Studio?

If you are using Android Studio:

  • You can import the project as a module and change the following in the build.gradle file of the imported module.

  • Change apply plugin: com.android.application to apply plugin: com.android.library
    remove applicationId and set minSdkVersion to match your project minSdkVersion.

  • And in your project build.gradle file compile project(':MaterialDesignLibrary'), where MaterialDesignLibrary is the name of your library project or you can import the module by File -> Project Structure -> Select your project under Modules -> Dependencies -> Click on + to add a module.

How to include the material-design library

Hope following things help you :-

**A problem occurred configuring project ':catalog'.Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;27.0.3 Android SDK Build-Tools 27.0.3**
  1. You need to accept the licence first, check the link here for your licence issue :- https://stackoverflow.com/a/41078173/2919483

  2. For adding material design library in Android studio :-

     In you build.gradle, add the dependency like:

    dependencies {
    compile 'com.android.support:design:25.1.0'
    }

sync your project and start using that.

I want to import design library in androidx 29 version(latest version)

You can use : -

implementation 'com.google.android.material:material:1.0.0' library in androidx for design.

Can't import Material Design Library in android studio

Dont follow the above tutorial, the shown approach is useful when the library has not published as maven or gradle dependency.But as Github page say it is published on maven.

So remove the module or library project completely from your project and use gradle dependency instead.

Just copy this in your app module's build.gradle inside dependencies closure

dependencies {
// YOUR OTHER DEPENDENCIES
compile 'com.github.navasmdc:MaterialDesign:1.+@aar'
}

Sync your project with gradle.

Add Material Design Library In Android Studio

in you build.gradle, add the dependency like:

dependencies {
...
compile 'com.android.support:design:25.1.0'
...
}

sync your project and start using it.

See here.

Import Material design library android studio

I just tryied to add a TextInputLayout on the xml file, eliminated the snackbar and tryied to compile it, After no error, it works, Now I can import the snackbar

What dependency I need to add to use com.google.android.material.slider.Slider

You have to use the Material Components Library:

implementation 'com.google.android.material:material:1.2.0-rc01'

The Slider components was introduced with the version 1.2.0-alpha01

Import material design icons into an android project

Take a look at Vector Asset Studio

Follow these steps to start Vector Asset Studio:

  • In Android Studio, open an Android app project.
  • In the Project window, select the Android view.
  • Right-click the res folder and select New > Vector Asset.

After you open Vector Asset Studio, you can add a material icon as follows:

  • Select "Material Icon" (by clicking on the Clip Art: ICON)
  • Click Choose
  • Select a material icon


Related Topics



Leave a reply



Submit