touchlab / SKIE

SKIE - Swift Kotlin Interface Enhancer
https://skie.touchlab.co/
Apache License 2.0
745 stars 8 forks source link

Can't call NativeCompilerDownloader in SKIE 0.8.0 #83

Closed chrisbanes closed 5 months ago

chrisbanes commented 5 months ago

I see that SKIE 0.8.0 is now using reflection to call KGP APIs, but it seems that this is completely breaking our usage.

What is the problem?

Caused by: java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.gradle.utils.NativeCompilerDownloader.<init>(org.gradle.api.Project, java.lang.String, int, kotlin.jvm.internal.DefaultConstructorMarker)'
    at co.touchlab.skie.plugin.shim.ActualKgpShim.getKonanHome(ActualKgpShim.kt:45)
    at co.touchlab.skie.plugin.coroutines.ConfigureMinOsVersionsKt.getDistributionProperties(ConfigureMinOsVersions.kt:35)
    at co.touchlab.skie.plugin.coroutines.ConfigureMinOsVersionsKt.access$getDistributionProperties(ConfigureMinOsVersions.kt:1)
    at co.touchlab.skie.plugin.coroutines.ConfigureMinOsVersionsKt$configureMinOsVersionIfNeeded$1.invoke(ConfigureMinOsVersions.kt:17)
    at co.touchlab.skie.plugin.coroutines.ConfigureMinOsVersionsKt$configureMinOsVersionIfNeeded$1.invoke(ConfigureMinOsVersions.kt:12)
    at co.touchlab.skie.plugin.shim.LaunchSchedulerImpl$whenMinOsVersionCanBeSafelyChanged$1.invokeSuspend(LaunchSchedulerImpl.kt:13)
    at co.touchlab.skie.plugin.shim.LaunchSchedulerImpl$whenMinOsVersionCanBeSafelyChanged$1.invoke(LaunchSchedulerImpl.kt)
    at co.touchlab.skie.plugin.shim.LaunchSchedulerImpl$whenMinOsVersionCanBeSafelyChanged$1.invoke(LaunchSchedulerImpl.kt)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleKt$launchInRequiredStage$1$1.invokeSuspend(KotlinPluginLifecycle.kt:100)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleStageRestriction$interceptContinuation$1.resumeWith(KotlinPluginLifecycleStageRestriction.kt:57)
    at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleStageRestrictionKt.withRestrictedStages(KotlinPluginLifecycleStageRestriction.kt:35)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleKt.requiredStage(KotlinPluginLifecycle.kt:210)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleKt$launchInRequiredStage$1.invokeSuspend(KotlinPluginLifecycle.kt:99)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleKt$launchInRequiredStage$1.invoke(KotlinPluginLifecycle.kt)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleKt$launchInRequiredStage$1.invoke(KotlinPluginLifecycle.kt)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleKt$launchInStage$1.invokeSuspend(KotlinPluginLifecycle.kt:78)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlin.coroutines.SafeContinuation.resumeWith(SafeContinuationJvm.kt:41)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleImpl$await$2$1.invoke(KotlinPluginLifecycleImpl.kt:180)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleImpl$await$2$1.invoke(KotlinPluginLifecycleImpl.kt:179)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleImpl.loopIfNecessary(KotlinPluginLifecycleImpl.kt:106)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleImpl.executeCurrentStageAndScheduleNext(KotlinPluginLifecycleImpl.kt:83)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleImpl.access$executeCurrentStageAndScheduleNext(KotlinPluginLifecycleImpl.kt:23)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleImpl$executeCurrentStageAndScheduleNext$3.execute(KotlinPluginLifecycleImpl.kt:95)
    at org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycleImpl$executeCurrentStageAndScheduleNext$3.execute(KotlinPluginLifecycleImpl.kt:94)
    at org.gradle.internal.code.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:122)
    at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction$1.run(DefaultListenerBuildOperationDecorator.java:173)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    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.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction.execute(DefaultListenerBuildOperationDecorator.java:170)
    at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:99)
    at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:87)
    at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:43)
    at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:268)
    at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:170)
    at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:148)
    at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
    at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
    at jdk.proxy1/jdk.proxy1.$Proxy57.afterEvaluate(Unknown Source)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate$1.execute(LifecycleProjectEvaluator.java:247)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate$1.execute(LifecycleProjectEvaluator.java:244)
    at org.gradle.api.internal.project.DefaultProject.stepEvaluationListener(DefaultProject.java:1492)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate.run(LifecycleProjectEvaluator.java:253)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    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.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.lambda$run$0(LifecycleProjectEvaluator.java:114)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$1(DefaultProjectStateRegistry.java:407)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$fromMutableState$2(DefaultProjectStateRegistry.java:430)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withReplacedLocks(DefaultWorkerLeaseService.java:360)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:430)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:406)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:100)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    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.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:72)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:785)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:155)
    at org.gradle.api.internal.project.ProjectLifecycleController.lambda$ensureSelfConfigured$2(ProjectLifecycleController.java:84)
    at org.gradle.internal.model.StateTransitionController.lambda$doTransition$14(StateTransitionController.java:255)
    at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:266)
    at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:254)
    at org.gradle.internal.model.StateTransitionController.lambda$maybeTransitionIfNotCurrentlyTransitioning$10(StateTransitionController.java:199)
    at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:34)
    at org.gradle.internal.model.StateTransitionController.maybeTransitionIfNotCurrentlyTransitioning(StateTransitionController.java:195)
    at org.gradle.api.internal.project.ProjectLifecycleController.ensureSelfConfigured(ProjectLifecycleController.java:84)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.ensureConfigured(DefaultProjectStateRegistry.java:381)
    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:34)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:50)
    at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:42)
    at org.gradle.configuration.BuildTreePreparingProjectsPreparer.prepareProjects(BuildTreePreparingProjectsPreparer.java:65)
    at org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild.run(BuildOperationFiringProjectsPreparer.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    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.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.configuration.BuildOperationFiringProjectsPreparer.prepareProjects(BuildOperationFiringProjectsPreparer.java:40)
    at org.gradle.initialization.VintageBuildModelController.lambda$prepareProjects$2(VintageBuildModelController.java:84)
    at org.gradle.internal.model.StateTransitionController.lambda$doTransition$14(StateTransitionController.java:255)
    at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:266)
    at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:254)
    at org.gradle.internal.model.StateTransitionController.lambda$transitionIfNotPreviously$11(StateTransitionController.java:213)
    at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:34)
    at org.gradle.internal.model.StateTransitionController.transitionIfNotPreviously(StateTransitionController.java:209)
    at org.gradle.initialization.VintageBuildModelController.prepareProjects(VintageBuildModelController.java:84)
    at org.gradle.initialization.VintageBuildModelController.getConfiguredModel(VintageBuildModelController.java:64)
    at org.gradle.internal.build.DefaultBuildLifecycleController.lambda$withProjectsConfigured$1(DefaultBuildLifecycleController.java:133)
    at org.gradle.internal.model.StateTransitionController.lambda$notInState$3(StateTransitionController.java:132)
    at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:44)
    at org.gradle.internal.model.StateTransitionController.notInState(StateTransitionController.java:128)
    at org.gradle.internal.build.DefaultBuildLifecycleController.withProjectsConfigured(DefaultBuildLifecycleController.java:133)
    at org.gradle.internal.build.DefaultBuildToolingModelController.locateBuilderForTarget(DefaultBuildToolingModelController.java:58)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildTreeModelController.lambda$locateBuilderForTarget$0(DefaultBuildTreeModelCreator.java:64)
    at org.gradle.internal.build.DefaultBuildLifecycleController.withToolingModels(DefaultBuildLifecycleController.java:327)
    at org.gradle.internal.build.AbstractBuildState.withToolingModels(AbstractBuildState.java:146)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildTreeModelController.locateBuilderForTarget(DefaultBuildTreeModelCreator.java:64)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator$DefaultBuildTreeModelController.locateBuilderForDefaultTarget(DefaultBuildTreeModelCreator.java:59)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getTarget(DefaultBuildController.java:136)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getModel(DefaultBuildController.java:107)
    at org.gradle.tooling.internal.consumer.connection.ParameterAwareBuildControllerAdapter.getModel(ParameterAwareBuildControllerAdapter.java:39)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.getModel(UnparameterizedBuildController.java:113)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.getModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:97)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:81)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:66)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.lambda$onExecuteStart$3(ProjectImportAction.java:136)
    at com.intellij.gradle.toolingExtension.impl.telemetry.GradleOpenTelemetry.callWithSpan(GradleOpenTelemetry.java:73)
    at com.intellij.gradle.toolingExtension.impl.telemetry.GradleOpenTelemetry.callWithSpan(GradleOpenTelemetry.java:61)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.onExecuteStart(ProjectImportAction.java:135)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.lambda$execute$0(ProjectImportAction.java:108)
    at com.intellij.gradle.toolingExtension.impl.telemetry.GradleOpenTelemetry.lambda$runWithSpan$1(GradleOpenTelemetry.java:87)
    at com.intellij.gradle.toolingExtension.impl.telemetry.GradleOpenTelemetry.callWithSpan(GradleOpenTelemetry.java:73)
    at com.intellij.gradle.toolingExtension.impl.telemetry.GradleOpenTelemetry.callWithSpan(GradleOpenTelemetry.java:61)
    at com.intellij.gradle.toolingExtension.impl.telemetry.GradleOpenTelemetry.runWithSpan(GradleOpenTelemetry.java:86)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:108)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:43)
    at org.gradle.tooling.internal.consumer.connection.InternalBuildActionAdapter.execute(InternalBuildActionAdapter.java:64)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.runAction(AbstractClientProvidedBuildActionRunner.java:131)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.beforeTasks(AbstractClientProvidedBuildActionRunner.java:99)
    at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator.beforeTasks(DefaultBuildTreeModelCreator.java:43)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$fromBuildModel$2(DefaultBuildTreeLifecycleController.java:83)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$runBuild$4(DefaultBuildTreeLifecycleController.java:120)
    at org.gradle.internal.model.StateTransitionController.lambda$transition$6(StateTransitionController.java:169)
    at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:266)
    at org.gradle.internal.model.StateTransitionController.lambda$transition$7(StateTransitionController.java:169)
    at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:44)
    at org.gradle.internal.model.StateTransitionController.transition(StateTransitionController.java:169)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.runBuild(DefaultBuildTreeLifecycleController.java:117)
    at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.fromBuildModel(DefaultBuildTreeLifecycleController.java:82)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner.runClientAction(AbstractClientProvidedBuildActionRunner.java:43)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:53)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.internal.buildtree.ProblemReportingBuildActionRunner.run(ProblemReportingBuildActionRunner.java:49)
    at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:65)
    at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:140)
    at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
    at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.lambda$execute$0(RootBuildLifecycleBuildActionExecutor.java:40)
    at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:123)
    at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.execute(RootBuildLifecycleBuildActionExecutor.java:40)
    at org.gradle.internal.buildtree.InitDeprecationLoggingActionExecutor.execute(InitDeprecationLoggingActionExecutor.java:66)
    at org.gradle.internal.buildtree.InitProblems.execute(InitProblems.java:36)
    at org.gradle.internal.buildtree.DefaultBuildTreeContext.execute(DefaultBuildTreeContext.java:40)
    at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.lambda$execute$0(BuildTreeLifecycleBuildActionExecutor.java:71)
    at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:60)
    at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.execute(BuildTreeLifecycleBuildActionExecutor.java:71)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:61)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:57)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
    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.launcher.exec.RunAsBuildOperationBuildActionExecutor.execute(RunAsBuildOperationBuildActionExecutor.java:57)
    at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.lambda$execute$0(RunAsWorkerThreadBuildActionExecutor.java:36)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:264)
    at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:128)
    at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.execute(RunAsWorkerThreadBuildActionExecutor.java:36)
    at org.gradle.tooling.internal.provider.continuous.ContinuousBuildActionExecutor.execute(ContinuousBuildActionExecutor.java:110)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecutor.execute(SubscribableBuildActionExecutor.java:64)
    at org.gradle.internal.session.DefaultBuildSessionContext.execute(DefaultBuildSessionContext.java:46)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:92)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:80)
    at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:71)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:62)
    at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:41)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:51)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:39)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
    at org.gradle.util.internal.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:64)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)

