使用依赖项的Kotlin Gradle

使用依赖项的Kotlin Gradle,gradle,kotlin,gradle-kotlin-dsl,Gradle,Kotlin,Gradle Kotlin Dsl,我试图使用Gradle和命令行在Kotlin中包含org.apache.commons.net.*库 在我的build.gradle.kts文件中的依赖项中,我写道: 编译“commons-net:commons-net:3.6”如中所述,但它给了我一个奇怪的错误: > Configure project : e: D:\core\Confidential\Learn\Kotlin\build.gradle.kts:30:13: Too many characters in a char

我试图使用Gradle和命令行在Kotlin中包含
org.apache.commons.net.*

在我的
build.gradle.kts
文件中的依赖项中,我写道:

编译“commons-net:commons-net:3.6”
如中所述,但它给了我一个奇怪的错误:

> Configure project :
e: D:\core\Confidential\Learn\Kotlin\build.gradle.kts:30:13: Too many characters
 in a character literal ''commons-net:commons-net:3.6''

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\core\Confidential\Learn\Kotlin\build.gradle.kts' line: 30

* What went wrong:
Script compilation error:

  Line 30:     compile('commons-net:commons-net:3.6')
                       ^ Too many characters in a character literal ''commons-ne
t:commons-net:3.6''

1 error

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
(我还尝试了
编译'commons-net:commons-net:3.6'
编译组:'commons-net',名称:'commons-net',版本:'3.6'

我对Kotlin完全陌生,我正在尝试在IDEA上开始Android开发之前熟悉它


谢谢。

就像在Java中一样,
'
表示字符文本,
表示字符串文本

您需要
“commons-net:commons-net:3.6”

不推荐使用
compile()
。请使用
implementation()