Не работает Android SmatFox Server примеры
Я попытался скомпилировать этот пример на моем компьютере, и все приложения имеют такие ошибки:
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
Скачать примеры с ЗДЕСЬ
Я имею:
- Windows 7 X64, Eclipse и Android NDK последних версий.
- Последняя версия сервера SmartFox.
1 ответ
Решение
Я нашел решение моей проблемы была эта ссылка:
http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17
конкретно это:
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.