Why is Gradle failing on :linkDebugTestLinux in my Kotlin multiplatform project?
我正在将C#库移植到Kotlin以利用多平台的优势。运行
对于上下文,我正在Manjaro上使用IDEA Ultimate。我确定我的代码没有问题,因为
" linkDebugTestLinux "的DDG结果为零,对于" konan找不到家"或" kotlin本机... "没有任何帮助。经过数小时将官方文档中不完整和过时的示例拼接在一起,我已经放弃了。
我的
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | plugins { kotlin("multiplatform") version"1.3.40" } repositories { mavenCentral() } dependencies { commonMainImplementation("org.jetbrains.kotlin:kotlin-stdlib") commonTestImplementation("org.jetbrains.kotlin:kotlin-test-common") commonTestImplementation("org.jetbrains.kotlin:kotlin-test-annotations-common") } kotlin { // js() // wasn't the issue linuxX64("linux") } |
不带参数的任务
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | > Configure project : Kotlin Multiplatform Projects are an experimental feature. > Task :compileKotlinLinux [...unused param warnings...] > Task :compileKotlinMetadata [...unused param warnings...] > Task :metadataMainClasses > Task :metadataJar > Task :assemble > Task :linuxProcessResources NO-SOURCE > Task :linuxMainKlibrary > Task :linkDebugTestLinux FAILED e: Could not find"/home/username/" in [/home/username/path/to/the/repo, /home/username/.konan/klib, /home/username/.konan/kotlin-native-linux-1.3/klib/common, /home/username/.konan/kotlin-native-linux-1.3/klib/platform/linux_x64]. [...snip...] BUILD FAILED in 16s 4 actionable tasks: 4 executed Process 'command '/usr/lib/jvm/java-8-openjdk/bin/java'' finished with non-zero exit value 1 |
在样板中,我省略了建议使用
经过一番调查,我们认为问题出在路径上。在调试日志中,您获得了
现在,我建议您将目录名称更改为琐碎的内容。