When does the problem occur?

Any Gradle task

How do we reproduce the issue?

Honestly, I don't really know. We use some convention plugins to apply a bunch of KGP, CMP and Skie settings. I've tried clearing out the entire Gradle cache, turning off configuration cache, etc.

What has changed since the last time SKIE worked in your project?

Updating to Kotlin 2.0.0 and SKIE 0.8.0

TadeasKriz commented 5 months ago

Hey @chrisbanes, thanks for the report. Can you check if you by any change have skie.kgpVersion in your gradle.properties? And if not, could you try adding skie.kgpVersion=2.0.0 and try if the problem goes away?

In the meantime I'll try to reproduce it in our tests. We actually don't use reflection to call these APIs (unless we missed something), but we did have to change how we call them to get SKIE working with Gradle Configuration Cache.

chrisbanes commented 5 months ago

We don't have skie.kgpVersion in our properties, but setting skie.kgpVersion=2.0.0 does workaround the issue šŸ¤”

TadeasKriz commented 5 months ago

That seems like SKIE can't automatically determine your Kotlin Gradle plugin version. Could you check if perhaps you have an old Kotlin version left somewhere that happened during upgrading?

chrisbanes commented 5 months ago

Everything is controlled via libs.versions.toml + our convention plugins so there's no chance of that happening šŸ¤”.

