老版本有效
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.
或者
(經(jīng)鑒定有效:)
allprojects {
repositories {
jcenter()
}
/防止調(diào)用過(guò)時(shí)的mockableAndroidJar報(bào)錯(cuò)/
gradle.taskGraph.whenReady {
tasks.each { task ->
if (task.name.equals('mockableAndroidJar')) {
task.enabled = false
}
}
}
}
新版本3.6.3,在有上述配置的情況下,會(huì)出現(xiàn),
問(wèn)題描述:當(dāng)點(diǎn)擊運(yùn)行按鈕時(shí)候會(huì)出現(xiàn)
Task with name 'mockableAndroidJar' not found in project ':app'這個(gè)問(wèn)題,問(wèn)題的根源在
compile中配置了那個(gè),刪除配置的mockableAndroidJar相關(guān)的,程序即正常