没有任何TODO的Kotlin未实现错误

nhjlsmyf  于 2023-02-16  发布在  Kotlin
关注(0)|答案(1)|浏览(84)

我的kotlin项目抛出kotlin.NotImplementedErrorExecution failed for task ':app:compileDebugKotlin'。它不包含任何TODO。
完整堆栈跟踪-
kotlin.NotImplementedError: An operation is not implemented: Not yet implemented at org.jetbrains.kotlin.ir.descriptors.IrBasedFieldDescriptor.getContextReceiverParameters(IrBasedDescriptors.kt:1067) at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.renderProperty(DescriptorRendererImpl.kt:936) at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.access$renderProperty(DescriptorRendererImpl.kt:32) at org.jetbrains.kotlin.renderer.DescriptorRendererImpl$RenderDeclarationDescriptorVisitor.visitPropertyDescriptor(DescriptorRendererImpl.kt:1126) at org.jetbrains.kotlin.renderer.DescriptorRendererImpl$RenderDeclarationDescriptorVisitor.visitPropertyDescriptor(DescriptorRendererImpl.kt:1116) at org.jetbrains.kotlin.ir.descriptors.IrBasedFieldDescriptor.accept(IrBasedDescriptors.kt:1073) at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.render(DescriptorRendererImpl.kt:601) at org.jetbrains.kotlin.resolve.MemberComparator.compare(MemberComparator.java:221) at org.jetbrains.kotlin.resolve.MemberComparator.compare(MemberComparator.java:35) at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) at java.base/java.util.TimSort.sort(TimSort.java:220) at java.base/java.util.Arrays.sort(Arrays.java:1441) at kotlin.collections.ArraysKt___ArraysJvmKt.sortWith(_ArraysJvm.kt:2557) at kotlin.collections.CollectionsKt___CollectionsKt.sortedWith(_Collections.kt:1075) at org.jetbrains.kotlin.resolve.jvm.diagnostics.KtDefaultJvmErrorMessages$CONFLICTING_JVM_DECLARATIONS_DATA$1.invoke(JvmBackendErrors.kt:49) at org.jetbrains.kotlin.resolve.jvm.diagnostics.KtDefaultJvmErrorMessages$CONFLICTING_JVM_DECLARATIONS_DATA$1.invoke(JvmBackendErrors.kt:45) at org.jetbrains.kotlin.diagnostics.rendering.DiagnosticParameterRendererKt$Renderer$1.render(DiagnosticParameterRenderer.kt:30) at org.jetbrains.kotlin.diagnostics.rendering.ContextIndependentParameterRenderer$DefaultImpls.render(DiagnosticParameterRenderer.kt:24) at org.jetbrains.kotlin.diagnostics.rendering.DiagnosticParameterRendererKt$Renderer$1.render(DiagnosticParameterRenderer.kt:29) at org.jetbrains.kotlin.diagnostics.rendering.DiagnosticParameterRendererKt.renderParameter(DiagnosticParameterRenderer.kt:38) at org.jetbrains.kotlin.diagnostics.KtDiagnosticWithParameters1Renderer.renderParameters(KtDiagnosticRenderer.kt:48) at org.jetbrains.kotlin.diagnostics.AbstractKtDiagnosticWithParametersRenderer.render(KtDiagnosticRenderer.kt:36) at org.jetbrains.kotlin.cli.common.fir.FirDiagnosticsCompilerResultsReporter.reportDiagnosticToMessageCollector(FirDiagnosticsCompilerResultsReporter.kt:101) at org.jetbrains.kotlin.cli.common.fir.FirDiagnosticsCompilerResultsReporter.access$reportDiagnosticToMessageCollector(FirDiagnosticsCompilerResultsReporter.kt:19) at org.jetbrains.kotlin.cli.common.fir.FirDiagnosticsCompilerResultsReporter$reportToMessageCollector$1.invoke(FirDiagnosticsCompilerResultsReporter.kt:26) at org.jetbrains.kotlin.cli.common.fir.FirDiagnosticsCompilerResultsReporter$reportToMessageCollector$1.invoke(FirDiagnosticsCompilerResultsReporter.kt:19) at org.jetbrains.kotlin.cli.common.fir.FirDiagnosticsCompilerResultsReporter.reportByFile(FirDiagnosticsCompilerResultsReporter.kt:68) at org.jetbrains.kotlin.cli.common.fir.FirDiagnosticsCompilerResultsReporter.reportToMessageCollector(FirDiagnosticsCompilerResultsReporter.kt:25) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.runCodegen(KotlinToJVMBytecodeCompiler.kt:375) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:134) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:58) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:158) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:53) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:99) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:47) at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101) at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:475) at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:125) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:373) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally$default(IncrementalCompilerRunner.kt:318) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.rebuild(IncrementalCompilerRunner.kt:114) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:207) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:79) at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:625) at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:101) at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1746) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) 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:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)
并且,
Caused by: org.gradle.api.GradleException: Internal compiler error. See log for more details at org.jetbrains.kotlin.gradle.tasks.TasksUtilsKt.throwGradleExceptionIfError(tasksUtils.kt:23) at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.run(GradleKotlinCompilerWork.kt:129) at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction.execute(GradleCompilerRunnerWithWorkers.kt:79) at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63) at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66) at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62) at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100) at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62) at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44) at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41) at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59) at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$2(DefaultWorkerExecutor.java:205) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162) at org.gradle.internal.Factories$1.create(Factories.java:31) at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249) at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109) at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:114) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)
我尝试了:

  • 清洁和重建
  • 使缓存失效并重新启动
  • 注解掉最新添加的代码
  • 在Android Studio中修复IDE
  • 删除项目并再次从github加载

但这些都解决不了。
项目-github

7vux5j2d

7vux5j2d1#

结果,是因为我

lateinit var clientConfig: ClientConfig

两次...作为类ClientService内的全局变量以及同一类中的伴随对象,Android Studio无法指出这一点。

相关问题