AS: Unsupported method: AndroidProject.getPluginGeneration().

来源:互联网 发布:java path环境变量设置 编辑:程序博客网 时间:2024/05/16 12:43

报错内容

16:56:06 UnsupportedMethodException         Unsupported method: AndroidProject.getPluginGeneration().         The version of Gradle you connect to does not support that method.         To resolve the problem you can change/upgrade the target version of Gradle you connect to.         Alternatively, you can ignore this exception and read other information from the model.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5

解决方法:关掉instant run

这里写图片描述

还有一个解决方法,下载LockHunter,然后再app的build.gradle中加上如下代码,确保清空build文件夹内容

task clean(type: Exec) {    ext.lockhunter = '\"D:\\Program Files\\LockHunter\\LockHunter.exe\"'    def buildDir = file(new File("build"))    commandLine 'cmd', "$lockhunter", '/delete', '/silent', buildDir}
0 0
原创粉丝点击