cannot run android sample connector

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

ducnvloved
Posts: 6
Joined: 30 Aug 2012, 03:48

cannot run android sample connector

Postby ducnvloved » 30 Aug 2012, 04:38

Hi Guys.

I'm totally new to sfs and sfs2x. I already downloaded and installed the server on my local machine. I'm trying to make the sample connector run on the emulator but no success. The logcat indicate some errors :


08-30 11:28:34.974: I/dalvikvm(649): threadid=3: reacting to signal 3
08-30 11:28:35.014: I/dalvikvm(649): Wrote stack traces to '/data/anr/traces.txt'
08-30 11:28:35.174: I/dalvikvm(649): Failed resolving Lsfs2x/example/android/connector/Connector; interface 37 'Lsfs2x/client/core/IEventListener;'
08-30 11:28:35.174: W/dalvikvm(649): Link of class 'Lsfs2x/example/android/connector/Connector;' failed
08-30 11:28:35.194: D/AndroidRuntime(649): Shutting down VM
08-30 11:28:35.194: W/dalvikvm(649): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
08-30 11:28:35.215: E/AndroidRuntime(649): FATAL EXCEPTION: main
08-30 11:28:35.215: E/AndroidRuntime(649): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{sfs2x.example.android.connector/sfs2x.example.android.connector.Connector}: java.lang.ClassNotFoundException: sfs2x.example.android.connector.Connector
08-30 11:28:35.215: E/AndroidRuntime(649): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
08-30 11:28:35.215: E/AndroidRuntime(649): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
08-30 11:28:35.215: E/AndroidRuntime(649): at android.app.ActivityThread.access$600(ActivityThread.java:123)
08-30 11:28:35.215: E/AndroidRuntime(649): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
08-30 11:28:35.215: E/AndroidRuntime(649): at android.os.Handler.dispatchMessage(Handler.java:99)
08-30 11:28:35.215: E/AndroidRuntime(649): at android.os.Looper.loop(Looper.java:137)
08-30 11:28:35.215: E/AndroidRuntime(649): at android.app.ActivityThread.main(ActivityThread.java:4424)
08-30 11:28:35.215: E/AndroidRuntime(649): at java.lang.reflect.Method.invokeNative(Native Method)
08-30 11:28:35.215: E/AndroidRuntime(649): at java.lang.reflect.Method.invoke(Method.java:511)
08-30 11:28:35.215: E/AndroidRuntime(649): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-30 11:28:35.215: E/AndroidRuntime(649): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-30 11:28:35.215: E/AndroidRuntime(649): at dalvik.system.NativeStart.main(Native Method)
08-30 11:28:35.215: E/AndroidRuntime(649): Caused by: java.lang.ClassNotFoundException: sfs2x.example.android.connector.Connector
08-30 11:28:35.215: E/AndroidRuntime(649): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
08-30 11:28:35.215: E/AndroidRuntime(649): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-30 11:28:35.215: E/AndroidRuntime(649): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-30 11:28:35.215: E/AndroidRuntime(649): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
08-30 11:28:35.215: E/AndroidRuntime(649): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
08-30 11:28:35.215: E/AndroidRuntime(649): ... 11 more
08-30 11:28:35.484: I/dalvikvm(649): threadid=3: reacting to signal 3
08-30 11:28:35.504: I/dalvikvm(649): Wrote stack traces to '/data/anr/traces.txt'
08-30 11:28:35.817: I/dalvikvm(649): threadid=3: reacting to signal 3
08-30 11:28:35.874: I/dalvikvm(649): Wrote stack traces to '/data/anr/traces.txt'


and in the console :


[2012-08-30 11:28:31 - SFS2X_Example_Connector] WARNING: Application does not specify an API level requirement!
[2012-08-30 11:28:31 - SFS2X_Example_Connector] Device API version is 15 (Android 4.0.4)
[2012-08-30 11:28:33 - SFS2X_Example_Connector] Application already deployed. No need to reinstall.
[2012-08-30 11:28:33 - SFS2X_Example_Connector] Starting activity sfs2x.example.android.connector.Connector on device emulator-5554
[2012-08-30 11:28:34 - SFS2X_Example_Connector] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=sfs2x.example.android.connector/.Connector }



Can some one please tell me how to fix the problem since this example is the good way to start to learn smartfox and I really want to know it in detail.

Thank you very much.
ducnvloved
Posts: 6
Joined: 30 Aug 2012, 03:48

Re: cannot run android sample connector

Postby ducnvloved » 30 Aug 2012, 04:40

By the way:

my eclipse version is :
Eclipse SDK
Version: 3.7.2
Build id: M20120208-0800

and Android SDK version: 20.0.3
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: cannot run android sample connector

Postby Lapo » 30 Aug 2012, 09:32

There are several ClassNotFound exceptions which suggest that you didn't add all the dependencies to the project.
Are you sure you followed the instructions on how to setup the example, step by step?

I think you are just missing one or more reference to the provided jar files.
Lapo
--
gotoAndPlay()
...addicted to flash games
ducnvloved
Posts: 6
Joined: 30 Aug 2012, 03:48

Re: cannot run android sample connector

Postby ducnvloved » 31 Aug 2012, 04:02

Okie.

Thank you very much for the response, I managed to make it worked for me.
The problem is I unchecked for the external library in the "Order and export" tab of the build path configuration. (this is not in the tutorial I believed).

Anyway, Thank you again.

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 20 guests