You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function doesn't have or inherit @Throws annotation and thus exception isn't propagated from Kotlin to Objective-C/Swift as NSError. It is considered unexpected and unhandled instead. Program will be terminated. Uncaught Kotlin exception: kotlin.native.internal.FileFailedToInitializeException: There was an error during file or class initialization
Can someone help here ?
The text was updated successfully, but these errors were encountered:
sunilhs1986
changed the title
Cannot convert value of type 'String' to expected argument type 'StringResource'
Function doesn't have or inherit @Throws annotation and thus exception isn't propagated from Kotlin to Objective-C/Swift as NSError. It is considered unexpected and unhandled instead. Program will be terminated. Uncaught Kotlin exception: kotlin.native.internal.FileFailedToInitializeException: There was an error during file or class initialization
Jan 6, 2025
your error can be related to #796 that will be fixed in 0.24.5. or it can be just misconfiguration if you use static framework and not call copyResources task from xcode.
Alex009
changed the title
Function doesn't have or inherit @Throws annotation and thus exception isn't propagated from Kotlin to Objective-C/Swift as NSError. It is considered unexpected and unhandled instead. Program will be terminated. Uncaught Kotlin exception: kotlin.native.internal.FileFailedToInitializeException: There was an error during file or class initialization
kotlin.native.internal.FileFailedToInitializeException: There was an error during file or class initialization
Feb 2, 2025
I assume @sunilhs1986 has the same problem as I do. The configuration of my modularized project is as follows:
Core framework where I link static multiplatform framework ./gradlew :shared:embedAndSignAppleFrameworkForXcode
Application target where I run "$SRCROOT/../gradlew" -p "$SRCROOT/../shared" :shared:copyFrameworkResourcesToApp
This configuration still crashes with 0.24.5 with the same error. When I move copyFrameworkResourcesToApp to Core framework it works. @Alex009 Is this behaviour as intented?
@MartinStrambach looks like not intended. copyFrameworkResourcesToApp should be called for module that produce static framework.
can you give me reproducer project to debug?
Strings.kt:
package com.qvc.kmp.poc.shared
import dev.icerock.moko.resources.StringResource
import dev.icerock.moko.resources.desc.Resource
import dev.icerock.moko.resources.desc.StringDesc
import dev.icerock.moko.resources.format
actual class Strings {
actual fun get(id: StringResource, args: List): String {
return if(args.isEmpty()) {
StringDesc.Resource(id).localized()
} else {
id.format(*args.toTypedArray()).localized()
}
}
}
SwiftUi:
Text(
Strings().get(id: SharedRes.strings().product_description, args: [])
)
Can someone help here ?
The text was updated successfully, but these errors were encountered: