老版本有效
1.Go to File -> Settings -> Build, Execution, Deployment -> Compiler
2.Add to "Command-line Options":
-x :app:mockableAndroidJar
3.Press "OK" and try to Rebuild Project again.
或者
(经鉴定有效:)
allprojects {
repositories {
jcenter()
}
/防止调用过时的mockableAndroidJar报错/
gradle.taskGraph.whenReady {
tasks.each { task ->
if (task.name.equals('mockableAndroidJar')) {
task.enabled = false
}
}
}
}
新版本3.6.3,在有上述配置的情况下,会出现,
问题描述:当点击运行按钮时候会出现
Task with name 'mockableAndroidJar' not found in project ':app'这个问题,问题的根源在
compile中配置了那个,删除配置的mockableAndroidJar相关的,程序即正常
网友评论