1

I am getting an error. Here is the log:

04-01 22:04:41.010: I/dalvikvm(19541): Could not find method com.quickblox.module.chat.smack.SmackAndroid.init, referenced from method com.quickblox.videochatsample.ui.App.onCreate
04-01 22:04:41.010: W/dalvikvm(19541): VFY: unable to resolve static method 13789: Lcom/quickblox/module/chat/smack/SmackAndroid;.init (Landroid/content/Context;)Lcom/quickblox/module/chat/smack/SmackAndroid;
04-01 22:04:41.010: D/dalvikvm(19541): VFY: replacing opcode 0x71 at 0x0003
04-01 22:04:41.010: D/AndroidRuntime(19541): Shutting down VM
04-01 22:04:41.010: W/dalvikvm(19541): threadid=1: thread exiting with uncaught exception (group=0x40c11a68)
04-01 22:04:41.020: E/AndroidRuntime(19541): FATAL EXCEPTION: main
04-01 22:04:41.020: E/AndroidRuntime(19541): java.lang.NoClassDefFoundError: com.quickblox.module.chat.smack.SmackAndroid
04-01 22:04:41.020: E/AndroidRuntime(19541):    at com.quickblox.videochatsample.ui.App.onCreate(App.java:13)
04-01 22:04:41.020: E/AndroidRuntime(19541):    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:973)
04-01 22:04:41.020: E/AndroidRuntime(19541):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3971)
04-01 22:04:41.020: E/AndroidRuntime(19541):    at android.app.ActivityThread.access$1300(ActivityThread.java:128)
04-01 22:04:41.020: E/AndroidRuntime(19541):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199)
04-01 22:04:41.020: E/AndroidRuntime(19541):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-01 22:04:41.020: E/AndroidRuntime(19541):    at android.os.Looper.loop(Looper.java:137)
04-01 22:04:41.020: E/AndroidRuntime(19541):    at android.app.ActivityThread.main(ActivityThread.java:4517)
04-01 22:04:41.020: E/AndroidRuntime(19541):    at java.lang.reflect.Method.invokeNative(Native Method)
04-01 22:04:41.020: E/AndroidRuntime(19541):    at java.lang.reflect.Method.invoke(Method.java:511)
04-01 22:04:41.020: E/AndroidRuntime(19541):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
04-01 22:04:41.020: E/AndroidRuntime(19541):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
04-01 22:04:41.020: E/AndroidRuntime(19541):    at dalvik.system.NativeStart.main(Native Method)  

Code:

package com.quickblox.videochatsample.ui;

import android.app.Application;

import com.quickblox.module.chat.smack.SmackAndroid;


public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        SmackAndroid.init(this);
    }
}
halfer
  • 19,824
  • 17
  • 99
  • 186
joey rohan
  • 3,505
  • 5
  • 33
  • 70

1 Answers1

0

A simple googling, and you will find the answer.

The answer is that your jar-file does not contain the proper jar-file, that contains the java class that you need.

If you do not use any build tool. Then I would suggest that you use that. So that you can tell the build tool to include that very important jar-file.

A build tool like ivy, maven, ant etc.

The reason why you can use that class when you code in your IDE. Is that the IDE for some reason have that jar-file/class in its classpath. But not on the build path. Why, it is hard to know since you have not shown your project file or equal file.

But I'm pretty sure you can solve the problem now.

Viggo
  • 91
  • 6
  • I tried adding that jar as an external jar, also to the libs folder, and to the build path! – joey rohan Apr 01 '14 at 17:11
  • Have you check the compiled jar-file? Does that jar-file contains the jar-file with the missing class? If not, then there is something fizzy about the setup. If I would have access to the code/ packaged jar-file. I would open that and check out the contains. That would give you a very good clue what is wrong. – Viggo Apr 01 '14 at 17:22
  • Basically i reported the same problem to the quickbloX team.They said everything is fine on their side.So the possibility of missing class is rare.Any work around ? – joey rohan Apr 01 '14 at 17:28
  • When I wrote that you should check the jar file. I didn't meant "quickBloX"s jar-file. I'm pretty sure that jar file is really good and nice. I was more talking about your jar-file. What does that file contain? Which classes, jar-files and other resource. But most important, does it contains the missing jar-file from quickBloX. Your error message indicate thats the problem. – Viggo Apr 01 '14 at 17:58
  • do you mean the apk file? – joey rohan Apr 01 '14 at 18:06
  • Sorry I'm not used to do Android development. Instead I'm specialized in JEE. Yes, the apk-file. – Viggo Apr 01 '14 at 18:09
  • And how check?But it should definitely contain the jar.It's classDefNot found.Class does reside – joey rohan Apr 01 '14 at 18:14
  • It is some kinds of zip-type file. According to http://en.wikipedia.org/wiki/APK_(file_format) So you should be able to open the file with a RAR, Zip or some other kinds of compress tools. – Viggo Apr 01 '14 at 18:24