Search code examples
javaandroidnoclassdeffounderror

NoClassDefFoundError with klio-mobile-dataservice on Android


I'm trying to implement klio's library, but I keep on getting this exception, even following the tutorial.

Here's the logcat:

    11-12 23:34:30.979: E/AndroidRuntime(27299): FATAL EXCEPTION: main
    11-12 23:34:30.979: E/AndroidRuntime(27299): java.lang.NoClassDefFoundError: flex.messaging.io.amf.client.AMFConnection
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at tiwiz.connection.test.ConnectionActivity.retrieveNetData(ConnectionActivity.java:72)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at tiwiz.connection.test.ConnectionActivity.onCreate(ConnectionActivity.java:32)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at android.app.Activity.performCreate(Activity.java:5008)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2139)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2210)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at android.app.ActivityThread.access$600(ActivityThread.java:142)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1208)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at android.os.Handler.dispatchMessage(Handler.java:99)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at android.os.Looper.loop(Looper.java:137)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at android.app.ActivityThread.main(ActivityThread.java:4931)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at java.lang.reflect.Method.invokeNative(Native Method)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at java.lang.reflect.Method.invoke(Method.java:511)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
    11-12 23:34:30.979: E/AndroidRuntime(27299):    at dalvik.system.NativeStart.main(Native Method)

Compiling goes well, so it looks like it finds classes during compile process... Can someone help me? :)


Solution

  • The problem is due to a change in how libraries are managed in ADT, starting from version 17.

    This is the solution, essentially:

    1. remove the KlioMobileDS project from your Java Build Path
    2. export it into .jar
    3. put that .jar into your project libs folder