In an android Studio Project I received where kotlin coroutines library is added as dependency
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8",
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8",
Although everything builds and runs perfectly well, in Android Studio itself I see Unresolved Reference Errors on every import of a class from kotlinx.coroutines package.
And in my External Libs folder the jar file for corouties core seems not to have appropriate files: see screenshotsenter image description here
I searched the internet and tried various things that I could find but there is very few information on this topic and I nothing helped me
EDIT:
I seem to have found the culprit. It appears to be the kotlin.mpp.enableGranularSourceSetsMetadata=true
in the gradle.properties file. When I commented it out the libraries imported properly and the classes work as expected.
I filed an issue on issuetracker.google.com:
END EDIT
I'm having the same issue using org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1-native-mt.
It's not clear where I would post a bug report...
Creating a new project and adding just adding coroutines has not reproduced the issue. So I have seen it work. My best guess at the moment is that it's some sort of conflicting dependency or dependency that causes a problem with AS pulling in the external library jar and sources.
Here is the project external libraries where it is not working. Image showing external klibs for commonMain, nativeMain:
And here is the one that works properly. Image showing coroutines-core with source and metadata:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With