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
KClass for Objective-C classes is not supported yet #1492
Comments
did you tried latest Koin in 3.3.2? |
@arnaudgiuliani just tried and yes it still give the same error |
I confirm what @mustafaozhan is reporting. |
I need to continue investigating. The more I an gather sample, the more I can test this 🤔 Seems a limitation of Kotlin/native with reified type as I. can see. |
@arnaudgiuliani Yeap sure take your time 🙂 as for the sample you can try running my app in this branch https://github.com/Oztechan/CCC/tree/1524-Remove_NativeDependencyWrapper The app has submodules, so you need to clone them too and the crash is runtime, so you need to run the iOS app in order to get the crash. README.md has both |
Great, thanks for your help. |
Rescheduling it for new core release 👍 |
Still stuck due to Kotlin native limitations. Operations are not allowed on KClass/ObjC: "KClass for Objective-C classes is not supported yet" I've tried to hack around definition ObjCObject type also, nothing great. Will ask Jetbrains about some clues on it. |
Looking for a solution around. Let's keep an eye for Koin 3.5 on it |
still waiting for some updates |
I have the same problem with Koin 3.5.3, as a workaround for a singleton I used an |
Describe the bug
Creating this bug since this one is actually not resolved: #1016
So the issue is currently we are not able to inject Objective-C classes directly that's why I use a wrapper class to hold Objective-C class inside. (In the example it is
UserDefaults
)If I try below app runs with no problem
But expected behaviour should be like below, we shouldn't need this extra wrapper:
Here is a PR that I remove this wrapper class: https://github.com/Oztechan/CCC/pull/1525/files so it can be used as reproducer
To Reproduce
Steps to reproduce the behavior:
Run the ios app in mentioned PR branch, after the app starts running it will crash with this log
Expected behavior
App should run
Koin project used and used version (please complete the following information):
koin-core version 3.3.0, 3.3.2
The text was updated successfully, but these errors were encountered: