简体   繁体   English

如何将Kryonet库导入Android Studio上的libGdx项目

[英]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? 如何在Android Studio中将外部库(在本例中为kryonet)添加到libGdx项目? 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? 我见过有人说它与build.grade有关,但是您将jar文件放在哪里或如何导入它呢?

Find the "build.gradle (Project : projectname)" file, under "project(":core") { dependencies {" add this line: 找到“ build.gradle(Project:projectname)”文件,在“ project(“:core”){依赖项{“下添加以下行:
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. Android studio会提示您进行Gradle同步,完成后,您现在可以调用kryonet类。 Happy days :-) 快乐的时光 :-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM