Plugin ‘com.android.application‘ is already on the script classpath的解决方法

x33g5p2x  于2022-02-22 转载在 Android  
字(0.5k)|赞(0)|评价(0)|浏览(778)

【现象】

Build file 'D:\work\app\build.gradle' line: 2

Error resolving plugin [id: 'com.android.application']

Plugin 'com.android.application' is already on the script classpath. Plugins on the script classpath cannot be applied in the plugins {} block. Add  "apply plugin: 'com.android.application'" to the body of the script to use the plugin.

【解决方法】
plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-android-extensions'
}

修改为:

plugins {
    apply plugin: 'com.android.application'
    apply plugin: 'kotlin-android'
    apply plugin: 'kotlin-android-extensions'
}

相关文章