I'll try with --debug as it looks like you have some logging for this. (side note: should that be a info or higher severity? it seems more serious than debug).

TadeasKriz commented 5 months ago

So it should actually error out if it can't find the version. In this case it seems like it's finding a wrong version, which shouldn't happen.

The reason why it's debug and not info because we look at the project of module you applied SKIE to and if that doesn't resolve, we go and look at rootProject. So it'd show warnings (or infos) for folks who it resolved the version properly from rootProject. What do you think?

TadeasKriz commented 5 months ago

@chrisbanes Do you use includeBuild in your project? And you mentioned you use convention plugins, could you share how you configure version for kotlin("multiplatform") in those plugins? (usually you need to add implementation dependency to buildSrc/build-logic buildscript).

chrisbanes commented 5 months ago

Do you use includeBuild in your project?

Yes, exactly

could you share how you configure version for kotlin("multiplatform") in those plugins? (usually you need to add implementation dependency to buildSrc/build-logic buildscript).

We add a compileOnly dependency onto org.jetbrains.kotlin:kotlin-gradle-plugin in the convention plugin. In the main project, we then use alias(libs.plugins.kotlin.multiplatform) apply false in the main build.gradle.kts to add KGP to the classpath.

Our KMP convention plugin calls pluginManager.apply("org.jetbrains.kotlin.multiplatform") to hook it all up for each module.

