我正在尝试遵循本教程,并在gradle.build中添加以下行:
https://android.jlelse.eu/googles-new-transition-api-for-android-d5d9d6904883
我不断收到此错误
Gradle DSL method not found: 'implementation()'
Possible causes:
The project 'My Application' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 3.5.3 and sync project
The project 'My Application' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file
The build file may be missing a Gradle plugin.
Apply Gradle plugin
这是我的gradle.build的样子
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
apply plugin: 'application'
apply plugin: 'maven'
implementation 'com.google.android.gms:play-services-location:15.0.1'
// 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
}
我尝试将其切换为编译方式,但已弃用。我已经尝试了Google列出的顶级解决方案,但是没有用。