Gradle build scenarios with 'Could not resolve all dependencies' when using Kotlin DSL in Android project
I'm dealing with I've tried everything I can think of but I'm converting an old project and I'm prototyping a solution and Hey everyone, I'm running into an issue that's driving me crazy....... I've looked through the documentation and I'm still confused about I'm working with a frustrating scenario where my Gradle build fails with the behavior message 'Could not resolve all dependencies' when I try to build my Android project using Kotlin DSL (`build.gradle.kts`). I've tried cleaning and rebuilding the project, invalidating caches, and even restarting Android Studio, but the scenario continues. Here's a snippet from my `build.gradle.kts` file: ```kotlin plugins { id("com.android.application") version "7.2.1" apply false kotlin("android") version "1.6.10" apply false } android { compileSdk = 31 defaultConfig { applicationId = "com.example.myapp" minSdk = 21 targetSdk = 31 versionCode = 1 versionName = "1.0" } } dependencies { implementation("androidx.core:core-ktx:1.7.0") implementation("androidx.appcompat:appcompat:1.4.1") implementation("com.google.android.material:material:1.5.0") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10") } ``` The behavior message I'm seeing is: ``` Failure: Build failed with an exception. * What went wrong: Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'. ``` I suspect it might be related to how I declare my dependencies or the repositories. Here's how I set my repositories in the `settings.gradle.kts`: ```kotlin pluginManagement { repositories { google() mavenCentral() } } dependencyResolutionManagement { repositories { google() mavenCentral() } } ``` I double-checked that I have internet access and everything should be up to date, but I still get dependency resolution errors, especially when syncing with Gradle. Has anyone encountered this scenario, or can you suggest what might be going wrong? Any ideas on what I might be missing here? For context: I'm using Kotlin on macOS. Any help would be greatly appreciated! Any ideas what could be causing this? I'd love to hear your thoughts on this. How would you solve this? I'm developing on CentOS with Kotlin. I've been using Kotlin for about a year now. I'd love to hear your thoughts on this.