Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
kotlin的Gradle构建失败_Gradle_Kotlin_Native - Fatal编程技术网

kotlin的Gradle构建失败

kotlin的Gradle构建失败,gradle,kotlin,native,Gradle,Kotlin,Native,我有一个kotlin包,我正试图为它编写一个gradle设置来自动构建。可以在github上找到相关的存储库-> 当前运行的gradle build或gradle compileLKotlin失败,出现以下错误: e: java.lang.ArrayIndexOutOfBoundsException: 450 at org.jetbrains.org.objectweb.asm.ClassReader.readUnsignedShort(ClassReader.java:2464)

我有一个kotlin包,我正试图为它编写一个gradle设置来自动构建。可以在github上找到相关的存储库->

当前运行的
gradle build
gradle compileLKotlin
失败,出现以下错误:

e: java.lang.ArrayIndexOutOfBoundsException: 450
    at org.jetbrains.org.objectweb.asm.ClassReader.readUnsignedShort(ClassReader.java:2464)
    at org.jetbrains.org.objectweb.asm.ClassReader.readUTF8(ClassReader.java:2525)
    at org.jetbrains.org.objectweb.asm.ClassReader.readModule(ClassReader.java:761)
    at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:646)
    at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:507)
    at org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleInfo$Companion.read(JavaModuleInfo.kt:67)
    at org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleFinder.findSystemModule(CliJavaModuleFinder.kt:44)
    at org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleFinder.access$findSystemModule(CliJavaModuleFinder.kt:25)
    at org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleFinder$systemModules$1.invoke(CliJavaModuleFinder.kt:37)
    at org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleFinder$systemModules$1.invoke(CliJavaModuleFinder.kt:25)
    at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:149)
    at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:109)
    at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:133)
    at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:254)
    at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:241)
    at kotlin.sequences.SequencesKt___SequencesKt.none(_Sequences.kt:1239)
    at org.jetbrains.kotlin.cli.jvm.compiler.ClasspathRootsResolver.addModularRoots(ClasspathRootsResolver.kt:227)
    at org.jetbrains.kotlin.cli.jvm.compiler.ClasspathRootsResolver.computeRoots(ClasspathRootsResolver.kt:124)
    at org.jetbrains.kotlin.cli.jvm.compiler.ClasspathRootsResolver.convertClasspathRoots(ClasspathRootsResolver.kt:79)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:230)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:114)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:409)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:286)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createEnvironmentWithScriptingSupport(K2JVMCompiler.kt:276)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:155)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:63)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:109)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:53)
    at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:92)
    at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:451)
    at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:97)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:218)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.access$compileIncrementally(IncrementalCompilerRunner.kt:37)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner$compile$2.invoke(IncrementalCompilerRunner.kt:80)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:92)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.execIncrementalCompiler(CompileServiceImpl.kt:518)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.access$execIncrementalCompiler(CompileServiceImpl.kt:97)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:400)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:97)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:895)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:97)
    at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:925)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:894)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:399)
    at jdk.internal.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:844)


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileKotlin'.
> Internal compiler error. See log for more details

* 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

BUILD FAILED in 1s
在使用
--info
标志运行构建时,我得到以下输出:

Initialized native services in: /Users/ishankhare/.gradle/native
The client will now receive all logging from the daemon (pid: 11054). The daemon log file: /Users/ishankhare/.gradle/daemon/4.10/daemon-11054.out.log
Starting 42nd build in daemon [uptime: 43 mins 31.646 secs, performance: 100%, no major garbage collections]
Using 4 worker leases.
Starting Build
Settings evaluated using settings file '/Users/ishankhare/code/ishan/kotlin-web-server/server/settings.gradle'.
Projects loaded. Root project using build file '/Users/ishankhare/code/ishan/kotlin-web-server/server/build.gradle'.
Included projects: [root project 'server']

> Configure project :
Evaluating root project 'server' using build file '/Users/ishankhare/code/ishan/kotlin-web-server/server/build.gradle'.
All projects evaluated.
Selected primary task 'compileKotlin' from project :
Tasks to be executed: [task ':compileKotlin']
:compileKotlin (Thread[Task worker for ':',5,main]) started.
e: java.lang.ArrayIndexOutOfBoundsException


> Task :compileKotlin FAILED
file or directory '/Users/ishankhare/code/ishan/kotlin-web-server/server/src/main/kotlin', not found
file or directory '/Users/ishankhare/code/ishan/kotlin-web-server/server/src/main/java', not found
Task ':compileKotlin' is not up-to-date because:
  Task has failed previously.
