Kotlin / kotlinx-rpc

Add asynchronous RPC services to your multiplatform applications.
https://kotlin.github.io/kotlinx-rpc/
Apache License 2.0
512 stars 7 forks source link

[iOS] Uncaught Kotlin exception: kotlin.IllegalStateException: Internal kotlinx.rpc error: unable to find class UserService rpc client object - on Sampled app #93

Closed jerryOkafor closed 6 days ago

jerryOkafor commented 3 weeks ago

I tried following the Readme guidelines and ended up with the following error:

Uncaught Kotlin exception: kotlin.IllegalStateException: Internal kotlinx.rpc error: unable to find class UserService rpc client object

To be clear, Android works as expected and to be sure I am not making any mistakes, I pulled the sample, tried it on iOS, and ended up with the same issue.

Environment: Kotlin: 1.9.24 Xcode Version : 15.4 (15F31d)

Mr3zee commented 3 weeks ago

Thanks for the report! I will investigate

afTrolle commented 3 weeks ago

I'm also having the similar issue, However I have a different project setup than the sample.

I moved the RPC interface to it's own module that then the server and client modules depend on.

kotlin.IllegalStateException: Internal kotlinx.rpc error: unable to find class run.tevla.api.ForgeServiceContract rpc client object

Tried moving the code into the shared KMM module still got the same result.

image

jerryOkafor commented 2 weeks ago

This is similar to how my modules are arranged. When I noticed the issue, I pulled the sample and ran it to verify that the same issue existed.

ShayOinif commented 2 weeks ago

Hello. I am facing the same issue and would love to have a fix for it. Thanks!

ShayOinif commented 2 weeks ago

Seems like the problem is present on macOS targets as well. Thought maybe I misconfigured my gradles, but in the sample from the code base the issue reoccurred. Maybe it is a problem with bundling to Framework on Apple targets?

ShayOinif commented 2 weeks ago

Tested and found the same issue on Linux targets as well.

xxfast commented 1 week ago

Only seems to be affecting the native targets - JVM and Android targets works as expected 👍

Mr3zee commented 6 days ago

Fixed in #112