Kryonet and android

I am trying to use Kryonet in an Android application, but when I try it on the Android virtual device, and even on my Android cell phone, I get this error:

-Could not find class 'com.esotericsoftware.kryonet.Client', referenced from method com.Boussole.phone.MainActivity.onCreate

I already added Kryonet to the build path:

properties/java build path --> Libraries-->add jars --> kryonet-2.18-all.jar 

If you are using Eclipse with ADT , the only thing you have to do when you want to add a jar library is to copy and paste it to the libs folder (this folder exists already under your Android project), and ADT will take care of adding it to the build path.

Actually you have no choice, if you add your jar file to the build path (the old way) it will compile correctly but it will give you that NoClassDefFoundException when launching your app.

(the answer was already mentionned in the succinct comment of njzk2)


I had to import the project into my eclipse workspace. via...

File > Import > Existing projects into workspace. This is for the top level of the project. (I'm assuming it has been downloaded from github?)

I did copy over the lib files into my Android projects lib folder.

I did get some errors but then ran eclipse as Administrator which solved every error. As the buildconfig failed to build in my Facebook SDK.

链接地址: http://www.djcxy.com/p/11514.html

上一篇: 在现场实例请求中作为根设备附加现有EBS

下一篇: Kryonet和机器人