Broken Android SmatFox Examples

I tried to compile this example on my computer, and all applications have errors like this:

04-17 18:01:18.493: E/AndroidRuntime(271): FATAL EXCEPTION: main
04-17 18:01:18.493: E/AndroidRuntime(271): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{sfs2x.example.android.tris/sfs2x.example.android.tris.Tris}: java.lang.ClassNotFoundException: sfs2x.example.android.tris.Tris in loader dalvik.system.PathClassLoader[/data/app/sfs2x.example.android.tris-2.apk]
04-17 18:01:18.493: E/AndroidRuntime(271):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
04-17 18:01:18.493: E/AndroidRuntime(271):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-17 18:01:18.493: E/AndroidRuntime(271):    at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-17 18:01:18.493: E/AndroidRuntime(271):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-17 18:01:18.493: E/AndroidRuntime(271):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-17 18:01:18.493: E/AndroidRuntime(271):    at android.os.Looper.loop(Looper.java:123)
04-17 18:01:18.493: E/AndroidRuntime(271):    at android.app.ActivityThread.main(ActivityThread.java:4627)
04-17 18:01:18.493: E/AndroidRuntime(271):    at java.lang.reflect.Method.invokeNative(Native Method)
04-17 18:01:18.493: E/AndroidRuntime(271):    at java.lang.reflect.Method.invoke(Method.java:521)
04-17 18:01:18.493: E/AndroidRuntime(271):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-17 18:01:18.493: E/AndroidRuntime(271):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-17 18:01:18.493: E/AndroidRuntime(271):    at dalvik.system.NativeStart.main(Native Method)
04-17 18:01:18.493: E/AndroidRuntime(271): Caused by: java.lang.ClassNotFoundException: sfs2x.example.android.tris.Tris in loader dalvik.system.PathClassLoader[/data/app/sfs2x.example.android.tris-2.apk]
04-17 18:01:18.493: E/AndroidRuntime(271):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)    
04-17 18:01:18.493: E/AndroidRuntime(271):    at java.lang.ClassLoader.loadClass(ClassLoader.java:573)    
04-17 18:01:18.493: E/AndroidRuntime(271):    at java.lang.ClassLoader.loadClass(ClassLoader.java:532)    
04-17 18:01:18.493: E/AndroidRuntime(271):    at android.app.Instrumentation.newActivity(Instrumentation.java:1021)    
04-17 18:01:18.493: E/AndroidRuntime(271):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)    
04-17 18:01:18.493: E/AndroidRuntime(271):    ... 11 more

Download exaples from HERE

I have:

  • Latest versions of Windows 7 X64, Eclipse, and Android NDK.
  • Latest version of SmartFox server.
+3
source share
1 answer

I found a solution to my problem, this is the link:

http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17

in particular:

If you have references to jars that are not in the ‘libs’ folder, for example if you use ‘classpath variable’, you can resolve the NoClassDefFoundError issue with the new ADT 17 by exporting the references.

To export the references: simply go to "Properties > Java Build Path > Order and Export", and check all the references you want exported.
+2
source

All Articles