Could not resolve all dependencies for configuration app:debugRuntimeClasspath

报错

1
2
3
Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not create task ':app:minifyReleaseWithR8'.
Cannot query the value of this provider because it has no value available

同时提示:

1
2
3
Warning:<i><b>project ':app': Unable to build kotlin-kapt plugin configuration</b>
Details: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:minifyReleaseWithR8'.
Caused by: org.gradle.api.internal.provider.MissingValueException: Cannot query the value of this provider because it has no value available.</i>

同事那边代码正常编译运行, 我这边把代码拉下来后报错, 很大可能性是Studio环境问题

百度试了很多方案均不奏效

最后在StackOverflow上找到了答案:

是SDK版本和buildToolsVersion不一致导致的

只需将buildToolsVersion版本改成本机已装SDK版本即可, 或者不改动代码 下载一个与之对应的SDK版本

问题解决

本文为作者原创 转载时请注明出处 谢谢

img

乱码三千 – 点滴积累 ,欢迎来到乱码三千技术博客站

0%