Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenTok Android demo not working - Didn't find class "com.opentok.helloworld.MainActivity"

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

like image 659
Ayrton Senna Avatar asked Feb 02 '13 15:02

Ayrton Senna


2 Answers

I encountered this issue before.

what I did is :

  1. delete the "libs" file in the project.
  2. create new folder "libs" in project.
  3. move the jars from "opentok-android-sdk" folder to "libs"
  4. configration build path.

then it is working.

holp this help.

like image 118
ray Avatar answered Nov 08 '22 20:11

ray


Put the tokbox library jars (there you be 5 or 6 jars as I remeber) into libs folder. That helped me.

like image 40
narek.gevorgyan Avatar answered Nov 08 '22 21:11

narek.gevorgyan