我创建了一个可以在我的设备上完美运行的 Android 应用程序。我已将 APK 发送给某人,它也可以在他的设备上运行。
有一次,他想修改应用程序中的某些内容。所以我把完整的源代码发给了他。
现在他告诉我源代码对他不起作用。它编译得很好,但是当它从 Eclipse 中运行它时它会崩溃。
我 100% 确定我已经向他发送了正确的代码,这对我来说很好用。显然没有理由崩溃。
我让他给我发送 logcat 错误,我似乎没有发现问题。
这是(部分):
05-06 08:56:10.954: D/dalvikvm(266): GC_FOR_ALLOC freed 2720K, 13% free 27384K/31239K, paused 40ms, total 42ms
05-06 08:56:11.224: D/dalvikvm(266): GC_FOR_ALLOC freed 4048K, 21% free 24747K/31239K, paused 35ms, total 37ms
05-06 08:56:11.224: I/dalvikvm-heap(266): Forcing collection of SoftReferences for 3785616-byte allocation
05-06 08:56:11.284: D/dalvikvm(266): GC_BEFORE_OOM freed 31K, 21% free 24715K/31239K, paused 54ms, total 54ms
05-06 08:56:11.284: E/dalvikvm-heap(266): Out of memory on a 3785616-byte allocation.
05-06 08:56:11.284: I/dalvikvm(266): "main" prio=5 tid=1 RUNNABLE
05-06 08:56:11.284: I/dalvikvm(266): | group="main" sCount=0 dsCount=0 obj=0x2bc9b568 self=0x55569be0
05-06 08:56:11.284: I/dalvikvm(266): | sysTid=266 nice=0 sched=0/0 cgrp=apps handle=716000068
05-06 08:56:11.284: I/dalvikvm(266): | schedstat=( 4120000000 11950000000 1161 ) utm=335 stm=77 core=0
05-06 08:56:11.294: I/dalvikvm(266): at android.graphics.Bitmap.nativeCreate(Native Method)
05-06 08:56:11.294: I/dalvikvm(266): at android.graphics.Bitmap.createBitmap(Bitmap.java:640)
05-06 08:56:11.294: I/dalvikvm(266): at android.graphics.Bitmap.createBitmap(Bitmap.java:620)
05-06 08:56:11.294: I/dalvikvm(266): at com.android.launcher2.Cling.dispatchDraw(Cling.java:208)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.View.buildDrawingCache(View.java:12717)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.View.draw(View.java:13154)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.View.draw(View.java:13461)
05-06 08:56:11.294: I/dalvikvm(266): at android.widget.FrameLayout.draw(FrameLayout.java:467)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.View.draw(View.java:13342)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2806)
05-06 08:56:11.294: I/dalvikvm(266): at com.android.launcher2.DragLayer.dispatchDraw(DragLayer.java:743)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.View.draw(View.java:13461)
05-06 08:56:11.294: I/dalvikvm(266): at android.widget.FrameLayout.draw(FrameLayout.java:467)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.View.draw(View.java:13342)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.View.draw(View.java:13340)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.View.draw(View.java:13340)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.View.draw(View.java:13461)
05-06 08:56:11.294: I/dalvikvm(266): at android.widget.FrameLayout.draw(FrameLayout.java:467)
05-06 08:56:11.294: I/dalvikvm(266): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2183)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2258)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2153)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2021)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1832)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4214)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.Choreographer.doFrame(Choreographer.java:525)
05-06 08:56:11.294: I/dalvikvm(266): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
05-06 08:56:11.294: I/dalvikvm(266): at android.os.Handler.handleCallback(Handler.java:615)
05-06 08:56:11.294: I/dalvikvm(266): at android.os.Handler.dispatchMessage(Handler.java:92)
05-06 08:56:11.294: I/dalvikvm(266): at android.os.Looper.loop(Looper.java:137)
05-06 08:56:11.294: I/dalvikvm(266): at android.app.ActivityThread.main(ActivityThread.java:4745)
05-06 08:56:11.294: I/dalvikvm(266): at java.lang.reflect.Method.invokeNative(Native Method)
05-06 08:56:11.294: I/dalvikvm(266): at java.lang.reflect.Method.invoke(Method.java:511)
05-06 08:56:11.294: I/dalvikvm(266): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
05-06 08:56:11.294: I/dalvikvm(266): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
05-06 08:56:11.294: I/dalvikvm(266): at dalvik.system.NativeStart.main(Native Method)
05-06 08:56:11.294: D/AndroidRuntime(266): Shutting down VM
05-06 08:56:11.294: W/dalvikvm(266): threadid=1: thread exiting with uncaught exception (group=0x2bc9a300)
05-06 08:56:11.334: E/AndroidRuntime(266): FATAL EXCEPTION: main
05-06 08:56:11.334: E/AndroidRuntime(266): java.lang.OutOfMemoryError
05-06 08:56:11.334: E/AndroidRuntime(266): at android.graphics.Bitmap.nativeCreate(Native Method)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.graphics.Bitmap.createBitmap(Bitmap.java:640)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.graphics.Bitmap.createBitmap(Bitmap.java:620)
05-06 08:56:11.334: E/AndroidRuntime(266): at com.android.launcher2.Cling.dispatchDraw(Cling.java:208)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.View.buildDrawingCache(View.java:12717)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.View.draw(View.java:13154)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.View.draw(View.java:13461)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.widget.FrameLayout.draw(FrameLayout.java:467)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.View.draw(View.java:13342)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2806)
05-06 08:56:11.334: E/AndroidRuntime(266): at com.android.launcher2.DragLayer.dispatchDraw(DragLayer.java:743)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.View.draw(View.java:13461)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.widget.FrameLayout.draw(FrameLayout.java:467)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.View.draw(View.java:13342)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.View.draw(View.java:13340)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.View.draw(View.java:13340)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewGroup.drawChild(ViewGroup.java:2929)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2799)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.View.draw(View.java:13461)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.widget.FrameLayout.draw(FrameLayout.java:467)
05-06 08:56:11.334: E/AndroidRuntime(266): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2183)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2258)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2153)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2021)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1832)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4214)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.Choreographer.doFrame(Choreographer.java:525)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.os.Handler.handleCallback(Handler.java:615)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.os.Handler.dispatchMessage(Handler.java:92)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.os.Looper.loop(Looper.java:137)
05-06 08:56:11.334: E/AndroidRuntime(266): at android.app.ActivityThread.main(ActivityThread.java:4745)
05-06 08:56:11.334: E/AndroidRuntime(266): at java.lang.reflect.Method.invokeNative(Native Method)
05-06 08:56:11.334: E/AndroidRuntime(266): at java.lang.reflect.Method.invoke(Method.java:511)
05-06 08:56:11.334: E/AndroidRuntime(266): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
05-06 08:56:11.334: E/AndroidRuntime(266): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
05-06 08:56:11.334: E/AndroidRuntime(266): at dalvik.system.NativeStart.main(Native Method)
05-06 08:56:11.346: W/ActivityManager(152): Force finishing activity com.android.launcher/com.android.launcher2.Launcher
05-06 08:56:11.449: E/libEGL(36): called unimplemented OpenGL ES API
05-06 08:56:11.449: E/libEGL(36): called unimplemented OpenGL ES API
05-06 08:56:11.449: E/libEGL(36): called unimplemented OpenGL ES API
05-06 08:56:11.449: E/libEGL(36): called unimplemented OpenGL ES API
05-06 08:56:11.449: E/libEGL(36): called unimplemented OpenGL ES API
05-06 08:56:11.449: E/libEGL(36): called unimplemented OpenGL ES API
05-06 08:56:11.449: E/libEGL(36): called unimplemented OpenGL ES API
05-06 08:56:11.449: E/libEGL(36): called unimplemented OpenGL ES API
05-06 08:56:11.449: E/libEGL(36): called unimplemented OpenGL ES API
05-06 08:56:11.449: E/libEGL(36): called unimplemented OpenGL ES API
05-06 08:56:11.449: W/WindowManager(152): Failure taking screenshot for (266x425) to layer 21005
05-06 08:56:11.954: W/ActivityManager(152): Activity pause timeout for ActivityRecord{2c584740 com.android.launcher/com.android.launcher2.Launcher}
05-06 08:56:11.954: I/ActivityManager(152): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.android.launcher/com.android.launcher2.Launcher u=0} from pid 0
05-06 08:56:22.035: W/ActivityManager(152): Activity idle timeout for ActivityRecord{2c57af08 com.android.launcher/com.android.launcher2.Launcher}