How to import the Kryonet library to a libGdx project on Android Studio

3.3k Views Asked by At

How do you add an external library (in this case, kryonet) to a libGdx project in Android Studio? I've seen people telling it's related to the build.grade, but where do you put the jar file or how do you import it?

1

There are 1 best solutions below

6
WonderfulWorld On BEST ANSWER

Find the "build.gradle (Project : projectname)" file, under "project(":core") { dependencies {" add this line:
compile "com.esotericsoftware:kryonet:2.22.0-RC1"
Android studio will prompt you for gradle sync, do it, after it's done you can now call the kryonet classes. Happy days :-)