Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS-only: IrCallImpl: 1 compilation error when passing a Kamel File to asyncPainterResource with Kotlin 2.0.0 #108

Open
yuroyami opened this issue Jul 19, 2024 · 6 comments

Comments

@yuroyami
Copy link

I use expect/actual to instantiate a Kamel File :

//commonMain
expect fun String.toKamelFile(): File

KamelImage(
      resource = asyncPainterResource(someImageFilePath.toKamelFile())
      ...
)

//androidMain
actual fun String.toKamelFile() = java.File(this) <-- works fine

//iosMain
actual fun String.toKamelFile(): File { return File(path = this) } <--- Causes compilation error 

Kotlin: 2.0.0
Compose multiplatform: 1.7.0-alpha01

@luca992
Copy link
Member

luca992 commented Jul 19, 2024

This on the latest beta release?

@yuroyami
Copy link
Author

Issue confirmed in v0.9.5 and v1.0.0-beta.6. Can't check beta7 as i am out of town for the moment

@luca992
Copy link
Member

luca992 commented Jul 19, 2024

are you using kotlin.incremental.native=true by chance? I was getting some weird errors when using that just now. I'm able to load images with File on ios in the sample, so not really sure how to reproduce it.

@yuroyami
Copy link
Author

Here's my gradle.properties:

#Gradle
org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2g"

#Kotlin
kotlin.code.style=official

#Android
android.useAndroidX=true
android.enableJetifier=true
android.compileSdk=34
android.targetSdk=34
android.minSdk=24
android.nonTransitiveRClass=true

#MPP
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.stability.nowarn=true #
kotlin.mpp.androidSourceSetLayoutVersion=2 #
kotlin.native.disableCompilerDaemon=true

kotlin.mpp.androidGradlePluginCompatibility.nowarn=true
kotlin.apple.xcodeCompatibility.nowarn=true

#Compose
org.jetbrains.compose.experimental.uikit.enabled=true

#Room-related
room.generateKotlin=true
#ksp.useKSP2 = true

Could it be due to kotlin.native.disableCompilerDaemon=true ?

@AlexWink
Copy link

Hi, I encountered the same issue as @yuroyami and I couldn't figure out what was the difference between my implementation and the sample's one that works fine.
I created a mini project that reproduces the issue if it can help finding what causes the problem.
https://github.com/AlexWink/KamelIOSCompileError

@luca992
Copy link
Member

luca992 commented Jul 24, 2024

Hi, I encountered the same issue as @yuroyami and I couldn't figure out what was the difference between my implementation and the sample's one that works fine.
I created a mini project that reproduces the issue if it can help finding what causes the problem.
https://github.com/AlexWink/KamelIOSCompileError

Sweet. Thanks for making that. I can take a look soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants