-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Describe the bug
I'm not sure if this is actually a bug or not. My module with Compose code doesn't have direct dependency on kotlinx-coroutines
, as the dependency has been used to be exposed as api
from Compose. As I have been able to use coroutines without adding the dependency explicitly. But after updating Compose from 1.6.0-alpha01
to 1.6.0-rc02
, kotlinx.coroutines
imports are unresolved and compileCommonMainKotlinMetadata
task fails. Though, tasks like jvmJar
, assembleDebug
, jsJar
, etc. - all work fine.
Affected platforms
Select one of the platforms below:
- Common
Versions
- Kotlin version*: 1.9.21, 1.9.22
- Compose Multiplatform version*: 1.6.0-rc02
- OS version(s)* (required for Desktop and iOS issues): macOS 13.5.2 (22G91)
- OS architecture (x86 or arm64): arm64
- JDK (for desktop issues): jbr-17
To Reproduce
Don't add kotlinx-coroutines
dependency to a module with Compose.
Code:
import kotlinx.coroutines.launch
Run: ./gradlew compileCommonMainKotlinMetadata
Error:
> Task :extensions-compose:compileCommonMainKotlinMetadata FAILED
e: file:///....... Unresolved reference: coroutines
I'm also not able to use rememberCoroutineScope
, the error is:
> Task :extensions-compose:compileCommonMainKotlinMetadata FAILED
e: file:///........ Cannot access class 'kotlinx.coroutines.CoroutineScope'. Check your module classpath for missing or conflicting dependencies
Expected behavior
I think it should work work fine without adding kotlinx-coroutines
explicitly, but I might be wrong.