How to reuse model class (like: User::class) in ba...
# multiplatform
h
How to reuse model class (like: User::class) in backend module in KMM template?
b
What exactly are you trying to achieve? Keep in mind that reflection is very limited on non jvm targets
h
Network synchronization between server and client via model, and it is pure kotlin, my Repository https://github.com/haitrvnvn/KMMM Every time i try add commonMain(inside shared module) model classes to backend module i got this error message:
Copy code
Failed to resolve: project::shared
Affected Modules: KMMM.backend
b
Must be something due to android target as it's handled differently to others. I'd suggest replacing it with jvm target in shared module (you should still be able to consume it in android project)
h
I think so, but i’m not figure out solution yet
m
@HaiTrvn Lưu Trữ your shared module doesn’t have JVM implementation, and your backend module is a JVM app it can be the reason
please check your `build.gradle.kts`(shared) here is an example from my project my app has also has common module and it is shared with backend: https://github.com/CurrencyConverterCalculator/CCC/blob/master/common/build.gradle.kts
h
after all it work, thank you guys so much