Saman Sattari Saman Sattari - 1 year ago 387
Android Question

How do I import material design library to Android Studio?

I want to import this library to my project in Android Studio v1.0.0 rc2:

But there is a problem. When I add this library as a module, this error appears:

Error:Dependency MyApplication.libraries:MaterialDesign:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: C:\ADTBundle\StudioWorkspace\MyApplication\libraries\MaterialDesign\build\outputs\apk\MaterialDesign-release-unsigned.apk

What would be a step-by-step guide to solve this problem? Or what would be a gradle dependency for this library?

Answer Source

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: to apply plugin: 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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download