我有一个我一直在为Android开发的应用程序。应用程序从Eclipse安装并运行良好,但是当我导出.apk
时,将其放在手机上并安装它然后应用程序将无法运行和关闭。
我在logcat中收到此消息:
05-01 14:57:21.167: E/WindowState(839): getStack: Window{1655a746 u0 com.example.testapp/com.example.testapp.MainActivity}
couldn't find taskId=551 Callers=com.android.server.wm.WindowState.computeFrameLw:1054
com.android.internal.policy.impl.PhoneWindowManager.layoutWindowLw:4904
com.android.server.wm.WindowManagerService.performLayoutLockedInner:10917
com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedInner:11857
之前有其他人遇到过这个吗?任何想法?
更新
实际上是造成这个问题的原因:
05-01 15:13:32.355: E/AndroidRuntime(17907): FATAL EXCEPTION: main
05-01 15:13:32.355: E/AndroidRuntime(17907): Process: com.example.testapp, PID: 17907
05-01 15:13:32.355: E/AndroidRuntime(17907): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/example/testapp/MainActivity$2;
05-01 15:13:32.355: E/AndroidRuntime(17907): at com.example.testapp.MainActivity.(MainActivity.java:3503)
05-01 15:13:32.355: E/AndroidRuntime(17907): at java.lang.reflect.Constructor.newInstance(Native Method)
05-01 15:13:32.355: E/AndroidRuntime(17907): at java.lang.Class.newInstance(Class.java:1650)
05-01 15:13:32.355: E/AndroidRuntime(17907): at android.app.Instrumentation.newActivity(Instrumentation.java:1079)
05-01 15:13:32.355: E/AndroidRuntime(17907): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2536)
05-01 15:13:32.355: E/AndroidRuntime(17907): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2760)
05-01 15:13:32.355: E/AndroidRuntime(17907): at android.app.ActivityThread.access$900(ActivityThread.java:177)
05-01 15:13:32.355: E/AndroidRuntime(17907): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
05-01 15:13:32.355: E/AndroidRuntime(17907): at android.os.Handler.dispatchMessage(Handler.java:102)
05-01 15:13:32.355: E/AndroidRuntime(17907): at android.os.Looper.loop(Looper.java:145) 05-01 15:13:32.355: E/AndroidRuntime(17907): at android.app.ActivityThread.main(ActivityThread.java:5944)
05-01 15:13:32.355: E/AndroidRuntime(17907): at java.lang.reflect.Method.invoke(Native Method)
05-01 15:13:32.355: E/AndroidRuntime(17907): at java.lang.reflect.Method.invoke(Method.java:372)
05-01 15:13:32.355: E/AndroidRuntime(17907): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1389)
05-01 15:13:32.355: E/AndroidRuntime(17907): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1184)
05-01 15:13:32.355: E/AndroidRuntime(17907): Caused by: java.lang.ClassNotFoundException: Didn't find class
"com.example.testapp.MainActivity$2" on path:
DexPathList[[zip file "/data/app/com.sentinor.gmcobweb_c2im-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
05-01 15:13:32.355: E/AndroidRuntime(17907): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 05-01 15:13:32.355: E/AndroidRuntime(17907): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
05-01 15:13:32.355: E/AndroidRuntime(17907): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
05-01 15:13:32.355: E/AndroidRuntime(17907): ... 15 more
05-01 15:13:32.355: E/AndroidRuntime(17907): Suppressed: java.lang.ClassNotFoundException: com.sentinor.gmcobweb_c2im.MainActivity$2
05-01 15:13:32.355: E/AndroidRuntime(17907): at java.lang.Class.classForName(Native Method)
05-01 15:13:32.355: E/AndroidRuntime(17907): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
05-01 15:13:32.355: E/AndroidRuntime(17907): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
05-01 15:13:32.355: E/AndroidRuntime(17907): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
05-01 15:13:32.355: E/AndroidRuntime(17907): ... 16 more 05-01 15:13:32.355: E/AndroidRuntime(17907): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available