TadeasKriz commented 5 months ago

Thanks, that's good info. And for the compileOnly dependency, what version do you give it? Or do you use the same libs with the same version ref?

chrisbanes commented 5 months ago

It's all defined in a libs.versions.toml. We use the alias from the main project, and the library from the convention plugin:

[versions]
kotlin = "2.0.0"

[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }

[libraries]
kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
TadeasKriz commented 5 months ago

Thanks, I'll try to reproduce it and possibly ask more questions if I can't.

TadeasKriz commented 5 months ago

No luck so far. What version of Gradle are you using? And could you share more about how you apply SKIE Gradle plugin?

And could you share the message SKIE prints when running with --debug (without the skie.kgpVersion override)? It should be starting with the "SKIE could not determine the Kotlin Gradle plugin version directly from Kotlin Gradle plugin because ..". Thanks!

FilipDolnik commented 5 months ago

Hi! We added some additional debug logging in 0.8.1. Can you please try this version with --debug and send us all lines that contain [SKIE] (you can filter them using grep).

chrisbanes commented 5 months ago

Here's the log. It seems to be finding Kotlin 1.9.22 from the classpath, but I have no idea how it's finding that.

log2.txt

FilipDolnik commented 5 months ago

Try running the :shared:app:dependencies Gradle task it should print out the content of the classpath configuration which might give us more insight.

chrisbanes commented 5 months ago

I'm seeing a lot of: org.jetbrains.kotlin:kotlin-stdlib:1.9.2X -> 2.0.0 (*)

Is this a timing issue? Is SKIE checking the classpath before Ivy has fully resolved the dependencies?

FilipDolnik commented 5 months ago

I don't think it can be a timing issue (doesn't necessarily mean it isn't :D). SKIE looks for the org.jetbrains.kotlin:kotlin-gradle-plugin artifact in the resolved classpath configuration. (After resolution the configuration content cannot change.) Do you see a similar version upgrade in the case of org.jetbrains.kotlin:kotlin-gradle-plugin?

chrisbanes commented 5 months ago

I don't see org.jetbrains.kotlin:kotlin-gradle-plugin anywhere in the classpath šŸ¤”. I've even tried manually adding KGP to the module (before my convention plugin), and still nothing.

FilipDolnik commented 5 months ago

Oh, sorry I gave you a wrong task. The correct one should be :shared:app:buildEnvironment.

chrisbanes commented 5 months ago

Ah thanks! Found the issue. co.touchlab.crashkios.crashlyticslink seems to have a hard dependency on KPG 1.9.22.

