Hard crash with native elements on device?

Hi there,

I'm new to Corona / Lua within the last few months, and I've encountered an error that is driving me nuts. The app tests out fine and without error on the windows simulator, but I'm encountering a hard crash to desktop when executing on my device (HTC G2).

The crash only appeared once I implemented the native.newTextField and native.setKeyboardFocus elements, and I can't get it to replicate regularly. When I AM able to get the app to crash, it's when certain elements on the screen are animating, and ONLY when either/or of the native elements are present on the screen. It also seems to be very moody -- sometimes it crashes, and other times it doesn't, all while I'm completing the exact same actions.

Anyone else experiencing similar issues? Any help would be greatly appreciated.

EDIT: Forgot to mention, I'm using build 591 :)

Log cat below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
I/DEBUG   ( 1210): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *
**
I/DEBUG   ( 1210): Build fingerprint: 'tmobile/htc_vision/vision/vision:2.2/FRF9
1/277427:user/release-keys'
I/DEBUG   ( 1210): pid: 11471, tid: 11480  >>> com.appsimple <<<
I/DEBUG   ( 1210): signal 11 (SIGSEGV), fault addr 00000070
I/DEBUG   ( 1210):  r0 00000070  r1 00000010  r2 00000010  r3 ffffd8f0
I/DEBUG   ( 1210):  r4 00457368  r5 00000010  r6 80935ba4  r7 0032ae78
I/DEBUG   ( 1210):  r8 47726b04  r9 809133f8  10 804a13f4  fp 41868ec4
I/DEBUG   ( 1210):  ip 808bace8  sp 47726a98  lr 8084ea6c  pc 8084ea70  cpsr 60000010
I/DEBUG   ( 1210):  d0  6472656767756265  d1  0000000000000000
I/DEBUG   ( 1210):  d2  0000000000000000  d3  0000000000000000
I/DEBUG   ( 1210):  d4  070607060070079c  d5  0000000000001c07
I/DEBUG   ( 1210):  d6  0000043f00890000  d7  0000000000000000
I/DEBUG   ( 1210):  d8  0000000000000028  d9  43e0000000000000
I/DEBUG   ( 1210):  d10 41dfffffffc00000  d11 c3e0000000000000
I/DEBUG   ( 1210):  d12 0000000000000000  d13 0000000000000000
I/DEBUG   ( 1210):  d14 0000000000000000  d15 0000000000000000
I/DEBUG   ( 1210):  d16 0000300044d653a8  d17 3ff0000000000000
I/DEBUG   ( 1210):  d18 3e83d1aed436d89c  d19 bfaa0180ef43cf28
I/DEBUG   ( 1210):  d20 4000000000000000  d21 3f114c46bbdfed0f
I/DEBUG   ( 1210):  d22 bebbacfa03715839  d23 3fd35eb5bffdc000
I/DEBUG   ( 1210):  d24 3e66376972bea4d0  d25 bff0000000000000
I/DEBUG   ( 1210):  d26 3ff0000000000000  d27 bfaa0180ef43cf25
I/DEBUG   ( 1210):  d28 bffb66c25f879887  d29 3fd35eb65e8b36a2
I/DEBUG   ( 1210):  d30 bc77d94340d4487b  d31 3e83d1aed4400000
I/DEBUG   ( 1210):  scr 60000013
I/DEBUG   ( 1210):
I/DEBUG   ( 1210):          #00  pc 0004ea70  /data/data/com.appsimple/lib/libcorona.so
I/DEBUG   ( 1210):          #01  pc 000fad4c  /data/data/com.appsimple/lib/libcorona.so
I/DEBUG   ( 1210):          #02  pc 000fad64  /data/data/com.appsimple/lib/libcorona.so
I/DEBUG   ( 1210):          #03  pc 000fadf0  /data/data/com.appsimple/lib/libcorona.so
I/DEBUG   ( 1210):          #04  pc 000e5350  /data/data/com.appsimple/lib/libcorona.so
I/DEBUG   ( 1210):          #05  pc 00016df4  /system/lib/libdvm.so
I/DEBUG   ( 1210):
I/DEBUG   ( 1210): code around pc:
I/DEBUG   ( 1210): 8084ea50 e5843008 e28dd00c e8bd8030 e92d4070
I/DEBUG   ( 1210): 8084ea60 e1a05002 e1a04000 ebfffb85 e1a01005
I/DEBUG   ( 1210): 8084ea70 e5900000 eb00510d e5943008 e283c010
I/DEBUG   ( 1210): 8084ea80 e584c008 e5902008 e1c000d0 e5832008
I/DEBUG   ( 1210): 8084ea90 e1c300f0 e8bd8070 e92d4010 e1a04000
I/DEBUG   ( 1210):
I/DEBUG   ( 1210): code around lr:
I/DEBUG   ( 1210): 8084ea4c e2833010 e5843008 e28dd00c e8bd8030
I/DEBUG   ( 1210): 8084ea5c e92d4070 e1a05002 e1a04000 ebfffb85
I/DEBUG   ( 1210): 8084ea6c e1a01005 e5900000 eb00510d e5943008
I/DEBUG   ( 1210): 8084ea7c e283c010 e584c008 e5902008 e1c000d0
I/DEBUG   ( 1210): 8084ea8c e5832008 e1c300f0 e8bd8070 e92d4010
I/DEBUG   ( 1210):
I/DEBUG   ( 1210): stack:
I/DEBUG   ( 1210):     47726a58  41868f34
I/DEBUG   ( 1210):     47726a5c  43264000  /dev/ashmem/SurfaceFlinger Client control-block (deleted)
I/DEBUG   ( 1210):     47726a60  43264088  /dev/ashmem/SurfaceFlinger Client control-block (deleted)
I/DEBUG   ( 1210):     47726a64  ffffc0c8
I/DEBUG   ( 1210):     47726a68  ffffc298
I/DEBUG   ( 1210):     47726a6c  43264004  /dev/ashmem/SurfaceFlinger Client control-block (deleted)
I/DEBUG   ( 1210):     47726a70  ac712518  /system/lib/libsurfaceflinger_client.so
I/DEBUG   ( 1210):     47726a74  ac71267a  /system/lib/libsurfaceflinger_client.so
I/DEBUG   ( 1210):     47726a78  47726aa4
I/DEBUG   ( 1210):     47726a7c  002585a8  [heap]
I/DEBUG   ( 1210):     47726a80  00258f00  [heap]
I/DEBUG   ( 1210):     47726a84  00258f00  [heap]
I/DEBUG   ( 1210):     47726a88  00000000
I/DEBUG   ( 1210):     47726a8c  afd10280  /system/lib/libc.so
I/DEBUG   ( 1210):     47726a90  df002777
I/DEBUG   ( 1210):     47726a94  e3a070ad
I/DEBUG   ( 1210): #00 47726a98  00000001
I/DEBUG   ( 1210):     47726a9c  00457368  [heap]
I/DEBUG   ( 1210):     47726aa0  80935ba4  /data/data/com.appsimple/lib/libcorona.so
I/DEBUG   ( 1210):     47726aa4  808fad50  /data/data/com.appsimple/lib/libcorona.so
I/DEBUG   ( 1210): #01 47726aa8  47726adc
I/DEBUG   ( 1210):     47726aac  808fad68  /data/data/com.appsimple/lib/libcorona.so
I/BootReceiver( 1300): Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE)
I/ActivityManager( 1300): Process com.appsimple (pid 11471) has died.
I/WindowManager( 1300): WIN DEATH: Window{452671a8 SurfaceView paused=false}
I/WindowManager( 1300): WIN DEATH: Window{45240bf0 com.appsimple/com.ansca.corona.CoronaActivity paused=false}

Okay, I think I figured out the problem. To anyone who might have this problem in the future:

My issue seemed to be caused by the "native.setKeyboardFocus(nil)" being fired when either the keyboard wasn't present, or when it was already animating off the screen. My code had an extra button that would remove the text field and keyboard, placed inside of the textField listener.

I made the mistake of thinking that "native.setKeyboardFocus(nil)" would just get ignored if the keyboard wasn't already out, however Corona seems to slip up (crash) occasionally if they keyboard isn't fully deployed. Fixing it was as easy as making sure the code wasn't redundantly trying to remove the keyboard on the keyboard listener function (e.g. no "native.setKeyboardFocus(nil)" inside the function that is called when the keyboard returns "submitted"), and all seems to be running much smoother now.

Hope this helps!

views:1713 update:2011/10/8 8:54:25
corona forums © 2003-2011