gpt4 book ai didi

java - Kotlin 和 Gradle 的 Flutter 依赖问题

转载 作者:行者123 更新时间:2023-12-03 05:08:03 26 4
gpt4 key购买 nike

我在构建在 iOS 上运行良好的 Android 应用程序时遇到问题。错误内容如下:

* 什么地方出了错:
评估项目 ':app' 时出现问题。

Could not find method classpath() for arguments [org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.



这是我在 app 模块的 build.gradle 中的依赖项:
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'}

感谢您的帮助!

最佳答案

要在字符串中包含 var,您需要双引号:

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

正如您在此处看到的: https://kotlinlang.org/docs/reference/using-gradle.html

关于java - Kotlin 和 Gradle 的 Flutter 依赖问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54129705/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com