All input files are considered out-of-date for incremental task ':compileKotlin'.
file or directory '/Users/ishankhare/code/ishan/kotlin-web-server/server/src/main/kotlin', not found
file or directory '/Users/ishankhare/code/ishan/kotlin-web-server/server/src/main/java', not found
file or directory '/Users/ishankhare/code/ishan/kotlin-web-server/server/src/main/kotlin', not found
file or directory '/Users/ishankhare/code/ishan/kotlin-web-server/server/src/main/java', not found
Using Kotlin incremental compilation
Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0], reportSeverity=2, requestedCompilationResults=[0]), areFileChangesKnown=false, modifiedFiles=null, deletedFiles=null, workingDir=/Users/ishankhare/code/ishan/kotlin-web-server/server/build/kotlin/compileKotlin, customCacheVersionFileName='gradle-format-version.txt', customCacheVersion=4, resultDifferenceFile=/Users/ishankhare/code/ishan/kotlin-web-server/server/build/kotlin/compileKotlin/build-history.bin, friendDifferenceFile=null, usePreciseJavaTracking=false)
[KOTLIN] deleting /Users/ishankhare/code/ishan/kotlin-web-server/server/build/classes/kotlin/main on error
[KOTLIN] deleting /Users/ishankhare/code/ishan/kotlin-web-server/server/build/classes/kotlin/main on error
:compileKotlin (Thread[Task worker for ':',5,main]) completed. Took 0.087 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileKotlin'.
> Internal compiler error. See log for more details

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

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 0s
1 actionable task: 1 executed

arrayindexoutofboundsexception位于:它基本上看起来像是在寻找东西而没有找到它,因此它失败了。我的建议是更新构建脚本ext.kotlin_version='1.2.21'并将其切换到1.2.61,这将很可能解决它寻找和没有找到的东西的问题Kotlin的版本。请升级至最新版本1.2.61
Initialized native services in: /Users/ishankhare/.gradle/native
The client will now receive all logging from the daemon (pid: 11054). The daemon log file: /Users/ishankhare/.gradle/daemon/4.10/daemon-11054.out.log
Starting 42nd build in daemon [uptime: 43 mins 31.646 secs, performance: 100%, no major garbage collections]
Using 4 worker leases.
Starting Build
Settings evaluated using settings file '/Users/ishankhare/code/ishan/kotlin-web-server/server/settings.gradle'.
Projects loaded. Root project using build file '/Users/ishankhare/code/ishan/kotlin-web-server/server/build.gradle'.
Included projects: [root project 'server']

> Configure project :
Evaluating root project 'server' using build file '/Users/ishankhare/code/ishan/kotlin-web-server/server/build.gradle'.
All projects evaluated.
Selected primary task 'compileKotlin' from project :
Tasks to be executed: [task ':compileKotlin']
:compileKotlin (Thread[Task worker for ':',5,main]) started.
e: java.lang.ArrayIndexOutOfBoundsException


> Task :compileKotlin FAILED
file or directory '/Users/ishankhare/code/ishan/kotlin-web-server/server/src/main/kotlin', not found
file or directory '/Users/ishankhare/code/ishan/kotlin-web-server/server/src/main/java', not found
Task ':compileKotlin' is not up-to-date because:
  Task has failed previously.
All input files are considered out-of-date for incremental task ':compileKotlin'.
file or directory '/Users/ishankhare/code/ishan/kotlin-web-server/server/src/main/kotlin', not found
file or directory '/Users/ishankhare/code/ishan/kotlin-web-server/server/src/main/java', not found
file or directory '/Users/ishankhare/code/ishan/kotlin-web-server/server/src/main/kotlin', not found
file or directory '/Users/ishankhare/code/ishan/kotlin-web-server/server/src/main/java', not found
Using Kotlin incremental compilation
Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0], reportSeverity=2, requestedCompilationResults=[0]), areFileChangesKnown=false, modifiedFiles=null, deletedFiles=null, workingDir=/Users/ishankhare/code/ishan/kotlin-web-server/server/build/kotlin/compileKotlin, customCacheVersionFileName='gradle-format-version.txt', customCacheVersion=4, resultDifferenceFile=/Users/ishankhare/code/ishan/kotlin-web-server/server/build/kotlin/compileKotlin/build-history.bin, friendDifferenceFile=null, usePreciseJavaTracking=false)
[KOTLIN] deleting /Users/ishankhare/code/ishan/kotlin-web-server/server/build/classes/kotlin/main on error
[KOTLIN] deleting /Users/ishankhare/code/ishan/kotlin-web-server/server/build/classes/kotlin/main on error
:compileKotlin (Thread[Task worker for ':',5,main]) completed. Took 0.087 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileKotlin'.
> Internal compiler error. See log for more details

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

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 0s
1 actionable task: 1 executed