[英]Android Studio could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10
Thank you for taking the time to read this.感谢您抽出时间来阅读。
The Problem问题
I have been working on an app for sometime and it has been working fine until I tried to add a settings fragment via the "nav_graph".我一直在开发一个应用程序,它一直运行良好,直到我尝试通过“nav_graph”添加一个设置片段。 After I add it I am presented with a gradle error that on the surface seems simple enough but I have been unable to find the cause.添加后,我看到一个 gradle 错误,表面上看起来很简单,但我一直找不到原因。 If I revert the changes ie remove the settings fragment then my app builds again.如果我恢复更改,即删除设置片段,那么我的应用程序将再次构建。
The Error错误
Could not resolve all artifacts for configuration ':classpath'.
Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10.
The consumer was configured to find a runtime of a component compatible with Java 11, packaged as a jar, and its dependencies declared externally. However we cannot choose between the following variants of org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10:
My Thoughts我的想法
To me it seems like I need to select the correct variant compatible with Java 11?对我来说,似乎我需要 select 与 Java 11 兼容的正确变体? but I have not found how.但我还没有找到如何。 I initially thought that one of my "implementations" might have been causing it but if I revert adding the settings fragment everything builds and works.我最初认为我的一个“实现”可能是导致它的原因,但如果我恢复添加设置片段,一切都会构建和工作。 I could use Shared Preferences instead but I have decided not to as it is now depreciated.我可以改用共享首选项,但我决定不这样做,因为它现在已经贬值了。
Any ideas would be a great help.任何想法都会有很大帮助。 Many thanks.非常感谢。
Update your gradle version in build.gradle
and gradle-wrapper.properties
If you build by Android Studio, go to File
-> Invalidate Caches
and then try again after Android Studio restarted Update your gradle version in build.gradle
and gradle-wrapper.properties
If you build by Android Studio, go to File
-> Invalidate Caches
and then try again after Android Studio restarted
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.