I have been trying to get the OpenTok Android hello world working but it keeps crashing on launch. After importing the Hello world project, I copied the opentok android sdk into the project and re-built the project in eclipse. The errors all went away but when I run it on my Galaxy Nexus, I get the following error:
02-02 10:01:39.321: E/AndroidRuntime(17238): FATAL EXCEPTION: main
02-02 10:01:39.321: E/AndroidRuntime(17238): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.opentok.helloworld/com.opentok.helloworld.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.opentok.helloworld.MainActivity" on path: /data/app/com.opentok.helloworld-2.apk
02-02 10:01:39.321: E/AndroidRuntime(17238): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
02-02 10:01:39.321: E/AndroidRuntime(17238): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
02-02 10:01:39.321: E/AndroidRuntime(17238): at android.app.ActivityThread.access$600(ActivityThread.java:141)
02-02 10:01:39.321: E/AndroidRuntime(17238): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
02-02 10:01:39.321: E/AndroidRuntime(17238): at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 10:01:39.321: E/AndroidRuntime(17238): at android.os.Looper.loop(Looper.java:137)
02-02 10:01:39.321: E/AndroidRuntime(17238): at android.app.ActivityThread.main(ActivityThread.java:5039)
02-02 10:01:39.321: E/AndroidRuntime(17238): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 10:01:39.321: E/AndroidRuntime(17238): at java.lang.reflect.Method.invoke(Method.java:511)
02-02 10:01:39.321: E/AndroidRuntime(17238): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-02 10:01:39.321: E/AndroidRuntime(17238): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-02 10:01:39.321: E/AndroidRuntime(17238): at dalvik.system.NativeStart.main(Native Method)
02-02 10:01:39.321: E/AndroidRuntime(17238): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.opentok.helloworld.MainActivity" on path: /data/app/com.opentok.helloworld-2.apk
02-02 10:01:39.321: E/AndroidRuntime(17238): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
02-02 10:01:39.321: E/AndroidRuntime(17238): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
02-02 10:01:39.321: E/AndroidRuntime(17238): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
02-02 10:01:39.321: E/AndroidRuntime(17238): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
02-02 10:01:39.321: E/AndroidRuntime(17238): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
02-02 10:01:39.321: E/AndroidRuntime(17238): ... 11 more
Am I doing something wrong? Should I do something with the Build Path? I am not sure what to do / how to do it.
I also saw this post but could not find out what the solution is. Any help would be appreciated. Thanks
I encountered this issue before.
what I did is :
then it is working.
holp this help.
Put the tokbox library jars (there you be 5 or 6 jars as I remeber) into libs folder. That helped me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With