Android Studio could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10

Viewed 186

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". 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. 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:

enter image description here

My Thoughts

To me it seems like I need to select the correct variant compatible with 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.

1 Answers

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

Related