Library to use Kotlin Coroutines from Swift code in KMP apps

Overview

KMP-NativeCoroutines

A library to use Kotlin Coroutines from Swift code in KMP apps.

Flows

Kotlin

Create an extension property to expose the Flow as a NativeFlow to Swift:

val Clock.timeNative
    get() = time.asNativeFlow()

Swift Combine

Use the createPublisher(for:) function to get an AnyPublisher for the NativeFlow:

let publisher = createPublisher(for: clock.timeNative)

Suspend functions

Kotlin

Create an extension function to expose the suspend function as a NativeSuspend to Swift:

fun RandomLettersGenerator.getRandomLettersNative() =
    nativeSuspend { getRandomLetters() }

Swift Combine

Use the createFuture(for:) function to get an AnyPublisher for the NativeSuspend:

let future = createFuture(for: randomLettersGenerator.getRandomLettersNative())
Comments
  • Transform createdPublisher into SwiftUI's @Published

    Transform createdPublisher into SwiftUI's @Published

    I am wondering if and how I could transform a AnyPublisher to a @Published property. Let's say I have a property in my swift view model like @Published var isNetworkConnected: Bool which is defined as val isNetworkConnected: MutableStateFlow<Boolean> in my shared code repository. I now would like to do something like:

    self.isNetworkConnected = createPublisher(for: self.repository.isNetworkConnectedNative)
    

    Or even better, I would like to do something like this:

    Text(appViewModel.repository.connectivityStatus.isNetworkConnectedNative)
    

    Of course the variable should update automatically and take care of cancelling the publisher when the view is deleted by the SwiftUI framework. Is that somehow possible or could be achieved in the future? It would be a massive simplification when using KMM with SwiftUI as the biolerplate code in the view model would not be needed.

    opened by ln-12 18
  • Couple of issues with SPM

    Couple of issues with SPM

    Thanks for adding SPM support!

    It works great locally but fails on CI as the repo url seems to be only available with ssh:

    image Is it possible to support https as well which I think is what most packages do?

    The other thing I noticed is XCode always adds the RxSwift transitive dependency even when I've only added the KMPNativeCoroutinesCombine library. Not sure if there's anything you can do here as I see in the Package.swift you've only added the RxSwift dependency to the KMPNativeCoroutinesRxSwift target?

    opened by ychescale9 11
  • "Recursion detected in a lazy value" error

    I'm probably missing something in how I've set this up but when I try to update project here to use the library I'm getting exception below when building in XCode (using v13 Beta 3). I've pushed changes I made so far to https://github.com/joreilly/BikeShare/tree/async_stream (right now just trying KMPNativeCoroutinesCore but hoping to update then to use new AsyncStream stuff)

    This is my Podfile

    target 'BikeShare' do
        platform :ios, '13.0'
        pod 'common', :path => '../../common'
        pod "SwiftUIRefresh"
        pod 'KMPNativeCoroutinesCore'
    end
    

    and this is cocoapods config in build.gradle.kts

        cocoapods {
            // Configure fields required by CocoaPods.
            summary = "BikeShare common module"
            homepage = "homepage placeholder"
            ios.deploymentTarget = "13.0"
        }
    
    com.rickclephas.kmp.nativecoroutines.compiler.KmpNativeCoroutinesSyntheticResolveExtension.getSyntheticPropertiesNames(KmpNativeCoroutinesSyntheticResolveExtension.kt:60)
    	at org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension$Companion$getInstance$1.getSyntheticPropertiesNames(SyntheticResolveExtension.kt:58)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$_variableNames$2.invoke(LazyClassMemberScope.kt:127)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$_variableNames$2.invoke(LazyClassMemberScope.kt:124)
    	at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    	at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
    	at org.jetbrains.kotlin.storage.StorageKt.getValue(storage.kt:42)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.get_variableNames(LazyClassMemberScope.kt:124)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.getVariableNames(LazyClassMemberScope.kt:179)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$_allNames$2.invoke(LazyClassMemberScope.kt:167)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$_allNames$2.invoke(LazyClassMemberScope.kt:163)
    	at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    	at org.jetbrains.kotlin.storage.StorageKt.getValue(storage.kt:44)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.get_allNames(LazyClassMemberScope.kt:163)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.definitelyDoesNotContainName(LazyClassMemberScope.kt:184)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.mayFitForName(TowerResolver.kt:265)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.mayFitForName(TowerResolver.kt:258)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.processImplicitReceiver(TowerResolver.kt:230)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.run$processScope(TowerResolver.kt:198)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.run(TowerResolver.kt:209)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.run(TowerResolver.kt:99)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.runResolve(TowerResolver.kt:86)
    	at org.jetbrains.kotlin.resolve.calls.KotlinCallResolver.resolveCall(KotlinCallResolver.kt:75)
    	at org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver.runResolutionAndInference(PSICallResolver.kt:102)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.doResolveCallOrGetCachedResults(CallResolver.java:602)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.lambda$computeTasksAndResolveCall$0(CallResolver.java:213)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.computeTasksAndResolveCall(CallResolver.java:211)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.computeTasksAndResolveCall(CallResolver.java:199)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.resolveSimpleProperty(CallResolver.java:140)
    	at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getVariableType(CallExpressionResolver.kt:121)
    	at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getSimpleNameExpressionTypeInfo(CallExpressionResolver.kt:156)
    	at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getSimpleNameExpressionTypeInfo(CallExpressionResolver.kt:145)
    	at org.jetbrains.kotlin.types.expressions.BasicExpressionTypingVisitor.visitSimpleNameExpression(BasicExpressionTypingVisitor.java:172)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.visitSimpleNameExpression(ExpressionTypingVisitorDispatcher.java:333)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$ForDeclarations.visitSimpleNameExpression(ExpressionTypingVisitorDispatcher.java:46)
    	at org.jetbrains.kotlin.psi.KtNameReferenceExpression.accept(KtNameReferenceExpression.kt:59)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:175)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:164)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:134)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getTypeInfo(ExpressionTypingServices.java:125)
    	at org.jetbrains.kotlin.types.expressions.DoubleColonExpressionResolver.resolveExpressionOnLHS(DoubleColonExpressionResolver.kt:444)
    	at org.jetbrains.kotlin.types.expressions.DoubleColonExpressionResolver.access$resolveExpressionOnLHS(DoubleColonExpressionResolver.kt:89)
    	at org.jetbrains.kotlin.types.expressions.DoubleColonExpressionResolver$resolveDoubleColonLHS$resultForExpr$2.invoke(DoubleColonExpressionResolver.kt:351)
    	at org.jetbrains.kotlin.types.expressions.DoubleColonExpressionResolver$resolveDoubleColonLHS$resultForExpr$2.invoke(DoubleColonExpressionResolver.kt:351)
    	at org.jetbrains.kotlin.types.expressions.DoubleColonExpressionResolver.tryResolveLHS(DoubleColonExpressionResolver.kt:439)
    	at org.jetbrains.kotlin.types.expressions.DoubleColonExpressionResolver.resolveDoubleColonLHS$frontend(DoubleColonExpressionResolver.kt:351)
    	at org.jetbrains.kotlin.types.expressions.DoubleColonExpressionResolver.visitClassLiteralExpression(DoubleColonExpressionResolver.kt:115)
    	at org.jetbrains.kotlin.types.expressions.BasicExpressionTypingVisitor.visitClassLiteralExpression(BasicExpressionTypingVisitor.java:643)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.visitClassLiteralExpression(ExpressionTypingVisitorDispatcher.java:368)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$ForDeclarations.visitClassLiteralExpression(ExpressionTypingVisitorDispatcher.java:46)
    	at org.jetbrains.kotlin.psi.KtClassLiteralExpression.accept(KtClassLiteralExpression.kt:23)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:175)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:164)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:134)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getTypeInfo(ExpressionTypingServices.java:125)
    	at org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver.resolveValueArgument(PSICallResolver.kt:769)
    	at org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver.resolveArgumentsInParenthesis(PSICallResolver.kt:706)
    	at org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver.toKotlinCall(PSICallResolver.kt:584)
    	at org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver.runResolutionAndInferenceForGivenCandidates(PSICallResolver.kt:130)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.doResolveCallOrGetCachedResults(CallResolver.java:608)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.lambda$computeTasksFromCandidatesAndResolvedCall$1(CallResolver.java:237)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.computeTasksFromCandidatesAndResolvedCall(CallResolver.java:233)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.computeTasksFromCandidatesAndResolvedCall(CallResolver.java:223)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.resolveConstructorCall(CallResolver.java:421)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.resolveCallForConstructor(CallResolver.java:406)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.resolveFunctionCall(CallResolver.java:334)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.resolveFunctionCall(CallResolver.java:303)
    	at org.jetbrains.kotlin.resolve.AnnotationResolverImpl.resolveAnnotationCall(AnnotationResolverImpl.java:161)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor$allValueArguments$2.invoke(LazyAnnotations.kt:110)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor$allValueArguments$2.invoke(LazyAnnotations.kt:109)
    	at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    	at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
    	at org.jetbrains.kotlin.storage.StorageKt.getValue(storage.kt:42)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor.getAllValueArguments(LazyAnnotations.kt:109)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor.forceResolveAllContents(LazyAnnotations.kt:125)
    	at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.doForceResolveAllContents(ForceResolveUtil.java:78)
    	at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.forceResolveAllContents(ForceResolveUtil.java:69)
    	at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.createFunctionDescriptors(LazyTopDownAnalyzer.kt:286)
    	at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.analyzeDeclarations(LazyTopDownAnalyzer.kt:206)
    	at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.analyzeDeclarations$default(LazyTopDownAnalyzer.kt:58)
    	at org.jetbrains.kotlin.backend.konan.TopDownAnalyzerFacadeForKonan.analyzeFilesWithGivenTrace(TopDownAnalyzerFacadeForKonan.kt:94)
    	at org.jetbrains.kotlin.backend.konan.TopDownAnalyzerFacadeForKonan.analyzeFiles(TopDownAnalyzerFacadeForKonan.kt:67)
    	at org.jetbrains.kotlin.backend.konan.ToplevelPhasesKt$frontendPhase$1$1.invoke(ToplevelPhases.kt:86)
    	at org.jetbrains.kotlin.backend.konan.ToplevelPhasesKt$frontendPhase$1$1.invoke(ToplevelPhases.kt:85)
    	at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:112)
    	at org.jetbrains.kotlin.backend.konan.ToplevelPhasesKt$frontendPhase$1.invoke(ToplevelPhases.kt:85)
    	at org.jetbrains.kotlin.backend.konan.ToplevelPhasesKt$frontendPhase$1.invoke(ToplevelPhases.kt:79)
    	at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$namedOpUnitPhase$1.invoke(PhaseBuilders.kt:97)
    	at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$namedOpUnitPhase$1.invoke(PhaseBuilders.kt:95)
    	at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:94)
    	at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:23)
    	at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:94)
    	at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:41)
    	at org.jetbrains.kotlin.backend.konan.KonanDriverKt.runTopLevelPhases(KonanDriver.kt:29)
    	at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:78)
    	at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:35)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
    	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
    	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:76)
    	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:45)
    	at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:227)
    	at org.jetbrains.kotlin.cli.bc.K2Native$Companion$mainNoExitWithGradleRenderer$1.invoke(K2Native.kt:286)
    	at org.jetbrains.kotlin.cli.bc.K2Native$Companion$mainNoExitWithGradleRenderer$1.invoke(K2Native.kt:285)
    	at org.jetbrains.kotlin.util.UtilKt.profileIf(Util.kt:27)
    	at org.jetbrains.kotlin.util.UtilKt.profile(Util.kt:21)
    	at org.jetbrains.kotlin.cli.bc.K2Native$Companion.mainNoExitWithGradleRenderer(K2Native.kt:285)
    	at org.jetbrains.kotlin.cli.bc.K2NativeKt.mainNoExitWithGradleRenderer(K2Native.kt:485)
    	at org.jetbrains.kotlin.cli.utilities.MainKt$daemonMain$1.invoke(main.kt:62)
    	at org.jetbrains.kotlin.cli.utilities.MainKt$daemonMain$1.invoke(main.kt:62)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:17)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.daemonMain(main.kt:62)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    	at org.jetbrains.kotlin.compilerRunner.KotlinToolRunner.runInProcess(KotlinToolRunner.kt:124)
    	at org.jetbrains.kotlin.compilerRunner.KotlinToolRunner.run(KotlinToolRunner.kt:73)
    	at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinNativeCompile.compile(KotlinNativeTasks.kt:336)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
    	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
    	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
    	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:498)
    	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$3.execute(DefaultBuildOperationRunner.java:75)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
    	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
    	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
    	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:483)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:466)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:105)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:270)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:248)
    	at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:83)
    	at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:37)
    	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50)
    	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:47)
    	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$3.execute(DefaultBuildOperationRunner.java:75)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
    	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
    	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
    	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
    	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:47)
    	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:37)
    	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68)
    	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38)
    	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:50)
    	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36)
    	at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
    	at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
    	at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
    	at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
    	at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:29)
    	at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:54)
    	at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:35)
    	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:60)
    	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:27)
    	at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:174)
    	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:74)
    	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:45)
    	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:40)
    	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:29)
    	at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
    	at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
    	at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:99)
    	at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:92)
    	at java.base/java.util.Optional.map(Optional.java:258)
    	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)
    	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
    	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:84)
    	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:41)
    	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
    	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
    	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:91)
    	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
    	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:78)
    	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:49)
    	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:105)
    	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:50)
    	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:86)
    	at java.base/java.util.Optional.orElseGet(Optional.java:362)
    	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:86)
    	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:32)
    	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
    	at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
    	at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
    	at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:283)
    	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
    	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
    	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
    	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
    	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:49)
    	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:35)
    	at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:184)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
    	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
    	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
    	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
    	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
    	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
    	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
    	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
    	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
    	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    	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$3.execute(DefaultBuildOperationRunner.java:75)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
    	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
    	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
    	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
    	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
    	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
    	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:408)
    	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:395)
    	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:388)
    	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:374)
    	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
    	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
    	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
    	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
    	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
    	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    	at java.base/java.lang.Thread.run(Thread.java:832)
    Caused by: java.lang.AssertionError: Recursion detected in a lazy value under LockBasedStorageManager@73778406 (TopDownAnalyzer for Konan)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.get_allNames(LazyClassMemberScope.kt:163)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.definitelyDoesNotContainName(LazyClassMemberScope.kt:184)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.mayFitForName(TowerResolver.kt:265)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.mayFitForName(TowerResolver.kt:258)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.processImplicitReceiver(TowerResolver.kt:230)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.run$processScope(TowerResolver.kt:198)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.run(TowerResolver.kt:209)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.run(TowerResolver.kt:99)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.runResolve(TowerResolver.kt:86)
    	at org.jetbrains.kotlin.resolve.calls.KotlinCallResolver.resolveCall(KotlinCallResolver.kt:75)
    	at org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver.runResolutionAndInference(PSICallResolver.kt:102)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.doResolveCallOrGetCachedResults(CallResolver.java:602)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.lambda$computeTasksAndResolveCall$0(CallResolver.java:213)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.computeTasksAndResolveCall(CallResolver.java:211)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.computeTasksAndResolveCall(CallResolver.java:199)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.resolveFunctionCall(CallResolver.java:329)
    	at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getResolvedCallForFunction(CallExpressionResolver.kt:98)
    	at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getCallExpressionTypeInfoWithoutFinalTypeCheck(CallExpressionResolver.kt:220)
    	at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getCallExpressionTypeInfo(CallExpressionResolver.kt:197)
    	at org.jetbrains.kotlin.types.expressions.BasicExpressionTypingVisitor.visitCallExpression(BasicExpressionTypingVisitor.java:701)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.visitCallExpression(ExpressionTypingVisitorDispatcher.java:388)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$ForDeclarations.visitCallExpression(ExpressionTypingVisitorDispatcher.java:46)
    	at org.jetbrains.kotlin.psi.KtCallExpression.accept(KtCallExpression.java:35)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:175)
    	... 293 more
    
    
    FAILURE: Build failed with an exception.
    
    
    opened by joreilly 10
  • Compilation fails with NoSuchElementException for functions with generic parameters

    Compilation fails with NoSuchElementException for functions with generic parameters

    Hello 👋🏻 I got this error and it only happens when I try to run any test. here's the message:

    e: Compilation failed: Sequence contains no element matching the predicate.
     * Source files: *all files in commonTest are mentioned here*
     * Compiler version info: Konan: 1.5.20 / Kotlin: 1.5.20
     * Output kind: LIBRARY
    e: java.util.NoSuchElementException: Sequence contains no element matching the predicate.
    	at com.rickclephas.kmp.nativecoroutines.compiler.KmpNativeCoroutinesIrTransformer.visitFunctionNew(KmpNativeCoroutinesIrTransformer.kt:232)
    	at org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext.visitFunction(IrElementTransformerVoidWithContext.kt:68)
    	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:72)
    	at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:73)
    
    

    After some debugging, I finally found the one that triggers it: this file from Apollo GraphQL. I added it manually to my commonTest in my project.

    Based on the error message, is it because single in visitFunctionNew can't find any matching function? but if that's true, I'm not sure why it doesn't match.

    val originalFunction = declaration.parentAsClass.functions.single {
                it.name == originalName && it.isCoroutinesFunction && it.valueParameters.areSameAs(declaration.valueParameters)
            }
    
    opened by liauli 8
  • Implicit return type inside generic class with variance annotation causes recursion errors

    Implicit return type inside generic class with variance annotation causes recursion errors

    I'm using this commit to use that class in multiplatform and when I import your plug-in it gives me this error:

    e: org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (112,34) in StateMachine.kt
    
    Attachments:
    expression.kt
    mutableListOf<(T) -> Boolean>({ clazz.isInstance(it) })
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.logOrThrowException(ExpressionTypingVisitorDispatcher.java:253)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:224)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:164)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:134)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:146)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getTypeInfo(ExpressionTypingServices.java:120)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getTypeInfo(ExpressionTypingServices.java:95)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getType(ExpressionTypingServices.java:137)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.safeGetType(ExpressionTypingServices.java:80)
    	at org.jetbrains.kotlin.resolve.VariableTypeAndInitializerResolver.resolveInitializerType(VariableTypeAndInitializerResolver.kt:184)
    	at org.jetbrains.kotlin.resolve.VariableTypeAndInitializerResolver.access$resolveInitializerType(VariableTypeAndInitializerResolver.kt:27)
    	at org.jetbrains.kotlin.resolve.VariableTypeAndInitializerResolver$resolveTypeNullable$1.invoke(VariableTypeAndInitializerResolver.kt:92)
    	at org.jetbrains.kotlin.resolve.VariableTypeAndInitializerResolver$resolveTypeNullable$1.invoke(VariableTypeAndInitializerResolver.kt:85)
    	at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    	at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
    	at org.jetbrains.kotlin.types.DeferredType.getDelegate(DeferredType.java:106)
    	at org.jetbrains.kotlin.types.WrappedType.getConstructor(KotlinType.kt:127)
    	at org.jetbrains.kotlin.resolve.VarianceCheckerCore.checkTypePosition(VarianceChecker.kt:147)
    	at org.jetbrains.kotlin.resolve.VarianceCheckerCore.checkTypePosition(VarianceChecker.kt:144)
    	at org.jetbrains.kotlin.resolve.VarianceCheckerCore.checkCallableDeclaration(VarianceChecker.kt:122)
    	at org.jetbrains.kotlin.resolve.VarianceCheckerCore.recordPrivateToThisIfNeeded(VarianceChecker.kt:100)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.resolveUnknownVisibilitiesForMembers(LazyClassMemberScope.kt:405)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.getContributedVariables(LazyClassMemberScope.kt:396)
    	at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver$resolveToDescriptor$1.visitProperty(LazyDeclarationResolver.kt:182)
    	at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver$resolveToDescriptor$1.visitProperty(LazyDeclarationResolver.kt:94)
    	at org.jetbrains.kotlin.psi.KtProperty.accept(KtProperty.java:58)
    	at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver.resolveToDescriptor(LazyDeclarationResolver.kt:94)
    	at org.jetbrains.kotlin.resolve.lazy.LazyDeclarationResolver.resolveToDescriptor(LazyDeclarationResolver.kt:91)
    	at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.createPropertyDescriptors(LazyTopDownAnalyzer.kt:275)
    	at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.analyzeDeclarations(LazyTopDownAnalyzer.kt:208)
    	at org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer.analyzeDeclarations$default(LazyTopDownAnalyzer.kt:58)
    	at org.jetbrains.kotlin.backend.konan.TopDownAnalyzerFacadeForKonan.analyzeFilesWithGivenTrace(TopDownAnalyzerFacadeForKonan.kt:96)
    	at org.jetbrains.kotlin.backend.konan.TopDownAnalyzerFacadeForKonan.analyzeFiles(TopDownAnalyzerFacadeForKonan.kt:57)
    	at org.jetbrains.kotlin.backend.konan.KonanDriverKt$frontendPhase$1.invoke(KonanDriver.kt:54)
    	at org.jetbrains.kotlin.backend.konan.KonanDriverKt$frontendPhase$1.invoke(KonanDriver.kt:53)
    	at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:113)
    	at org.jetbrains.kotlin.backend.konan.KonanDriverKt.frontendPhase(KonanDriver.kt:53)
    	at org.jetbrains.kotlin.backend.konan.KonanDriverKt.runTopLevelPhases(KonanDriver.kt:31)
    	at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:81)
    	at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:37)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:92)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
    	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
    	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:76)
    	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:45)
    	at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:227)
    	at org.jetbrains.kotlin.cli.bc.K2Native$Companion$mainNoExitWithGradleRenderer$1.invoke(K2Native.kt:393)
    	at org.jetbrains.kotlin.cli.bc.K2Native$Companion$mainNoExitWithGradleRenderer$1.invoke(K2Native.kt:392)
    	at org.jetbrains.kotlin.util.UtilKt.profileIf(Util.kt:22)
    	at org.jetbrains.kotlin.util.UtilKt.profile(Util.kt:16)
    	at org.jetbrains.kotlin.cli.bc.K2Native$Companion.mainNoExitWithGradleRenderer(K2Native.kt:392)
    	at org.jetbrains.kotlin.cli.bc.K2NativeKt.mainNoExitWithGradleRenderer(K2Native.kt:634)
    	at org.jetbrains.kotlin.cli.utilities.MainKt$daemonMain$1.invoke(main.kt:62)
    	at org.jetbrains.kotlin.cli.utilities.MainKt$daemonMain$1.invoke(main.kt:62)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:17)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.daemonMain(main.kt:62)
    	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 org.jetbrains.kotlin.compilerRunner.KotlinToolRunner.runInProcess(KotlinToolRunner.kt:130)
    	at org.jetbrains.kotlin.compilerRunner.KotlinToolRunner.run(KotlinToolRunner.kt:77)
    	at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinNativeCompile.compile(KotlinNativeTasks.kt:366)
    	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 org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
    	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
    	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
    	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
    	at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:242)
    	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.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:227)
    	at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:210)
    	at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:193)
    	at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:171)
    	at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:89)
    	at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:40)
    	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:53)
    	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50)
    	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.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:50)
    	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:40)
    	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68)
    	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38)
    	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
    	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36)
    	at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
    	at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
    	at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
    	at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
    	at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:29)
    	at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:61)
    	at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:42)
    	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:60)
    	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:27)
    	at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:180)
    	at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:75)
    	at org.gradle.internal.Either$Right.fold(Either.java:175)
    	at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59)
    	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:73)
    	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:48)
    	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:36)
    	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:25)
    	at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
    	at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
    	at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:110)
    	at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:56)
    	at java.base/java.util.Optional.orElseGet(Optional.java:369)
    	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:56)
    	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
    	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:73)
    	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:44)
    	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
    	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
    	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:89)
    	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:50)
    	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:114)
    	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:57)
    	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:76)
    	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:50)
    	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.executeWithNoEmptySources(SkipEmptyWorkStep.java:249)
    	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.executeWithNoEmptySources(SkipEmptyWorkStep.java:204)
    	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:83)
    	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:54)
    	at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:32)
    	at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:21)
    	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
    	at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:43)
    	at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:31)
    	at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
    	at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:287)
    	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
    	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
    	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
    	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
    	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44)
    	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33)
    	at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:144)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:133)
    	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77)
    	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
    	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
    	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
    	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
    	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
    	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
    	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
    	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    	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.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
    	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
    	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:333)
    	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:320)
    	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:313)
    	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:299)
    	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:143)
    	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:227)
    	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:218)
    	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:140)
    	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    	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:834)
    Caused by: java.lang.reflect.InvocationTargetException
    	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 com.rickclephas.kmp.nativecoroutines.compiler.KmpNativeCoroutinesSyntheticResolveExtension.getDeclarations(KmpNativeCoroutinesSyntheticResolveExtension.kt:35)
    	at com.rickclephas.kmp.nativecoroutines.compiler.KmpNativeCoroutinesSyntheticResolveExtension.getDeclaredProperties(KmpNativeCoroutinesSyntheticResolveExtension.kt:60)
    	at com.rickclephas.kmp.nativecoroutines.compiler.KmpNativeCoroutinesSyntheticResolveExtension.getSyntheticPropertiesNames(KmpNativeCoroutinesSyntheticResolveExtension.kt:64)
    	at org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension$Companion$getInstance$1.getSyntheticPropertiesNames(SyntheticResolveExtension.kt:57)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$_variableNames$2.invoke(LazyClassMemberScope.kt:142)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$_variableNames$2.invoke(LazyClassMemberScope.kt:139)
    	at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    	at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
    	at org.jetbrains.kotlin.storage.StorageKt.getValue(storage.kt:42)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.get_variableNames(LazyClassMemberScope.kt:139)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.getVariableNames(LazyClassMemberScope.kt:194)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$_allNames$2.invoke(LazyClassMemberScope.kt:182)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$_allNames$2.invoke(LazyClassMemberScope.kt:178)
    	at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    	at org.jetbrains.kotlin.storage.StorageKt.getValue(storage.kt:44)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.get_allNames(LazyClassMemberScope.kt:178)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.definitelyDoesNotContainName(LazyClassMemberScope.kt:199)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.mayFitForName(TowerResolver.kt:265)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.mayFitForName(TowerResolver.kt:258)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.processImplicitReceiver(TowerResolver.kt:230)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.run$processScope(TowerResolver.kt:198)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.run(TowerResolver.kt:209)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.run(TowerResolver.kt:99)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.runResolve(TowerResolver.kt:86)
    	at org.jetbrains.kotlin.resolve.calls.KotlinCallResolver.resolveCall(KotlinCallResolver.kt:75)
    	at org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver.runResolutionAndInference(PSICallResolver.kt:101)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.doResolveCallOrGetCachedResults(CallResolver.java:601)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.lambda$computeTasksAndResolveCall$0(CallResolver.java:213)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.computeTasksAndResolveCall(CallResolver.java:211)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.computeTasksAndResolveCall(CallResolver.java:199)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.resolveFunctionCall(CallResolver.java:329)
    	at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getResolvedCallForFunction(CallExpressionResolver.kt:88)
    	at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getCallExpressionTypeInfoWithoutFinalTypeCheck(CallExpressionResolver.kt:210)
    	at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getCallExpressionTypeInfo(CallExpressionResolver.kt:187)
    	at org.jetbrains.kotlin.types.expressions.BasicExpressionTypingVisitor.visitCallExpression(BasicExpressionTypingVisitor.java:708)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.visitCallExpression(ExpressionTypingVisitorDispatcher.java:388)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$ForDeclarations.visitCallExpression(ExpressionTypingVisitorDispatcher.java:46)
    	at org.jetbrains.kotlin.psi.KtCallExpression.accept(KtCallExpression.java:35)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:175)
    	... 187 more
    Caused by: org.jetbrains.kotlin.util.ReenteringLazyValueComputationException
    
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':shared:compileKotlinIosX64'.
    > Compilation finished with errors
    
    

    code:

    class Matcher<T : Any, out R : T> private constructor(private val clazz: KClass<R>) {
    
            private val predicates = mutableListOf<(T) -> Boolean>({ clazz.isInstance(it) })
    
    

    If I remove your plugin it works (but then I wont get that nice generated code 😅). What could it be?

    opened by GuilhE 7
  • Native methods on interfaces or interface delegation?

    Native methods on interfaces or interface delegation?

    Hello, our Kotlin Multiplatform project is modularized, where one feature has at lest 2 gradle modules: an API module that contains the interfaces and data structures, and an Implementation module that contains the implementation details for the API module.

    Currently we are using Kotlin / Native wrappers akin to this:

    class FlowWrapper<T>(
        private val scope: CoroutineScope,
        private val flow: Flow<T>,
    ) {
        init {
            freeze()
        }
    
        fun subscribe(
            onEach: (item: T) -> Unit,
            onThrow: (error: Throwable) -> Unit,
        ): Job = subscribe(onEach, onThrow, {})
    
        fun subscribe(
            onEach: (item: T) -> Unit,
            onThrow: (error: Throwable) -> Unit,
            onComplete: () -> Unit,
        ): Job = flow
            .onEach { onEach(it.freeze()) }
            .catch { onThrow(it.freeze()) }
            .onCompletion { onComplete() }
            .launchIn(scope)
            .freeze()
    }
    

    link

    class GetTodoCountIos(
        private val getTodoCount: GetTodoCount
    ){
    
        fun invoke(): FlowWrapper<TodoCount> =
            FlowWrapper(
                scope = CoroutineScope(SupervisorJob() + Dispatchers.Main),
                flow = getTodoCount()
            )
    }
    

    Where GetTodoCount is an interface, and in swift this wrapper is used as getTodoCount: link

    getTodoCount.invoke().subscribe { count in
        if (count != nil){
            self.count = count as! TodoCount
        }
    } onThrow: { KotlinThrowable in
        
    }
    

    Removing the wrapper

    When trying this library out I was unable to use the interface abstraction on iOS. I removed the GetTodoCountIos wrapper and tried to use the interface directly: link

    let future = createPublisher(for: getTodoCount.invokeNative())
    
    let cancellable = future.sink { completion in
        print("Received completion: \(completion)")
    } receiveValue: { count in
        print("Received value: \(count)")
        if (count != nil){
            self.count = count as! TodoCount
        }
    }
    

    But it fails with the following error:

    2022-02-04 08:31:38.374976+0100 KaMPKitiOS[1700:34628] -[Shared_kobjcc0 invokeNative]: unrecognized selector sent to instance 0x60000194d290
    2022-02-04 08:31:38.419835+0100 KaMPKitiOS[1700:34628] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Shared_kobjcc0 invokeNative]: unrecognized selector sent to instance 0x60000194d290'
    

    It does generate the correct native function, but the function crashes the app:

    __attribute__((swift_name("GetTodoCount")))
    @protocol SharedGetTodoCount
    @required
    - (id<SharedFlow>)invoke __attribute__((swift_name("invoke()")));
    - (SharedKotlinUnit *(^(^)(SharedKotlinUnit *(^)(SharedTodoCount *, SharedKotlinUnit *), SharedKotlinUnit *(^)(NSError * _Nullable, SharedKotlinUnit *)))(void))invokeNative __attribute__((swift_name("invokeNative()")));
    @end;
    

    I'm not sure if this is caused by the fact that the interface does not know what the underlying implementation is or it is related to something else.

    Light weight wrapper by interface delegation

    Another solution I tried was using interface delegation, the wrapper is still written by hand but it's pretty concise and does not require updates when changing the interface: link

    class GetTodoCountIos(
        private val getTodoCount: GetTodoCount
    ) : GetTodoCount by getTodoCount
    

    link But it also fails, but with a different error:

    Terminating app due to uncaught exception 'NSGenericException', reason: '[SharedGetTodoCountIos invokeNative] can't be overridden: it is final'
    

    The generated header file:

    __attribute__((objc_subclassing_restricted))
    __attribute__((swift_name("GetTodoCountIos")))
    @interface SharedGetTodoCountIos : SharedBase <SharedGetTodoCount>
    - (instancetype)initWithGetTodoCount:(id<SharedGetTodoCount>)getTodoCount __attribute__((swift_name("init(getTodoCount:)"))) __attribute__((objc_designated_initializer));
    - (id<SharedFlow>)invoke __attribute__((swift_name("invoke()")));
    @end;
    

    Maybe it would be possible to extend it using an extension function?

    Normal wrapper

    The only solution that did not crash was creating the wrapper and calling the methods on the interface: link

    class GetTodoCountIos(
        private val getTodoCount: GetTodoCount
    ){
    
        fun invoke(): Flow<TodoCount> = getTodoCount()
    }
    

    With the following header:

    __attribute__((objc_subclassing_restricted))
    __attribute__((swift_name("GetTodoCountIos")))
    @interface SharedGetTodoCountIos : SharedBase
    - (instancetype)initWithGetTodoCount:(id<SharedGetTodoCount>)getTodoCount __attribute__((swift_name("init(getTodoCount:)"))) __attribute__((objc_designated_initializer));
    - (id<SharedFlow>)invoke __attribute__((swift_name("invoke()")));
    - (SharedKotlinUnit *(^(^)(SharedKotlinUnit *(^)(SharedTodoCount *, SharedKotlinUnit *), SharedKotlinUnit *(^)(NSError * _Nullable, SharedKotlinUnit *)))(void))invokeNative __attribute__((swift_name("invokeNative()")));
    @end;
    

    However this also didn't work as expected, because the flow is never collected (onEach, onComplete never called).

    The repository to reproduce this is available here:

    opened by AKJAW 7
  • Implicit return types combined with some annotations can cause recursion errors

    Implicit return types combined with some annotations can cause recursion errors

    👋 I facing with iOs building issue after integrating the KMP-Native coroutines library. Library version 0.8.0, kotlin 1.5.31

    Build stacktrace:stacktrace.txt NetworkProvider.kt:

    class NetworkProvider(val storage: SharedStorage) {
        val serverMode: ServerMode
            get() = getServerModeById(storage.serverMode)
    
        val client = HttpClient {
            expectSuccess = false
    
            install(Logging) {
                logger = object : Logger {
                    override fun log(message: String) {
                    }
                }
                level = LogLevel.ALL
            }
            install(JsonFeature) {
                serializer = KotlinxSerializer(json = kotlinx.serialization.json.Json {
                    isLenient = false
                    ignoreUnknownKeys = true
                    allowSpecialFloatingPointValues = true
                    useArrayPolymorphism = false
                })
            }
            HttpResponseValidator {
                handleResponseException { cause ->
                    throw cause
                }
                validateResponse { response ->
                    val statusCode = response.status.value
                    val originCall = response.call
                    if (statusCode < 300 || originCall.attributes.contains(ValidateMark)) {
                        return@validateResponse
                    }
    
                    val exceptionCall = originCall.save().apply {
                        attributes.put(ValidateMark, Unit)
                    }
    
                    val exceptionResponse = exceptionCall.response
                    val exceptionResponseText = exceptionResponse.readText()
    
                    when (statusCode) {
                        in 300..399 -> throw RedirectNetworkException(
                            exceptionResponse,
                            exceptionResponseText,
                            statusCode
                        )
                        in 400..499 -> throw ClientNetworkException(
                            exceptionResponse,
                            exceptionResponseText,
                            statusCode
                        )
                        in 500..599 -> throw ServerNetworkException(
                            exceptionResponse,
                            exceptionResponseText,
                            statusCode
                        )
                        else -> throw NetworkException(
                            exceptionResponse,
                            exceptionResponseText,
                            statusCode
                        )
                    }
                }
            }
        }
    
        fun HttpRequestBuilder.applyAppHeaders(): HeadersBuilder {
            return headers.apply {
                append(ApiConstantsShared.Api.CONSUMER_KEY_FIELD, serverMode.consumerKey)
                if ([email protected]()) {
                    append(ApiConstantsShared.Api.ACCESS_KEY_FIELD, storage.sessionKey)
                    append(
                        ApiConstantsShared.Api.COOKIE,
                        "${ApiConstantsShared.Api.SESSION_ID}=${storage.sessionKey}"
                    )
                }
            }
        }
    
        suspend inline fun <reified ResponseData> delete(
            path: String,
            parameters: List<Pair<String, String>> = emptyList()
        ): Response<ResponseData> {
            return try {
                Logger.DEFAULT.log(this.toString())
                val url = serverMode.baseUrl + "/" + path
    
                Logger.DEFAULT.log("Path: $url")
                Logger.DEFAULT.log("Parameters: $parameters")
    
                val response = client.delete<ResponseData>(url) {
                    parameters.forEach {
                        this.parameter(it.first, it.second)
                    }
                    headers { applyAppHeaders() }
                }
                Logger.DEFAULT.log("Response: $response")
                Response.Success(response)
            } catch (ex: Exception) {
                ex.message?.let { Logger.DEFAULT.log(it) }
                Response.Error(ex)
            }
        }
    
        suspend inline fun <reified ResponseData> getItem(
            path: String,
            parameters: List<Pair<String, String>> = emptyList()
        ): Response<ResponseData> {
            return try {
                Logger.DEFAULT.log(this.toString())
                val url = serverMode.baseUrl + "/" + path
    
                Logger.DEFAULT.log("Path: $url")
                Logger.DEFAULT.log("Parameters: $parameters")
    
                val response = client.get<ResponseData>(url) {
                    parameters.forEach {
                        this.parameter(it.first, it.second)
                    }
                    headers { applyAppHeaders() }
                }
                Logger.DEFAULT.log("Response: $response")
                Response.Success(response)
            } catch (ex: Exception) {
                ex.message?.let { Logger.DEFAULT.log(it) }
                Response.Error(ex)
            }
        }
    
        suspend inline fun <reified ResponseData, Body> postItem(
            path: String,
            parameters: List<Pair<String, String>> = emptyList(),
            body: Body? = null
        ): Response<ResponseData> {
            return try {
                Logger.DEFAULT.log(this.toString())
                val url = serverMode.baseUrl + "/" + path
    
                Logger.DEFAULT.log("Path: $url")
                Logger.DEFAULT.log("Parameters: $parameters")
                Logger.DEFAULT.log("Body: $body")
    
                val response = client.post<ResponseData>(url) {
                    headers { applyAppHeaders() }
                    if (parameters.isNotEmpty()) {
                        this.body = FormDataContent(
                            Parameters.build {
                                parameters.forEach {
                                    this.append(it.first, it.second)
                                }
                            }
                        )
                    } else if (body != null) {
                        header(HttpHeaders.ContentType, ContentType.Application.Json)
                        this.body = body
                    }
                }
                Logger.DEFAULT.log("Response: $response")
                return Response.Success(response)
            } catch (ex: Exception) {
                ex.message?.let { Logger.DEFAULT.log(it) }
                Response.Error(ex)
            }
        }
    
        @OptIn(InternalAPI::class)
        suspend inline fun <reified ResponseData, reified Body> uploadFiles(
            path: String,
            filesData: Map<String, ByteArray>,
            filesJsonData: Body
        ): Response<ResponseData> {
            return try {
                Logger.DEFAULT.log(this.toString())
                val url = serverMode.baseUrl + "/" + path
    
                Logger.DEFAULT.log("Path: $url")
                Logger.DEFAULT.log("FilesData: $filesJsonData")
    
                val response = client.post<ResponseData>(url) {
                    headers { applyAppHeaders() }
                    body = MultiPartFormDataContent(
                        formData {
                            filesData.entries.map { entry ->
                                this.append(
                                    key = entry.key,
                                    value = entry.value,
                                    headers = Headers.build {
                                        append(
                                            HttpHeaders.ContentDisposition,
                                            ApiConstantsShared.UploadImage.FILENAME +
                                                    entry.key +
                                                    ApiConstantsShared.UploadImage.IMAGE_EXT
                                        )
                                        append(
                                            HttpHeaders.ContentType,
                                            ApiConstantsShared.UploadImage.IMAGE_CONTENT_TYPE
                                        )
                                    }
                                )
                            }
                            this.append(
                                key = ApiConstantsShared.UploadImage.PARAM_UPDATE,
                                value = filesJsonData.convertToJsonString(),
                                headers = Headers.build {
                                    append(HttpHeaders.ContentType, ContentType.Application.Json)
                                }
                            )
                        }
                    )
                }
                Logger.DEFAULT.log("Response: $response")
                Response.Success(response)
            } catch (ex: Exception) {
                ex.printStackTrace()
                ex.message?.let { Logger.DEFAULT.log(it) }
                Response.Error(ex)
            }
        }
    
        inline fun <reified DataResponse> performDeleteApiMethod(
            path: String,
            params: List<Pair<String, String>> = listOf()
        ): Flow<Response<DataResponse>> {
            return flow {
                val data = [email protected]<DataResponse>(path, params)
                emit(data)
            }
        }
    
        inline fun <reified DataResponse> performApiMethod(
            path: String,
            params: List<Pair<String, String>> = listOf()
        ): Flow<Response<DataResponse>> {
            return flow {
                val data = [email protected]<DataResponse>(path, params)
                emit(data)
            }
        }
    
        inline fun <reified DataResponse, Body> performApiMethod(
            path: String,
            params: List<Pair<String, String>> = listOf(),
            body: Body? = null
        ): Flow<Response<DataResponse>> {
            return flow {
                val data = [email protected]<DataResponse, Body>(path, params, body)
                emit(data)
            }
        }
    
        inline fun <reified DataResponse, reified Body> performApiMethod(
            path: String,
            filesData: Map<String, ByteArray>,
            filesJsonData: Body
        ): Flow<Response<DataResponse>> {
            return flow {
                val data = [email protected]<DataResponse, Body>(
                    path,
                    filesData,
                    filesJsonData
                )
                emit(data)
            }
        }
    }
    
    opened by lomakk 7
  • commonMainMetadataElements variant missing since 0.12.0 (Kotlin 1.6.20)

    commonMainMetadataElements variant missing since 0.12.0 (Kotlin 1.6.20)

    I'm using this library for our shared library and having this following issue after upgrading to version 0.12.x (0.12.0, 0.12.1, 0.12.2 with Kotlin 1.6.21 and 0.12.3 with Kotlin 1.7.0). There is no issue with version 0.11.x. Do you have any idea?

    Execution failed for task ':KmpSdk:compileKotlinMetadata'.
    > Error while evaluating property 'filteredArgumentsMap' of task ':KmpSdk:compileKotlinMetadata'
       > Could not resolve all files for configuration ':KmpSdk:metadataCompileClasspath'.
          > Could not resolve com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0.
            Required by:
                project :KmpSdk
             > The consumer was configured to find a usage of 'kotlin-api' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common'. However we cannot choose between the following variants of com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0:
                 - iosArm64ApiElements-published
                 - iosSimulatorArm64ApiElements-published
                 - iosX64ApiElements-published
                 - jsIrApiElements-published
                 - jsLegacyApiElements-published
                 - jvmApiElements-published
                 - jvmRuntimeElements-published
                 - linuxX64ApiElements-published
                 - macosArm64ApiElements-published
                 - macosX64ApiElements-published
                 - mingwX64ApiElements-published
                 - tvosArm64ApiElements-published
                 - tvosSimulatorArm64ApiElements-published
                 - tvosX64ApiElements-published
                 - watchosArm32ApiElements-published
                 - watchosArm64ApiElements-published
                 - watchosSimulatorArm64ApiElements-published
                 - watchosX64ApiElements-published
               All of them match the consumer attributes:
                 - Variant 'iosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'ios_arm64' but the consumer didn't ask for it
                 - Variant 'iosSimulatorArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64' but the consumer didn't ask for it
                 - Variant 'iosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64' but the consumer didn't ask for it
                 - Variant 'jsIrApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                     - Unmatched attributes:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.js.compiler' with value 'ir' but the consumer didn't ask for it
                 - Variant 'jsLegacyApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                     - Unmatched attributes:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.js.compiler' with value 'legacy' but the consumer didn't ask for it
                 - Variant 'jvmApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares an API of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
                     - Unmatched attributes:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides its elements packaged as a jar but the consumer didn't ask for it
                         - Provides release status but the consumer didn't ask for it
                 - Variant 'jvmRuntimeElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a runtime of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
                     - Unmatched attributes:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides its elements packaged as a jar but the consumer didn't ask for it
                         - Provides release status but the consumer didn't ask for it
                 - Variant 'linuxX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'linux_x64' but the consumer didn't ask for it
                 - Variant 'macosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'macos_arm64' but the consumer didn't ask for it
                 - Variant 'macosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'macos_x64' but the consumer didn't ask for it
                 - Variant 'mingwX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'mingw_x64' but the consumer didn't ask for it
                 - Variant 'tvosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'tvos_arm64' but the consumer didn't ask for it
                 - Variant 'tvosSimulatorArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'tvos_simulator_arm64' but the consumer didn't ask for it
                 - Variant 'tvosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'tvos_x64' but the consumer didn't ask for it
                 - Variant 'watchosArm32ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_arm32' but the consumer didn't ask for it
                 - Variant 'watchosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_arm64' but the consumer didn't ask for it
                 - Variant 'watchosSimulatorArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_simulator_arm64' but the consumer didn't ask for it
                 - Variant 'watchosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_x64' but the consumer didn't ask for it
               The following variants were also considered but didn't match the requested attributes:
                 - Variant 'iosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'iosSimulatorArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'iosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'jsIrRuntimeElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                     - Incompatible because this component declares a usage of 'kotlin-runtime' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'jsLegacyRuntimeElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                     - Incompatible because this component declares a usage of 'kotlin-runtime' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'macosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'macosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'metadataApiElements' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'tvosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'tvosSimulatorArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'tvosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'watchosArm32MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'watchosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'watchosSimulatorArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'watchosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
          > Could not resolve com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0.
            Required by:
                project :KmpSdk
             > The consumer was configured to find a usage of 'kotlin-api' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common'. However we cannot choose between the following variants of com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0:
                 - iosArm64ApiElements-published
                 - iosSimulatorArm64ApiElements-published
                 - iosX64ApiElements-published
                 - jsIrApiElements-published
                 - jsLegacyApiElements-published
                 - jvmApiElements-published
                 - jvmRuntimeElements-published
                 - linuxX64ApiElements-published
                 - macosArm64ApiElements-published
                 - macosX64ApiElements-published
                 - mingwX64ApiElements-published
                 - tvosArm64ApiElements-published
                 - tvosSimulatorArm64ApiElements-published
                 - tvosX64ApiElements-published
                 - watchosArm32ApiElements-published
                 - watchosArm64ApiElements-published
                 - watchosSimulatorArm64ApiElements-published
                 - watchosX64ApiElements-published
               All of them match the consumer attributes:
                 - Variant 'iosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'ios_arm64' but the consumer didn't ask for it
                 - Variant 'iosSimulatorArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64' but the consumer didn't ask for it
                 - Variant 'iosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64' but the consumer didn't ask for it
                 - Variant 'jsIrApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                     - Unmatched attributes:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.js.compiler' with value 'ir' but the consumer didn't ask for it
                 - Variant 'jsLegacyApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                     - Unmatched attributes:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.js.compiler' with value 'legacy' but the consumer didn't ask for it
                 - Variant 'jvmApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares an API of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
                     - Unmatched attributes:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides its elements packaged as a jar but the consumer didn't ask for it
                         - Provides release status but the consumer didn't ask for it
                 - Variant 'jvmRuntimeElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a runtime of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
                     - Unmatched attributes:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides its elements packaged as a jar but the consumer didn't ask for it
                         - Provides release status but the consumer didn't ask for it
                 - Variant 'linuxX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'linux_x64' but the consumer didn't ask for it
                 - Variant 'macosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'macos_arm64' but the consumer didn't ask for it
                 - Variant 'macosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'macos_x64' but the consumer didn't ask for it
                 - Variant 'mingwX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'mingw_x64' but the consumer didn't ask for it
                 - Variant 'tvosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'tvos_arm64' but the consumer didn't ask for it
                 - Variant 'tvosSimulatorArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'tvos_simulator_arm64' but the consumer didn't ask for it
                 - Variant 'tvosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'tvos_x64' but the consumer didn't ask for it
                 - Variant 'watchosArm32ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_arm32' but the consumer didn't ask for it
                 - Variant 'watchosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_arm64' but the consumer didn't ask for it
                 - Variant 'watchosSimulatorArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_simulator_arm64' but the consumer didn't ask for it
                 - Variant 'watchosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Unmatched attributes:
                         - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                         - Provides release status but the consumer didn't ask for it
                         - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_x64' but the consumer didn't ask for it
               The following variants were also considered but didn't match the requested attributes:
                 - Variant 'iosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'iosSimulatorArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'iosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'jsIrRuntimeElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                     - Incompatible because this component declares a usage of 'kotlin-runtime' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'jsLegacyRuntimeElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                     - Incompatible because this component declares a usage of 'kotlin-runtime' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'macosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'macosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'metadataApiElements' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'tvosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'tvosSimulatorArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'tvosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'watchosArm32MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'watchosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'watchosSimulatorArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                 - Variant 'watchosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                     - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
    
    * 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.
    
    
    opened by baole 6
  • Migrate compiler plugin to KSP

    Migrate compiler plugin to KSP

    When the current compiler plugin was created KSP didn't support Kotlin/Native and a custom compiler plugin would allow us to modify classes instead of creating extension functions (which seemed a great idea at the time). However the current compiler plugin has some issues:

    • It can cause recursion errors since it uses non-public APIs to get the required information
      • #4
      • #5
      • #23
      • #27
      • #54
      • #55
    • It's currently incompatible with KSP
      • #50
    • Modifying the classes can cause some issues with inheritance and interface usages from Swift
      • #51
    • The compiler plugin is tied to a specific Kotlin version, so it requires a lot of maintenance
      • #30

    Using KSP would solve all these issues. The only downside being that we can no longer modify the classes and would need to generate extension properties/functions, which might not be exposed to ObjC/Swift in the same way.

    opened by rickclephas 6
  • Inferred Types Cause Crash

    Inferred Types Cause Crash

    I just started using the library and ran into a weird issue. If I have a property in my class that has an inferred type, the build crashes. Explicitly adding the type makes it work.

    I'm using version 0.11.3-new-mm with Kotlin 1.6.10

    For example I have a property in a User class of fullName that I defined like this.

        val fullName = when {
            firstName == null && lastName == null -> null
            firstName == null -> lastName
            lastName == null -> firstName
            else -> "$firstName $lastName"
        }
    

    If I try to build I get the following error.

    > Task :shared:compileKotlinIosX64 FAILED
    ERROR: Exception while analyzing expression at (41,9) in /Users/justin/AndroidStudioProjects/LitHangboard/shared/src/commonMain/kotlin/com/litclimbing/hangboard/model/User.kt
    
    Attachments:
    expression.kt
    firstName
    org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments: Exception while analyzing expression at (41,9) in /Users/justin/AndroidStudioProjects/LitHangboard/shared/src/commonMain/kotlin/com/litclimbing/hangboard/model/User.kt
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.logOrThrowException(ExpressionTypingVisitorDispatcher.java:246)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:224)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:164)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:134)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils.getTypeInfoOrNullType(ExpressionTypingUtils.java:166)
    	at org.jetbrains.kotlin.types.expressions.BasicExpressionTypingVisitor.visitEquality(BasicExpressionTypingVisitor.java:1148)
    	at org.jetbrains.kotlin.types.expressions.BasicExpressionTypingVisitor.visitBinaryExpression(BasicExpressionTypingVisitor.java:1078)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.visitBinaryExpression(ExpressionTypingVisitorDispatcher.java:403)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$ForDeclarations.visitBinaryExpression(ExpressionTypingVisitorDispatcher.java:46)
    	at org.jetbrains.kotlin.psi.KtBinaryExpression.accept(KtBinaryExpression.java:35)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:175)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:164)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:134)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils.getTypeInfoOrNullType(ExpressionTypingUtils.java:166)
    	at org.jetbrains.kotlin.types.expressions.BasicExpressionTypingVisitor.visitBooleanOperationExpression(BasicExpressionTypingVisitor.java:1244)
    	at org.jetbrains.kotlin.types.expressions.BasicExpressionTypingVisitor.visitBinaryExpression(BasicExpressionTypingVisitor.java:1091)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.visitBinaryExpression(ExpressionTypingVisitorDispatcher.java:403)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$ForDeclarations.visitBinaryExpression(ExpressionTypingVisitorDispatcher.java:46)
    	at org.jetbrains.kotlin.psi.KtBinaryExpression.accept(KtBinaryExpression.java:35)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:175)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:164)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:134)
    	at org.jetbrains.kotlin.types.expressions.PatternMatchingTypingVisitor.checkTypeForExpressionCondition(PatternMatchingTypingVisitor.kt:566)
    	at org.jetbrains.kotlin.types.expressions.PatternMatchingTypingVisitor.access$checkTypeForExpressionCondition(PatternMatchingTypingVisitor.kt:48)
    	at org.jetbrains.kotlin.types.expressions.PatternMatchingTypingVisitor$checkWhenCondition$1.visitWhenConditionWithExpression(PatternMatchingTypingVisitor.kt:546)
    	at org.jetbrains.kotlin.psi.KtVisitorVoid.visitWhenConditionWithExpression(KtVisitorVoid.java:1017)
    	at org.jetbrains.kotlin.psi.KtVisitorVoid.visitWhenConditionWithExpression(KtVisitorVoid.java:21)
    	at org.jetbrains.kotlin.psi.KtWhenConditionWithExpression.accept(KtWhenConditionWithExpression.java:36)
    	at org.jetbrains.kotlin.psi.KtElementImpl.accept(KtElementImpl.java:51)
    	at org.jetbrains.kotlin.types.expressions.PatternMatchingTypingVisitor.checkWhenCondition(PatternMatchingTypingVisitor.kt:493)
    	at org.jetbrains.kotlin.types.expressions.PatternMatchingTypingVisitor.analyzeWhenEntryConditions(PatternMatchingTypingVisitor.kt:475)
    	at org.jetbrains.kotlin.types.expressions.PatternMatchingTypingVisitor.analyzeConditionsInWhenEntries(PatternMatchingTypingVisitor.kt:346)
    	at org.jetbrains.kotlin.types.expressions.PatternMatchingTypingVisitor.visitWhenExpression(PatternMatchingTypingVisitor.kt:220)
    	at org.jetbrains.kotlin.types.expressions.PatternMatchingTypingVisitor.visitWhenExpression(PatternMatchingTypingVisitor.kt:88)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.visitWhenExpression(ExpressionTypingVisitorDispatcher.java:326)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$ForDeclarations.visitWhenExpression(ExpressionTypingVisitorDispatcher.java:46)
    	at org.jetbrains.kotlin.psi.KtWhenExpression.accept(KtWhenExpression.java:50)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:175)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:164)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:134)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisitorDispatcher.java:146)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getTypeInfo(ExpressionTypingServices.java:120)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getTypeInfo(ExpressionTypingServices.java:95)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.getType(ExpressionTypingServices.java:137)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingServices.safeGetType(ExpressionTypingServices.java:80)
    	at org.jetbrains.kotlin.resolve.VariableTypeAndInitializerResolver.resolveInitializerType(VariableTypeAndInitializerResolver.kt:184)
    	at org.jetbrains.kotlin.resolve.VariableTypeAndInitializerResolver.access$resolveInitializerType(VariableTypeAndInitializerResolver.kt:27)
    	at org.jetbrains.kotlin.resolve.VariableTypeAndInitializerResolver$resolveTypeNullable$1.invoke(VariableTypeAndInitializerResolver.kt:92)
    	at org.jetbrains.kotlin.resolve.VariableTypeAndInitializerResolver$resolveTypeNullable$1.invoke(VariableTypeAndInitializerResolver.kt:85)
    	at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    	at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
    	at org.jetbrains.kotlin.types.DeferredType.getDelegate(DeferredType.java:106)
    	at org.jetbrains.kotlin.types.WrappedType.getConstructor(KotlinType.kt:127)
    	at com.rickclephas.kmp.nativecoroutines.compiler.utils.FlowKt.isFlowType(Flow.kt:24)
    	at com.rickclephas.kmp.nativecoroutines.compiler.utils.FlowKt.getHasFlowType(Flow.kt:32)
    	at com.rickclephas.kmp.nativecoroutines.compiler.utils.CoroutinesPropertyKt.isCoroutinesProperty(CoroutinesProperty.kt:8)
    	at com.rickclephas.kmp.nativecoroutines.compiler.utils.CoroutinesPropertyKt.getNeedsNativeProperty(CoroutinesProperty.kt:14)
    	at com.rickclephas.kmp.nativecoroutines.compiler.KmpNativeCoroutinesSyntheticResolveExtension.getSyntheticPropertiesNames(KmpNativeCoroutinesSyntheticResolveExtension.kt:65)
    =====REMOVED SECTION=====
    Caused by: java.lang.AssertionError: Recursion detected in a lazy value under LockBasedStorageManager@5dc0fce (TopDownAnalyzer for Konan)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.get_allNames(LazyClassMemberScope.kt:178)
    	at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.definitelyDoesNotContainName(LazyClassMemberScope.kt:199)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.mayFitForName(TowerResolver.kt:265)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.mayFitForName(TowerResolver.kt:258)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.processImplicitReceiver(TowerResolver.kt:230)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.run$processScope(TowerResolver.kt:198)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.run(TowerResolver.kt:209)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.run(TowerResolver.kt:99)
    	at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.runResolve(TowerResolver.kt:86)
    	at org.jetbrains.kotlin.resolve.calls.KotlinCallResolver.resolveCall(KotlinCallResolver.kt:75)
    	at org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver.runResolutionAndInference(PSICallResolver.kt:101)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.doResolveCallOrGetCachedResults(CallResolver.java:601)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.lambda$computeTasksAndResolveCall$0(CallResolver.java:213)
    	at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.computeTasksAndResolveCall(CallResolver.java:211)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.computeTasksAndResolveCall(CallResolver.java:199)
    	at org.jetbrains.kotlin.resolve.calls.CallResolver.resolveSimpleProperty(CallResolver.java:140)
    	at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getVariableType(CallExpressionResolver.kt:111)
    	at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getSimpleNameExpressionTypeInfo(CallExpressionResolver.kt:146)
    	at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getSimpleNameExpressionTypeInfo(CallExpressionResolver.kt:135)
    	at org.jetbrains.kotlin.types.expressions.BasicExpressionTypingVisitor.visitSimpleNameExpression(BasicExpressionTypingVisitor.java:172)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.visitSimpleNameExpression(ExpressionTypingVisitorDispatcher.java:333)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$ForDeclarations.visitSimpleNameExpression(ExpressionTypingVisitorDispatcher.java:46)
    	at org.jetbrains.kotlin.psi.KtNameReferenceExpression.accept(KtNameReferenceExpression.kt:59)
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:175)
    	... 310 more
    e: Compilation failed: Exception while analyzing expression at (41,9) in /Users/justin/AndroidStudioProjects/LitHangboard/shared/src/commonMain/kotlin/com/litclimbing/hangboard/model/User.kt
    
    FAILURE: Build failed with an exception.
    

    If I instead change it to the following (adding the String? type), everything works as expected.

        val fullName: String? = when {
            firstName == null && lastName == null -> null
            firstName == null -> lastName
            lastName == null -> firstName
            else -> "$firstName $lastName"
        }
    
    
    opened by litclimbing 6
  • Exception in KmpNativeCoroutinesSyntheticResolveExtension.getDeclarations

    Exception in KmpNativeCoroutinesSyntheticResolveExtension.getDeclarations

    Hello, thanks for that great library.

    After updating the library version to 0.10.0-new-mm, I got a compilation issue. During compilation when it faces @OptIn(ExperimentalTime::class) annotation in my code it throws ClassCastException.

    Stacktrace:

    Caused by: java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.util.Set (java.util.ArrayList and java.util.Set are in module java.base of loader 'bootstrap')
       at com.rickclephas.kmp.nativecoroutines.compiler.KmpNativeCoroutinesSyntheticResolveExtension.getDeclarations(KmpNativeCoroutinesSyntheticResolveExtension.kt:33)
       at com.rickclephas.kmp.nativecoroutines.compiler.KmpNativeCoroutinesSyntheticResolveExtension.getDeclaredProperties(KmpNativeCoroutinesSyntheticResolveExtension.kt:54)
       at com.rickclephas.kmp.nativecoroutines.compiler.KmpNativeCoroutinesSyntheticResolveExtension.getSyntheticPropertiesNames(KmpNativeCoroutinesSyntheticResolveExtension.kt:58)
       at org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension$Companion$getInstance$1.getSyntheticPropertiesNames(SyntheticResolveExtension.kt:57)
       at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$_variableNames$2.invoke(LazyClassMemberScope.kt:127)
       at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$_variableNames$2.invoke(LazyClassMemberScope.kt:124)
       at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
       at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
       at org.jetbrains.kotlin.storage.StorageKt.getValue(storage.kt:42)
       at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.get_variableNames(LazyClassMemberScope.kt:124)
       at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.getVariableNames(LazyClassMemberScope.kt:179)
       at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$_allNames$2.invoke(LazyClassMemberScope.kt:167)
       at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope$_allNames$2.invoke(LazyClassMemberScope.kt:163)
       at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
       at org.jetbrains.kotlin.storage.StorageKt.getValue(storage.kt:44)
       at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.get_allNames(LazyClassMemberScope.kt:163)
       at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassMemberScope.definitelyDoesNotContainName(LazyClassMemberScope.kt:184)
       at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.mayFitForName(TowerResolver.kt:265)
       at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.mayFitForName(TowerResolver.kt:258)
       at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.processImplicitReceiver(TowerResolver.kt:230)
       at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.run$processScope(TowerResolver.kt:198)
       at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver$Task.run(TowerResolver.kt:209)
       at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.run(TowerResolver.kt:99)
       at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.runResolve(TowerResolver.kt:86)
       at org.jetbrains.kotlin.resolve.calls.KotlinCallResolver.resolveCall(KotlinCallResolver.kt:75)
       at org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver.runResolutionAndInference(PSICallResolver.kt:101)
       at org.jetbrains.kotlin.resolve.calls.CallResolver.doResolveCallOrGetCachedResults(CallResolver.java:601)
       at org.jetbrains.kotlin.resolve.calls.CallResolver.lambda$computeTasksAndResolveCall$0(CallResolver.java:213)
       at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:101)
       at org.jetbrains.kotlin.resolve.calls.CallResolver.computeTasksAndResolveCall(CallResolver.java:211)
       at org.jetbrains.kotlin.resolve.calls.CallResolver.computeTasksAndResolveCall(CallResolver.java:199)
       at org.jetbrains.kotlin.resolve.calls.CallResolver.resolveSimpleProperty(CallResolver.java:140)
       at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getVariableType(CallExpressionResolver.kt:111)
       at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getSimpleNameExpressionTypeInfo(CallExpressionResolver.kt:146)
       at org.jetbrains.kotlin.resolve.calls.CallExpressionResolver.getSimpleNameExpressionTypeInfo(CallExpressionResolver.kt:135)
       at org.jetbrains.kotlin.types.expressions.BasicExpressionTypingVisitor.visitSimpleNameExpression(BasicExpressionTypingVisitor.java:172)
       at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.visitSimpleNameExpression(ExpressionTypingVisitorDispatcher.java:333)
       at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher$ForDeclarations.visitSimpleNameExpression(ExpressionTypingVisitorDispatcher.java:46)
       at org.jetbrains.kotlin.psi.KtNameReferenceExpression.accept(KtNameReferenceExpression.kt:59)
       at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.lambda$getTypeInfo$0(ExpressionTypingVisitorDispatcher.java:175)
       ... 212 more
    

    Kotlin version: 1.6.10.

    opened by ultraon 6
  • Non-embeddable compiler JAR compilations are broken in v1.0

    Non-embeddable compiler JAR compilations are broken in v1.0

    Projects with the following gradle property

    kotlin.native.useEmbeddableCompilerJar=false
    

    fail to build in the kspKotlin tasks with

    e: java.lang.IllegalStateException: The provided plugin com.google.devtools.ksp.KotlinSymbolProcessingComponentRegistrar is not compatible with this version of compiler
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$cli(KotlinCoreEnvironment.kt:664)
    	...
    Caused by: java.lang.AbstractMethodError: Receiver class com.google.devtools.ksp.KotlinSymbolProcessingComponentRegistrar does not define or inherit an implementation of the resolved method 'abstract void registerProjectComponents(com.intellij.mock.MockProject, org.jetbrains.kotlin.config.CompilerConfiguration)' of interface org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar.
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$cli(KotlinCoreEnvironment.kt:656)
    

    Caused by https://github.com/google/ksp/issues/1155

    opened by rickclephas 0
  • [WIP] JS Support

    [WIP] JS Support

    Work toward https://github.com/rickclephas/KMP-NativeCoroutines/issues/17

    Let's get JS support working in here!

    To Extract into Separate PRs

    • [x] migrate to atomicfu: https://github.com/rickclephas/KMP-NativeCoroutines/pull/44
    • [x] intermediate sourceset: https://github.com/rickclephas/KMP-NativeCoroutines/pull/45
    • [x] make nativeCoroutines JS-friendly
      • [x] migrate tests to kotlinx-coroutines-test: https://github.com/rickclephas/KMP-NativeCoroutines/pull/46
      • [x] Move Apple-specific tests into appleTest https://github.com/rickclephas/KMP-NativeCoroutines/commit/213f541f0abc18f3acdb9d1b76f21ce0da49afea
      • [x] Rename test functions to support all possible targets https://github.com/rickclephas/KMP-NativeCoroutines/commit/53fa62fa37c5e05d9988f5ce907c11b1c0cdb8ed)
    • [x] include JS target in nativeCoroutines sourceset https://github.com/rickclephas/KMP-NativeCoroutines/pull/48
    • [ ] define default CoroutineScope for JS target
    • [ ] add sample app with regular JS/TS consumer
    • [ ] update compiler plugin to generate correct native functions/properties
      • [ ] split config options into apple and js blocks
      • [ ] allow different suffix for Apple and JS

    Open Questions

    • [ ] do we need to add @JsExport? or are the typealiases fine if we just @JsExport the entire class in commonMain? Though we get warnings for this if it has a public suspend fun…
    • [ ] should the defaultCoroutineScope be different on JS than Native?

    Done in this PR (will be separated into separate PRs)

    Main Code

    • [x] create supportedTarget as a sourceset between common and apple/js
    • [x] created a cross-platform expect fun for freeze()
    • [x] created PlatformError as an expect class
      • exposed as NSError on Apple and Throwable on JS
      • create an internal kotlinCause extension that we that we can use instead of digging into userInfo so the tests work on non-Apple platforms

    Tests

    • [x] switch from Kotlin/Native AtomicInt to atomicfu AtomicInt (extracted to this PR: )
    • [x] copied tests from appleTest into supportedTargetTest
      • [x] convert from fun `test method with spaces()` to fun test_method_with_underscores() because JS doesn't support spaces (even with backticks)
      • [x] removed freezing-related tests from supportedTargetTest

    Remaining

    • [ ] figure out how to properly migrate from runBlocking to runTest (from kotlinx-coroutines-test)
      • [x] Tests in supportedTargetTest are passing in JS
      • [ ] Tests in supportedTargetTest are currently getting InvalidMutabilityExceptions on Native
      • [ ] delete overlapping tests from AppleNative____ tests and only leave freezing ones in there
    • [ ] update KSP to generate the additional methods on the JS platform
    opened by ankushg 2
  • Add support for Swift to Kotlin cases

    Add support for Swift to Kotlin cases

    Currently the whole library is focused on Kotlin to Swift cases but there are also valid cases for Swift to Kotlin support.

    For example you should be able to call the following function from Swift:

    suspend fun doSomething(something: suspend (String) -> String): String = TODO()
    

    https://kotlinlang.slack.com/archives/C3PQML5NU/p1644904527044239

    opened by rickclephas 1
