Android Hello World应用程序崩溃:来自Surface.lockCanvasNative的IllegalArgumentException

时间:2011-06-26 07:04:43

标签: android exception

我正在尝试运行最简单的Hello World example应用程序,看起来我可以崩溃,即使它只显示了一个TextView。

重现步骤:在模拟器(1.5)中启动它。打开应用程序 - 显示文本视图,然后按“结束通话”按钮锁定手机。按“菜单”解锁,然后按“返回”。应用程序崩溃与“进程android.process.acore已意外停止...”和强制关闭按钮。它不会一直发生,但我每次擦除用户数据后都能重现它。

我想知道默认的Hello World是否缺少一个被认为对于hello世界来说过于先进的细节......基本示例中的这些问题看起来并不那么令人鼓舞=)

知道缺少什么细节以及如何避免这种崩溃?

Stack(我截断了时间戳):

37.478: DEBUG/KeyguardViewMediator(576): wakeWhenReadyLocked(82)
37.481: DEBUG/KeyguardViewMediator(576): handleWakeWhenReady(82)
37.481: DEBUG/KeyguardViewMediator(576): pokeWakelock(5000)
39.110: DEBUG/KeyguardViewMediator(576): pokeWakelock(5000)
39.140: WARN/InputManagerService(576): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@436e3fc0
40.990: ERROR/IMemory(679): binder=0x238aa8 transaction failed fd=-2147483647, size=0, err=-2147483646 (Unknown error: 2147483646)
40.990: ERROR/IMemory(679): cannot dup fd=-2147483647, size=0, err=-2147483646 (Bad file number)
40.990: ERROR/IMemory(679): cannot map BpMemoryHeap (binder=0x238aa8), size=0, fd=-1 (Bad file number)
40.990: ERROR/Surface(679): Couldn't map Surface's heap (binder=0x238aa8, heap=0x238b00)
40.990: DEBUG/AndroidRuntime(679): Shutting down VM
40.990: WARN/dalvikvm(679): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
40.990: ERROR/AndroidRuntime(679): Uncaught handler: thread main exiting due to uncaught exception
40.990: ERROR/AndroidRuntime(679): java.lang.IllegalArgumentException
40.990: ERROR/AndroidRuntime(679):     at android.view.Surface.lockCanvasNative(Native Method)
40.990: ERROR/AndroidRuntime(679):     at android.view.Surface.lockCanvas(Surface.java:196)
40.990: ERROR/AndroidRuntime(679):     at android.view.ViewRoot.draw(ViewRoot.java:1175)
40.990: ERROR/AndroidRuntime(679):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1030)
40.990: ERROR/AndroidRuntime(679):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)
40.990: ERROR/AndroidRuntime(679):     at android.os.Handler.dispatchMessage(Handler.java:99)
40.990: ERROR/AndroidRuntime(679):     at android.os.Looper.loop(Looper.java:123)
40.990: ERROR/AndroidRuntime(679):     at android.app.ActivityThread.main(ActivityThread.java:3948)
40.990: ERROR/AndroidRuntime(679):     at java.lang.reflect.Method.invokeNative(Native Method)
40.990: ERROR/AndroidRuntime(679):     at java.lang.reflect.Method.invoke(Method.java:521)
40.990: ERROR/AndroidRuntime(679):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
40.990: ERROR/AndroidRuntime(679):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
40.990: ERROR/AndroidRuntime(679):     at dalvik.system.NativeStart.main(Native Method)
41.000: INFO/Process(576): Sending signal. PID: 679 SIG: 3
41.000: INFO/dalvikvm(679): threadid=7: reacting to signal 3
41.030: ERROR/ActivityThread(576): Failed to find provider info for android.server.checkin
41.030: ERROR/Checkin(576): Error reporting crash: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/crashes
41.070: INFO/dalvikvm(679): Wrote stack trace to '/data/anr/traces.txt'
50.940: WARN/ActivityManager(576): Launch timeout has expired, giving up wake lock!
50.980: WARN/ActivityManager(576): Activity idle timeout for HistoryRecord{4366ac40 {com.android.launcher/com.android.launcher.Launcher}}

1 个答案:

答案 0 :(得分:0)

听起来更像是你的模拟器出了问题。为什么不删除你的模拟器并创建一个新模拟器并重新尝试一个新项目。

希望对你有所帮助。 BTW为什么你在1.5上使用模拟器?开始构建最小2.1的应用程序。

祝你好运。