classpath
+--- co.touchlab.crashkios.crashlyticslink:co.touchlab.crashkios.crashlyticslink.gradle.plugin:0.8.6
|    \--- co.touchlab.crashkios:crashlytics-ios-link:0.8.6
|         +--- org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22
|         |    +--- org.jetbrains.kotlin:kotlin-gradle-plugins-bom:1.9.22
|         |    |    +--- org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.9.22 (c)
|         |    |    +--- org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.9.22 (c)
|         |    |    +--- org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22 (c)
|         |    |    +--- org.jetbrains.kotlin:kotlin-gradle-plugin-annotations:1.9.22 (c)
|         |    |    +--- org.jetbrains.kotlin:kotlin-native-utils:1.9.22 (c)
|         |    |    \--- org.jetbrains.kotlin:kotlin-tooling-core:1.9.22 (c)
|         |    +--- org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.9.22
|         |    |    +--- org.jetbrains.kotlin:kotlin-gradle-plugins-bom:1.9.22 (*)
|         |    |    +--- org.jetbrains.kotlin:kotlin-gradle-plugin-annotations:1.9.22
|         |    |    +--- org.jetbrains.kotlin:kotlin-native-utils:1.9.22
|         |    |    |    +--- org.jetbrains.kotlin:kotlin-util-io:1.9.22
|         |    |    |    \--- org.jetbrains.kotlin:kotlin-util-klib:1.9.22
|         |    |    |         \--- org.jetbrains.kotlin:kotlin-util-io:1.9.22
|         |    |    +--- org.jetbrains.kotlin:kotlin-project-model:1.9.22
|         |    |    |    \--- org.jetbrains.kotlin:kotlin-tooling-core:1.9.22
|         |    |    \--- org.jetbrains.kotlin:kotlin-tooling-core:1.9.22
|         |    +--- org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.9.22
|         |    |    +--- org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.9.22 (*)
|         |    |    \--- org.jetbrains.kotlin:kotlin-gradle-plugins-bom:1.9.22 (*)
|         |    +--- org.jetbrains.kotlin:kotlin-gradle-plugin-idea:1.9.22
|         |    |    +--- org.jetbrains.kotlin:kotlin-tooling-core:1.9.22
|         |    |    \--- org.jetbrains.kotlin:kotlin-gradle-plugin-annotations:1.9.22
|         |    +--- org.jetbrains.kotlin:kotlin-gradle-plugin-idea-proto:1.9.22
|         |    |    \--- org.jetbrains.kotlin:kotlin-gradle-plugin-idea:1.9.22 (*)
|         |    +--- org.jetbrains.kotlin:kotlin-util-klib:1.9.22 (*)
|         |    +--- org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.9.22
|         |    |    \--- org.jetbrains.kotlin:kotlin-native-utils:1.9.22 (*)
|         |    +--- org.jetbrains.kotlin:kotlin-build-tools-api:1.9.22
|         |    +--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.22
|         |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.22
|         |    |    |    \--- org.jetbrains:annotations:13.0
|         |    |    +--- org.jetbrains.kotlin:kotlin-script-runtime:1.9.22
|         |    |    +--- org.jetbrains.kotlin:kotlin-reflect:1.6.10 -> 1.9.22
|         |    |    +--- org.jetbrains.kotlin:kotlin-daemon-embeddable:1.9.22
|         |    |    \--- org.jetbrains.intellij.deps:trove4j:1.0.20200330
|         |    +--- org.jetbrains.kotlin:kotlin-android-extensions:1.9.22
|         |    |    \--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.22 (*)
|         |    +--- org.jetbrains.kotlin:kotlin-compiler-runner:1.9.22
|         |    |    +--- org.jetbrains.kotlin:kotlin-daemon-client:1.9.22
|         |    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0
|         |    |    \--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.22 (*)
|         |    +--- org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.9.22
|         |    |    \--- org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.9.22
|         |    |         +--- org.jetbrains.kotlin:kotlin-scripting-common:1.9.22
|         |    |         \--- org.jetbrains.kotlin:kotlin-scripting-jvm:1.9.22
|         |    |              \--- org.jetbrains.kotlin:kotlin-scripting-common:1.9.22
|         |    \--- org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.9.22 (*)
|         \--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.22 (*)
+--- org.jetbrains.kotlin:kotlin-stdlib:{strictly 1.9.22} -> 1.9.22 (c)
+--- org.jetbrains.kotlin:kotlin-reflect:{strictly 1.9.22} -> 1.9.22 (c)
\--- org.jetbrains:annotations:{strictly 13.0} -> 13.0 (c)
FilipDolnik commented 5 months ago

Funny that it's caused by one of our libraries :D It should have compileOnly dependency on KGP.

However, it's also a bug in the SKIE version resolution because the KGP version used by your Gradle script is different in the end. I'll try to reproduce the issue locally.

FilipDolnik commented 5 months ago

Fixed in 0.8.2.