刚刚下载了最新版本的Android Studio,以及所有最新的插件等,并且基于Android 5.0和更高版本gradle的新项目的版本为4.6。
按照以下说明尝试添加Material 2.0-https://material.io/develop/android/docs/getting-started/,但出现此错误-
Could not find method implementation() for arguments [com.google.android.material:material:1.1.0-alpha01] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Open File
这是完整的build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
implementation 'com.google.android.material:material:1.1.0-alpha01'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
来自gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists