使用依赖项的Kotlin Gradle
我试图使用Gradle和命令行在Kotlin中包含使用依赖项的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
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()