icerockdev / moko-template

Template project of a Mobile (Android & iOS) Kotlin MultiPlatform project with the MOKO libraries and modularized architecture
https://moko.icerock.dev/
Apache License 2.0
461 stars 47 forks source link

Questions: IosArm64 Actual declaration shortcut keep complaining. #22

Closed rhonyabdullah closed 3 years ago

rhonyabdullah commented 3 years ago

Hello @Alex009 As discussed here Adding SQLDelight to the project i try to move out my DatabaseDriverFactory class into iosX64Main folder, but after rebuilding the project i didn't see any iosArm64Main shortcut generated like moko-template did here I am also upgrade kotlin version to 1.4.21 and moko-mvvm to 0.8.1 as described on moko-mvvm readme file My question is:

  1. How my project can be able to generate that iosArm64Main shortcut folder automatically like moko-template do ?
  2. Also, my serializable annotation is missing each time "build" project executed, but if i try to put serializable annotation alongside moko-template News.kt entity class it's just fine.

Alex009 commented 3 years ago

hi!

  1. iosArm64Main in issue is just symbolic link. to create it use ln -s iosX64Main iosArm64Main. nothing is done automatically.
  2. in samples your class marked as @Serializable, but in template used @Parcelize - it's two different annotations for different purpose. Parcelize is from https://github.com/icerockdev/moko-parcelize to support android Parcelable generation. Serializable is from https://github.com/Kotlin/kotlinx.serialization to serialize to/from Json.
rhonyabdullah commented 3 years ago

hi!

  1. iosArm64Main in issue is just symbolic link. to create it use ln -s iosX64Main iosArm64Main. nothing is done automatically.
  2. in samples your class marked as @serializable, but in template used @Parcelize - it's two different annotations for different purpose. Parcelize is from https://github.com/icerockdev/moko-parcelize to support android Parcelable generation. Serializable is from https://github.com/Kotlin/kotlinx.serialization to serialize to/from Json.
  1. I have done, now it's working, thank you.
  2. I understand that between serializable & moko parcelize is two different, but strange is coming if i try to replace parcelize or put serializable alongside News.kt class it is still working fine, this issue also appear on kmm sample project and i was create a new issue there, hope they can explain and help how to resolve.

rhonyabdullah commented 3 years ago

I think i can close this issue because error is now heading to kotlinx serialization.