gpt4 book ai didi

android - 如何修复 build.gradle?

转载 作者:行者123 更新时间:2023-12-04 12:04:10 25 4
gpt4 key购买 nike

连接我的模块和build.gradle接下来写:

plugins {
id("org.jlleitschuh.gradle.ktlint")
kotlin("jvm")
}

dependencies {
compileOnly(kotlin("stdlib"))
compileOnly(kotlin("reflect"))
compileOnly(kotlin("script-runtime"))
compileOnly("com.pinterest.ktlint:ktlint-core:0.34.2")
}

并得到下一个错误:

startup failed: build file '/home/vadimm/AndroidStudioProjects/homework/target-list/custom_ktlint_rules/build.gradle': 3: only id(String) method calls allowed in plugins {} script block

See https://docs.gradle.org/5.1.1/userguide/plugins.html#sec:plugins_block for information on the plugins {} block

@ line 3, column 5. kotlin("jvm") ^

1 error



也试过这样写: apply plugin: 'kotlin'或者
plugins {
id 'kotlin'
}

但这并不成功

最佳答案

I have faced similar issue. Following solution works for me. Good Luck!!

plugins {
kotlin("kapt")
id("dagger.hilt.android.plugin")
}
plugins {
id("kotlin-kapt")
id("dagger.hilt.android.plugin")
}

关于android - 如何修复 build.gradle?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57380152/

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