javalibgdxandroid-studio-2.0kryonetandroid-studio-import

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


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?


Solution

  • 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 :-)