The Computer Genius
The Computer Genius

Reputation: 53

How to import a Kotlin Library in IntelliJ

So i want to use the Serialization Library in my kotlin project, and from what i can gather from this page, i must use this: "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2", to do so, now i use "IntelliJ" as my build system, so i went to the project structure, and in libraries, clicked the + sign, clicked on "From Maven" and put this as the link to the library, and it downloaded it and i set it as a dependency of my project, it even shows as a external library, like this:

But when i try to import the lib, it gives error: enter image description here

Upvotes: 2

Views: 1415

Answers (1)

somethingsomething
somethingsomething

Reputation: 2164

Apparently you can indeed use IntelliJ IDEA as a build system without maven or gradle, but I don't think this is a supported way to use kotlinx-serialization.

I'd advise to pick either maven or gradle as your build system for your project (this can be done through IntelliJ, just create a new project and pick either one).

Then you can just follow the relevant paragraph at https://github.com/Kotlin/kotlinx.serialization#setup for either maven or gradle.

Upvotes: 2

Related Questions