Releases(v1.0.0-ALPHA-4)
  • v1.0.0-ALPHA-4(Dec 29, 2022)

  • v0.13.3(Dec 28, 2022)

  • v1.0.0-ALPHA-3(Dec 21, 2022)

  • v1.0.0-ALPHA-2(Dec 10, 2022)

  • v1.0.0-ALPHA-1(Nov 19, 2022)

    Note: checkout the updated README and migration steps.

    KSP

    • The plugin is now using KSP to generate code (#71)

    Kotlin

    • Updated Kotlin to 1.8.0-Beta
    • The signatures of NativeSuspend and NativeFlow have changed (#49)
    • Native declarations are now annotated with @ObjCName dropping the Native suffix from the ObjC/Swift name (#74)
    • The NativeValue and NativeReplayCache properties have been renamed to Value and ReplayCache (#74)

    Swift Concurrency

    • The signatures of NativeSuspend and NativeFlow have changed (#49)
    • Renamed asyncStream(for:) to asyncSequence(for:) (#49)
    • asyncSequence(for:) now returns an AsyncSequence instead of an AsyncStream (#49)
    • A CancellationError will be thrown instead of a KotlinCancellationException (#49)
    • asyncSequence(for:) now applies back pressure to the Flow collection (#49)

    Combine

    • The signatures of NativeSuspend and NativeFlow have changed (#49)

    RxSwift

    • The signatures of NativeSuspend and NativeFlow have changed (#49)
    Source code(tar.gz)
    Source code(zip)
  • v0.13.2(Nov 9, 2022)

  • v0.13.1(Sep 29, 2022)

  • v0.13.0(Sep 21, 2022)

    Kotlin

    • Updated kotlinx.coroutines to 1.6.4
    • Breaking: dropped support for the old memory manager and -native-mt versions of kotlinx.coroutines

    Combine

    • Fixed concurrency issue (#75)

    RxSwift

    • Fixed SPM platform versions (#76). Thanks @shepeliev!
    Source code(tar.gz)
    Source code(zip)
  • v0.12.6(Jul 9, 2022)

  • v0.12.5(Jun 25, 2022)

  • v0.12.4(Jun 17, 2022)

  • v0.12.3(Jun 9, 2022)

  • v0.12.2(Apr 20, 2022)

  • v0.12.1(Apr 5, 2022)

  • v0.12.0(Apr 4, 2022)

  • v0.11.4(Apr 3, 2022)

  • v0.11.3(Feb 13, 2022)

  • v0.11.2(Feb 5, 2022)

  • v0.11.1(Dec 22, 2021)

  • v0.11.0(Dec 22, 2021)

  • v0.10.1(Dec 20, 2021)

  • v0.10.0(Dec 17, 2021)

    Swift Async/Await

    • KMPNativeCoroutinesAsync is now part of the regular release (#21)

    Kotlin

    • Updated to Kotlin 1.6.10
    • Published compatibility version for Kotlin 1.6.0 (version 0.10.0-kotlin-1.6.0)
    • Published preview version for kotlinx.coroutines 1.6.0-RC3 (version 0.10.0-new-mm)
    Source code(tar.gz)
    Source code(zip)
  • v0.9.0(Nov 19, 2021)

    Kotlin

    • Updated to Kotlin 1.6.0
    • Added support for the embeddable compiler jar
    • The core and annotations libraries are now also available for the mingwX64 target
    • Published compatibility version for the new Kotlin Native memory model (version 0.9.0-new-mm)
    • Dropped Kotlin 1.5.20 compatibility version
    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Nov 5, 2021)

    Gradle plugin

    • The core and annotations libraries are now also available for js and linuxX64 targets. Allowing you to use the plugin in KMP projects that use these targets.
    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Oct 31, 2021)

    Swift Async/Await

    • KMPNativeCoroutinesAsync is now available via the Swift Package Manager (#11)
    • With Xcode 13.2 Beta the async implementation can now be used on iOS 13, macOS 10.15, tvOS 13 and watchOS 6 or newer

    Core

    • KMPNativeCoroutinesCore is now available via the Swift Package Manager (#11)

    Combine

    • KMPNativeCoroutinesCombine is now available via the Swift Package Manager (#11)

    RxSwift

    • KMPNativeCoroutinesRxSwift is now available via the Swift Package Manager (#11)
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Sep 5, 2021)

    Core

    • Updated to Kotlin 1.5.30
    • Published compatibility version for Kotlin 1.5.20 (version 0.6.0-kotlin-1.5.20)
    • Added support for tvOS and watchOS
    • Added support for Apple Silicon (#9)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Aug 14, 2021)

    Gradle plugin

    • Added support for generic functions (#8)
    • Added NativeCoroutinesIgnore annotation

    Core

    • Dropped Kotlin 1.5.10 compatibility version
    Source code(tar.gz)
    Source code(zip)
  • v0.4.3(Aug 7, 2021)

  • v0.4.2(Jul 21, 2021)

  • v0.4.1(Jul 17, 2021)

Owner
Rick Clephas
Rick Clephas
🍭 GithubSearchKMM - Github Repos Search - Android - iOS - Kotlin Multiplatform Mobile using Jetpack Compose, SwiftUI, FlowRedux, Coroutines Flow, Dagger Hilt, Koin Dependency Injection, shared KMP ViewModel, Clean Architecture

GithubSearchKMM Github Repos Search - Kotlin Multiplatform Mobile using Jetpack Compose, SwiftUI, FlowRedux, Coroutines Flow, Dagger Hilt, Koin Depend

Petrus Nguyễn Thái Học 50 Jan 7, 2023
Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in Kotlin with Jetpack Compose and a backed in Kotlin hosted on AppEngine.

Conferences4Hall Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in K

Gérard Paligot 98 Dec 15, 2022
Swift-friendly api generator for Kotlin/Native frameworks

MOKO KSwift KSwift it's gradle plugin for generation Swift-friendly API for Kotlin/Native framework. Kotlin sealed interface/class to Swift enum Kotli

IceRock Development 226 Dec 28, 2022
Kotlin and Java API for generating .swift source files.

SwiftPoet SwiftPoet is a Kotlin and Java API for generating .swift source files. Source file generation can be useful when doing things such as annota

Outfox 232 Jan 2, 2023
KmMScientists is a Kotlin multiplatform app with swift ui, jetpack compose, koin and realm

KmMScientists KmMScientists is a Kotlin multiplatform app built with swift ui, jetpack compose, koin and realm. Whats Shared? Local Data Persistence w

Kashif Mehmood 20 Dec 27, 2022
Kotlin Multiplatform (KMP) library for reading resources in tests

kotlinx-resources Kotlin Multiplatform (KMP) plugin and library that add support for reading resources in tests. The plugin and a library work in tand

Gonçalo Silva 29 Dec 27, 2022
Kotlinx-murmurhash - Kotlin Multiplatform (KMP) library for hashing using MurmurHash

kotlinx-murmurhash Kotlin Multiplatform (KMP) library for MurmurHash, a non-cryp

Gonçalo Silva 23 Dec 27, 2022
KMP library for string unicode normalization

doistx-normalize Kotlin Multiplatform (KMP) library that adds support for normalization as described by Unicode Standard Annex #15 - Unicode Normaliza

Doist 31 Nov 22, 2022
Kamper - a small KMM/KMP library that provides performance monitoring for your app.

?? Kamper Kamper is a KMP/KMM library that implements a unified way to track application performances. The solution is based on plugin design patterns

S. Mellouk 31 Jun 10, 2022
KaMP Kit is to facilitate your evaluation of Kotlin Multiplatform (aka KMP)

KaMP Kit Welcome to the KaMP Kit! About Goal The goal of the KaMP Kit is to facilitate your evaluation of Kotlin Multiplatform (aka KMP). It is a coll

bas 0 Oct 25, 2021
Recycler-coroutines - RecyclerView Auto Add Data Using Coroutines

Sample RecyclerView Auto Add With Coroutine Colaborator Very open to anyone, I'l

Faisal Amir 8 Dec 1, 2022
Android project setup files when developing apps from scratch. The codebase uses lates jetpack libraries and MVVM repository architecture for setting up high performance apps

Android architecture app Includes the following Android Respository architecture MVVM Jepack libraries Carousel view Kotlin Kotlin Flow and Livedata P

null 2 Mar 31, 2022
Example code from coroutines testing talk.

Coroutines Testing This repo contains example code used to build my (Bill Phillips) talk on coroutines testing. Use it however you please, but note so

Bill Phillips 3 Nov 17, 2022
Boilerplate code for implementing MVVM in Android using Jetpack libraries, coroutines, dependency injection and local persistance

MVVM Foundation This projects aims to speed up development of Android apps by providing a solid base to extend Libraries Jetpack Fragment Material3 :

Gabriel Gonzalez 2 Nov 10, 2022
An tool to help developer to use Retrofit elegantly while using kotlinx.coroutines.

one An tool to help developer to use Retrofit elegantly while using kotlinx.coroutines. Feature Transform different data structs to one. {errorCode, d

ChengTao 30 Dec 27, 2022
The KPy gradle plugin allows you to write Kotlin/Native code and use it from python.

The KPy gradle plugin allows you to write Kotlin/Native code and use it from python.

Martmists 14 Dec 26, 2022
A Kotlin Android library for content provider queries with reactive streams and coroutines.

Pickpocket An Android library for content provider queries with reactive streams and coroutines. Calendar Contacts SMS MMS Files/Media Call Log Bookma

Chris Basinger 27 Nov 14, 2022
Android Library for requesting Permissions with Kotlin Coroutines or AndroidX LiveData

PEKO PErmissions with KOtlin Android Permissions with Kotlin Coroutines or LiveData No more callbacks, builders, listeners or verbose code for request

Marko Devcic 133 Dec 14, 2022