I want to include the material-design library for android into my project, but I'm a bit confused where to find it and how to include it. I downloaded the library from github https://github.com/material-components/material-components-android.
I tried to build it with gradle, but I got the following error, to which I can't seem to find the solution:
> Configure project :catalog
Checking the license for package Android SDK Build-Tools 27.0.3 in /mnt/sda2/android/Sdk/licenses
Warning: License for package Android SDK Build-Tools 27.0.3 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
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
I have the 'build-tools 27.0.3' installed through the SDK manager. Any hints please on how can I bypass this issue?
As far as I understood, I need to compile the library in the first place, then place it into the /lib folder, and then tell 'Ant' build tool to include this library in order to use it. Is this correct? Maybe there's a place from which I can simply download already pre-compiled lib? I couldn't seem to locate it in the SDK manager. Thank you!
I'm trying to build the project with Gradle now, this is my build.gradle file:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
implementation 'com.google.android.material:material:1.0.0-beta01'
}
}
allprojects {
repositories {
google()
jcenter()
mavenLocal()
}
}
but I keep getting an error:
Could not find method implementation() for arguments [com.google.android.material:material:1.0.0-beta01] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Any hints please?
UPDATE
I downloaded android studio, followed the instructions, here's a snippet of my build.gradle:
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
compile "com.android.support:design:27.1.1"
}
but now I'm getting a different error:
Could not find method compile() for arguments [com.android.support:design:25.1.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Please install the Android Support Repository from the Android SDK Manager.
Open Android SDK Manager
I opened the SDK manager, but he Android Support Repository is already installed (rev47). Any hints please? Thanks!