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

Update dependencies (Kotlin, Kermit, etc) #321

Open
HylkeB opened this issue Feb 21, 2025 · 5 comments
Open

Update dependencies (Kotlin, Kermit, etc) #321

HylkeB opened this issue Feb 21, 2025 · 5 comments
Assignees

Comments

@HylkeB
Copy link

HylkeB commented Feb 21, 2025

Hi,

I am using your KMP transport SDK in my own intermediate KMP library project, which is then consumed by multiple apps of the company im working for.

It appears to be working, but I did run into some issues specifically with Kermit once I used another dependency in another part of my project, which had conflicting dependency versions.

Situation:
module chat-core:

  • uses transport sdk version 2.8.1,
    • transitive dependency on kermit version 1.2.2
    • Built with Kotlin 1.9.22 (according your sourcecode)
  • module chat-ui: uses autolinktext version 1.1.1,
    • transitive dependency on kermit version 2.0.3
    • built with kotlin 2.x.x
      module ios-umbrella:
  • combines both chat-core and chat-ui and bundles it together in one XCFramework for ios apps to consume
  • Built with kotlin 2.0.21

Doing anything with the Transport SDK (creating a MessengerTransportSDK with logging set to true, and then creating hte messagingClient with that is enough) results in a crash because it cannot resolve kermit.i:

Uncaught Kotlin exception: kotlin.native.internal.IrLinkageError: Function 'i' can not be called: No function found for symbol 'co.touchlab.kermit/Logger.i|i(kotlin.Function0<kotlin.String>){}[0]'

Building the XCFramework already warns for this issue, as i also see the following message when building the xcframeworkt:
i: : No function found for symbol 'co.touchlab.kermit/Logger.i|i(kotlin.Function0<kotlin.String>){}[0]'
As part of the Task :ios-umbrella:linkDebugFrameworkIosSimulatorArm64

Unfortunately using the resolution strategy to force kermit version 1.2.2 didnt work for me, what did work was removing all the dependencies that use a newer version of kermit (luckily currently only autolinktext used kermit as well).

I assume this problem of incompatible versions will go away once you update your SDK to support kotlin 2+, and of course its good habit to update the versions of your transitive dependencies as well.

@AfanasievAnton
Copy link
Collaborator

Hi @HylkeB ,

Thanks for raising your concerns.

I see the problem. It is indeed related to the conflict between our dependency on Kermit and one used by autolinktext.

Unfortunately, in this case using resolution strategy would not work as Kermit broke their api on v.2.0.0 so we have not much options here.

The good news are - we have a plan to update our dependencies somewhere in the near future. I can not commit to specific date, though. But it is indeed something we discuss.

What happens if you create MessagingClient with logging=false - does application still crash?

@AfanasievAnton AfanasievAnton self-assigned this Feb 26, 2025
@HylkeB
Copy link
Author

HylkeB commented Feb 26, 2025

Hi, nice to hear that there are plans to update the dependencies.

I did try to disable logging, by setting logging to false on the messaging client, and it didnt crash immediately, however then it did crash as soon as i called MessagingClient.authorize() (which is the first thing I do on the messaging client).

Also looking at your code, setting logging to false shouldn't work since you still call kermit, but all you do is raise the minimum severity to Assert, which means nothing would be printed but kermit is still called, so you still get the exception that it cannot find the method.

@AfanasievAnton
Copy link
Collaborator

That is what I was expecting.
Just to get an understanding of the severity of this issue for you. Do you have a workaround for the described issue?

@HylkeB
Copy link
Author

HylkeB commented Feb 27, 2025

I do have a workaround for now (just dont use the autolinktext library). However I'm not sure how long it takes until I encounter version related issues again.

@AfanasievAnton
Copy link
Collaborator

Completely understand your concern. Will push to prioritize the work that resolve this issue.

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

2 participants