Kotlin: 1.3.40
Coroutines: 1.2.2
Gradle: 5.4.1
After upgrading Kotlin and coroutines we receive the following error in Xcode for our ios build:
__attribute__((swift_name("KotlinCoroutineContext")))
@protocol SharedCodeKotlinCoroutineContext
@required
- (id _Nullable)foldInitial:(id _Nullable)initial operation:(id _Nullable (^)(id _Nullable, id<SharedCodeKotlinCoroutineContextElement>))operation __attribute__((swift_name("fold(initial:operation:)")));
- (id<SharedCodeKotlinCoroutineContextElement> _Nullable)getKey:(id<SharedCodeKotlinCoroutineContextKey>)key __attribute__((swift_name("get(key:)")));
- (id<SharedCodeKotlinCoroutineContext>)minusKeyKey:(id<SharedCodeKotlinCoroutineContextKey>)key __attribute__((swift_name("minusKey(key:)")));
- (id<SharedCodeKotlinCoroutineContext>)plusContext:(id<SharedCodeKotlinCoroutineContext>)context __attribute__((swift_name("plus(context:)")));
@end;
Cannot find protocol declaration for 'SharedCodeKotlinCoroutineContextElement'; did you mean 'SharedCodeKotlinCoroutineContextKey'?
I have the same issue.
Because there's a circular dependency between KotlinCoroutineContext and KotlinCoroutineContextElement there needs to be a forward declaration of the KotlinCoroutineContextElement at the top of the header file, like:
@protocol SharedCodeKotlinCoroutineContextElement;
I found in my headerfile there were already some similar forward declarations which suggests this is something that's been considered, but for whatever reason is not working in this specific instance.
I found that manually editting the header file could resolve the problem, but this isn't a viable solution.
Having the same problem
Versions are the same
Kotlin: 1.3.40
Coroutines: 1.2.2
Gradle: 5.4.1
Having the same problem
Gradle wrapper: 5.4.1
Kotlin: 1.3.40
Coroutines: 1.3.0-M2
This is a regression in Kotlin Native 1.3.40.
It's already fixed in upcoming 1.3.41.
Will keep it open until release with 1.3.41.
Most helpful comment
This is a regression in Kotlin Native 1.3.40.
It's already fixed in upcoming 1.3.41.
Will keep it open until release with 1.3.41.