我收到錯誤消息。下面是日誌:如何解決「java.lang.NoClassDefFoundError」?
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)
代碼:
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);
}
}
看起來像你的項目沒有'com.quickblox.module.chat.smack.SmackAndroid'類... –
@LuiggiMendoza should't拋出類沒有找到呢? –
檢查['NoClassDefFoundError'](http://docs.oracle.com/javase/7/docs/api/java/lang/NoClassDefFoundError.html)javadoc:*當前正在執行的類中存在搜索到的類定義被編譯了,但定義不能再被找到。* –