Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 
like image 925
Simon Potvin Avatar asked Nov 30 '12 06:11

Simon Potvin


1 Answers

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)

like image 125
Tourki Avatar answered Nov 14 '22 01:11

Tourki