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

instantiateImpl not resolved #17

Closed
Berhug74 opened this issue May 1, 2024 · 8 comments
Closed

instantiateImpl not resolved #17

Berhug74 opened this issue May 1, 2024 · 8 comments
Assignees

Comments

@Berhug74
Copy link

Berhug74 commented May 1, 2024

Hello!

I wanted to try Room in KMP to replace my existing implementation with SQLDelight. It is working on Android correctly, but in my project and in the Fruitties Sample, I am not able to test on a iOS device, because instantiateImpl (described also here) is not resolved.

Am I missing something?

Thanks :)

@Berhug74 Berhug74 changed the title instantiateImpl instantiateImpl not resolved May 1, 2024
@VixonneN
Copy link

VixonneN commented May 2, 2024

Some confusing thing, I have this extension giving me an error too, yet this project builds and works as it should.

@Berhug74
Copy link
Author

Berhug74 commented May 2, 2024

Yes, I saw that it is generated in build folder. I managed to run the sample.
I still have some issues in my personal project, on iOS only, but it might not by linked to instanceImpl directly.

Capture d’écran 2024-05-02 à 18 02 29

@yenerm
Copy link
Contributor

yenerm commented May 2, 2024

Hi, thanks for reporting this! I could replicate the error in Jellyfish but I have no problems building the app and running the iOS emulator using xCode. Can you verify if you have issues running the app?

@Berhug74
Copy link
Author

Berhug74 commented May 4, 2024

Hi again!
I made my repository public here. I can't figure out why on this repository, I still have an issue on iOS. The RoomGptDatabase_InstantiateImpl.kt is correctly generated but seems to be unresolved.
Capture d’écran 2024-05-04 à 17 04 40

For iOS, this is the actual method building the RoomDatabase.

The database is created from a Koin module. Might be related to this?

It's ok on Android, it's running perfectly.

EDIT: on this commit, I tried to copy/paste the content of the build folder directly in iOS Main. By keeping the same name, I have an error telling me that there is a conflict (meaning the classes/method are found) 🤔 I tried to rename it and it now launches correctly.

@Berhug74
Copy link
Author

Berhug74 commented May 5, 2024

Hi again x2!
After further investigation, I think it might be linked to K2/KSP2. I tested my configuration in a brand new project.
It works with following versions:
ksp = "1.9.23-1.0.19"
kotlin = "1.9.23"

But doesn't work anymore (on iOS only) with:
ksp = "2.0.0-RC2-1.0.20"
kotlin = "2.0.0-RC2"

@sourabhgupta811
Copy link

@Berhug74 It did not work for me after using the mentioned kotlin and ksp versions. Did it work out of the box for you with these versions?
Kotlin - 1.9.23
ksp - 1.9.23-1.0.19
AGP - 8.4.0
Android studio version - Jellyfish | 2023.3.1

@Berhug74
Copy link
Author

Berhug74 commented May 6, 2024

I use K2 because of Jetbrains Resources: JetBrains/compose-multiplatform#4454

I tested on this branch in my repo and I downgrade Kotlin to 1.9.23 and ksp 1.9.23-1.0.20.
As expected, Jetbrains resources doesn't work anymore on iOS this time at runtime, but instantiateImpl is correctly resolved and the app is launched 🤯😅

@yenerm
Copy link
Contributor

yenerm commented May 6, 2024

I double checked the project builds and runs as expected after a clean check out. I'll follow why Android Studio shows an error on Factory.native.kt:38 but this doesn't affect building and running the project.

@yenerm yenerm closed this as completed May 6, 2024
@yenerm yenerm self-assigned this May 6, 2024
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

4 participants