1

私のデバイスで完全に動作する 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}
4

2 に答える 2

0

AVD のVM ヒープ メモリ64に増やしてみてください。

メニュー でWindow => Android Virtual Device Manager => 使用するavdを選択=>編集ボタンをクリックします。

古いバージョンの ADT。

ここに画像の説明を入力

新しいバージョンの ADT。

ここに画像の説明を入力

新しい AVD を作成すると、デフォルトで 24 個の VM ヒープが必要になります。ただし、アプリケーションはより多くのメモリを必要とするため、64 に設定します。

于 2013-05-07T13:12:15.080 に答える