对于Android Studio"Android Studio Hedgehog|2023.1.1",Kotlin是Gradle文件的默认设置.我的一个Groovy build.gradle文件的一部分示例如下:

dependencies
{   implementation files('libs/jsch-0.1.54.jar')
    implementation project(':potpourri')

更正setting.gradle文件为:

include ':app'
include ':potpourri'

project(':potpourri').projectDir = new File(settingsDir, '../Potpourri/app')

我的问题是:花香模块的Kotlin类似功能是什么?

推荐答案

像这样的事情应该会奏效:

dependencies {
    implementation(files("libs/jsch-0.1.54.jar"))
    implementation(project(":potpourri"))
}

在settings.gradle.kts中:

include(":app")
include(":potpourri")

project(":potpourri").projectDir = File(settingsDir, "../Potpourri/app")

有关子项目之间依赖关系的更多信息,请访问此处:https://docs.gradle.org/current/userguide/declaring_dependencies_between_subprojects.html

Kotlin相关问答推荐

如何在Kotlin中反射多个对象以查找特定类型的属性

将文本与文本字段的内容对齐

可选的.在kotlin中不使用泛型参数

两个LocalDateTime之间的Kotlin差异

从 Kotlin 的父类获取函数注解

如何在 Kotlin 中初始化 Short 数组?

kotlin 模式匹配如何像 scala 一样工作

如何规避 Kotlin 的泛型类型差异约束

循环中的每个元素都应填充行中可用的所有可用空间

Kotlin 有垃圾收集器吗?如果是这样,它基于哪种算法?

TestContainers PostgreSQLContainer 与 Kotlin 单元测试:Not enough information to infer type variable SELF

在 Kotlin 中使用 @Parcelize 注释时如何忽略字段

如何解决此错误请Kotlin:[Internal Error] java.lang.ExceptionInInitializerError

Kotlin 中的内联构造函数是什么?

无法在Kotlin中使用argb color int值?

Kotlin协程处理错误和实现

Kotlin中具有多个参数的绑定适配器

如何使用协调器布局和行为在CardView上完成此动画?

如何限制kotlin协程的最大并发性

如何在 Kotlin 中按字母顺序对字符串进行排序