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

Runtime errors caused by kotlinx-serialization dependency #88

Closed
isakatirci opened this issue Jan 28, 2021 · 4 comments
Closed

Runtime errors caused by kotlinx-serialization dependency #88

isakatirci opened this issue Jan 28, 2021 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@isakatirci
Copy link

Could not initialize class com.github.pemistahl.lingua.internal.FractionSerializer

I got this error. please give a reason why I get this error.

@pemistahl
Copy link
Owner

pemistahl commented Jan 28, 2021

Hello @isakatirci. I cannot help you without more context. How do you try to use Lingua? Which JVM language do you use and which runtime environment? Please show me some code and the complete stacktrace of the error you got. Thanks.

@pixartist
Copy link

pixartist commented Feb 4, 2021

openjdk13:x86_64-debian-jre-13.0.2_8 same issue.

Could fix it by manually adding the
runtimeOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.4.10'
runtimeOnly 'org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.0.0'
dependencies.

This is a workaround that does not work on all machines though. This is not a machine or environment dependent problem, it's an issue in the Lingua dependencies and it has been in there for quite a while. It also can cause other related errors, depending on what kotlin dependencies you add.

@pemistahl
Copy link
Owner

@pixartist It seems that adding the kotlinx-serialization library to Lingua was not such a good idea. 259 open issues, 66 open bugs. Oh dear! I think I will switch to a more reliable Java json serialization library in the next major release. Then those problems should be gone hopefully. Thanks for letting me know.

@pemistahl pemistahl changed the title i got a error on run time Runtime errors caused by kotlinx-serialization dependency Feb 4, 2021
@pemistahl pemistahl added the bug Something isn't working label Feb 4, 2021
@pemistahl pemistahl added this to the Lingua 1.1.0 milestone Feb 15, 2021
@pemistahl
Copy link
Owner

I hope that I've fixed this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants