包含我在 Android 应用程序中使用 Kotlin 时出现的错误屏幕截图的图像链接。由于此错误,我无法完成 Gradle 构建:无法解析:com.google.firebase:firebase-core-ktx:
我尝试了 stackoverflow 上所有可能的解决方案。我已经从 SDK 管理器下载了最新的 google play 服务。我将 maven{url...} 放置在我的所有存储库中,但无法修复此错误。甚至尝试在我的实现中添加版本规范。请在这件事上给予我帮助!!
下面是我的 build.gradle 文件:-
buildscript {
ext.kotlin_version = "1.4.21"
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
这些是添加到代码中的依赖项:- …
kotlin firebase google-play-services android-studio build.gradle