0
我是Android編程的新手(但對Java不是新手),在這裏它是持有我的進度的東西; 我有提供設備方向的簡單應用程序。我想不通,爲什麼會出現以下異常Android:ClassNotFoundException引用同一個項目中的類
12-16 11:29:59.122: W/dalvikvm(29078): threadid=1: thread exiting with uncaught exception (group=0x400205a0)
12-16 11:29:59.122: E/AndroidRuntime(29078): FATAL EXCEPTION: main
12-16 11:29:59.122: E/AndroidRuntime(29078): java.lang.NoClassDefFoundError: test.app.tools.orientation.OrientationProvider
12-16 11:29:59.122: E/AndroidRuntime(29078): at test.app.LocationActivity.setReferences(LocationActivity.java:25)
12-16 11:29:59.122: E/AndroidRuntime(29078): at test.app.LocationActivity.onCreate(LocationActivity.java:20)
12-16 11:29:59.122: E/AndroidRuntime(29078): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
12-16 11:29:59.122: E/AndroidRuntime(29078): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1794)
12-16 11:29:59.122: E/AndroidRuntime(29078): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1851)
12-16 11:29:59.122: E/AndroidRuntime(29078): at android.app.ActivityThread.access$1500(ActivityThread.java:132)
12-16 11:29:59.122: E/AndroidRuntime(29078): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
12-16 11:29:59.122: E/AndroidRuntime(29078): at android.os.Handler.dispatchMessage(Handler.java:99)
12-16 11:29:59.122: E/AndroidRuntime(29078): at android.os.Looper.loop(Looper.java:150)
12-16 11:29:59.122: E/AndroidRuntime(29078): at android.app.ActivityThread.main(ActivityThread.java:4277)
12-16 11:29:59.122: E/AndroidRuntime(29078): at java.lang.reflect.Method.invokeNative(Native Method)
12-16 11:29:59.122: E/AndroidRuntime(29078): at java.lang.reflect.Method.invoke(Method.java:507)
12-16 11:29:59.122: E/AndroidRuntime(29078): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-16 11:29:59.122: E/AndroidRuntime(29078): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-16 11:29:59.122: E/AndroidRuntime(29078): at dalvik.system.NativeStart.main(Native Method)
這是項目hierarhy:
相關LocationActivity
線(20號線)
orientationProvider = new OrientationProvider(...)
那麼,爲什麼我無法在同一應用程序範圍內訪問我自己的非活動類? 我發現是超級討厭的是,其實我可以匿名實例執行的OrientationProvider
聲明內public static interface OrientationListener
但仍
什麼是LocationActivity.java中的第20行。 – InnocentKiller
發佈您的活動代碼以及Android清單文件... – InnocentKiller
http://stackoverflow.com/questions/17973970/how-to-solve-java-lang-noclassdeffounderror引用此鏈接 –