我工程A想調用工程B的文件,我是如下配置的:A工程右鍵->configure build path ->projects選擇添加B工程。然後我直接在A中調用工程B的類(是在一個按鈕中調用的)。項目沒有報錯,編譯也可以過,可以當我APP安裝後,點擊這個調用了B類的按鈕就會出錯。錯誤如下
Could not execute method of the activity
09-16 16:00:39.629: E/MyUncaughtHandler(16676): java.lang.IllegalStateException: Could not execute method of the activity
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at android.view.View$1.onClick(View.java:3725)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at android.view.View.performClick(View.java:4262)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at android.view.View$PerformClick.run(View.java:17351)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at android.os.Handler.handleCallback(Handler.java:615)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at android.os.Handler.dispatchMessage(Handler.java:92)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at android.os.Looper.loop(Looper.java:137)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at android.app.ActivityThread.main(ActivityThread.java:4935)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at java.lang.reflect.Method.invokeNative(Native Method)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at java.lang.reflect.Method.invoke(Method.java:511)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at dalvik.system.NativeStart.main(Native Method)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): Caused by: java.lang.reflect.InvocationTargetException
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at java.lang.reflect.Method.invokeNative(Native Method)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at java.lang.reflect.Method.invoke(Method.java:511)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at android.view.View$1.onClick(View.java:3720)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): ... 11 more
09-16 16:00:39.629: E/MyUncaughtHandler(16676): Caused by: java.lang.NoClassDefFoundError: org.videolan.vlc.audio.AudioServiceController
09-16 16:00:39.629: E/MyUncaughtHandler(16676): at ixz.fish_help_app.GrpDevListActivity.sys_vlc(GrpDevListActivity.java:1895)
09-16 16:00:39.629: E/MyUncaughtHandler(16676): ... 14 more
其中找不到的文件是我工程B中的文件。
你需要把B中要用到的類編譯後生成jar庫導入到A中,然後安裝就沒有問題了