Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5381] Android: webView Ti.App.fireEvent() crash App in Android 2.3.3

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2011-11-03T10:49:31.000+0000
Affected Version/sRelease 1.7.2, Release 1.8.0
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, bug, crash, event, fire, fireevent, webview
ReporterKarol Pomaski
AssigneeShak Hossain
Created2011-09-27T08:18:02.000+0000
Updated2012-03-04T21:03:18.000+0000

Description

Problem

Ti.App.fireEvent inside webview makes the app to crash. It works correctly with Android 2.2 and 2.1 but it does not work with Android 2.3.3

Reproducible Steps

1. Execute the attached project 2. Press "Click to open new window"

Crash Log

I/dalvikvm-heap(  607): Grow heap (frag case) to 6.942MB for 87396-byte allocation
D/dalvikvm(  607): GC_FOR_MALLOC freed 0K, 45% free 3778K/6855K, external 906K/1038K, paused 45ms
W/TiAnalyticsSvc(  607): (Thread-18) [2295,31218] Stopping Analytics Service
W/dalvikvm(  607): JNI WARNING: jarray 0x40510840 points to non-array object (Ljava/lang/String;)
I/dalvikvm(  607): "WebViewCoreThread" prio=5 tid=14 NATIVE
I/dalvikvm(  607):   | group="main" sCount=0 dsCount=0 obj=0x405eed18 self=0x209f98
I/dalvikvm(  607):   | sysTid=621 nice=0 sched=0/0 cgrp=default handle=2172432
I/dalvikvm(  607):   | schedstat=( 265925031 660541055 62 )
I/dalvikvm(  607):   at android.webkit.WebViewCore.nativeTouchUp(Native Method)
I/dalvikvm(  607):   at android.webkit.WebViewCore.nativeTouchUp(Native Method)
I/dalvikvm(  607):   at android.webkit.WebViewCore.access$3300(WebViewCore.java:53)
I/dalvikvm(  607):   at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:1158)
I/dalvikvm(  607):   at android.os.Handler.dispatchMessage(Handler.java:99)
I/dalvikvm(  607):   at android.os.Looper.loop(Looper.java:130)
I/dalvikvm(  607):   at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:629)
I/dalvikvm(  607):   at java.lang.Thread.run(Thread.java:1019)
I/dalvikvm(  607): 
E/dalvikvm(  607): VM aborting
I/DEBUG   (   31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (   31): Build fingerprint: 'generic/google_sdk/generic:2.3.4/GINGERBREAD/123630:eng/test-keys'
I/DEBUG   (   31): pid: 607, tid: 621  >>> com.appcelerator.webview <<<
I/DEBUG   (   31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
I/DEBUG   (   31):  r0 fffffec4  r1 deadd00d  r2 00000026  r3 00000000
I/DEBUG   (   31):  r4 800a45c0  r5 40510840  r6 80085acc  r7 000e1e38
I/DEBUG   (   31):  r8 461a0b54  r9 46075e3c  10 46075e24  fp 437cd8ec
I/DEBUG   (   31):  ip 800a4720  sp 461a0348  lr afd19375  pc 80045a4a  cpsr 20000030
I/DEBUG   (   31):          #00  pc 00045a4a  /system/lib/libdvm.so
I/DEBUG   (   31):          #01  pc 00037748  /system/lib/libdvm.so
I/DEBUG   (   31):          #02  pc 00039a10  /system/lib/libdvm.so
I/DEBUG   (   31):          #03  pc 0003a4ec  /system/lib/libdvm.so
I/DEBUG   (   31):          #04  pc 0029864e  /system/lib/libwebcore.so
I/DEBUG   (   31):          #05  pc 00211d1c  /system/lib/libwebcore.so
I/DEBUG   (   31):          #06  pc 001133be  /system/lib/libwebcore.so
I/DEBUG   (   31):          #07  pc 002127e8  /system/lib/libwebcore.so
I/DEBUG   (   31):          #08  pc 002c6de6  /system/lib/libwebcore.so
I/DEBUG   (   31):          #09  pc 002ca13e  /system/lib/libwebcore.so
I/DEBUG   (   31):          #10  pc 002d8028  /system/lib/libwebcore.so
I/DEBUG   (   31):          #11  pc 002cf760  /system/lib/libwebcore.so
I/DEBUG   (   31):          #12  pc 0020ca9c  /system/lib/libwebcore.so
I/DEBUG   (   31):          #13  pc 001a0b16  /system/lib/libwebcore.so
I/DEBUG   (   31):          #14  pc 001a706c  /system/lib/libwebcore.so
I/DEBUG   (   31):          #15  pc 001a4e4c  /system/lib/libwebcore.so
I/DEBUG   (   31):          #16  pc 001a4f92  /system/lib/libwebcore.so
I/DEBUG   (   31):          #17  pc 001a821a  /system/lib/libwebcore.so
I/DEBUG   (   31):          #18  pc 001a83ae  /system/lib/libwebcore.so
I/DEBUG   (   31):          #19  pc 00064a98  /system/lib/libwebcore.so
I/DEBUG   (   31):          #20  pc 0006563e  /system/lib/libwebcore.so
I/DEBUG   (   31):          #21  pc 00125692  /system/lib/libwebcore.so
I/DEBUG   (   31):          #22  pc 0012578a  /system/lib/libwebcore.so
I/DEBUG   (   31):          #23  pc 001257b0  /system/lib/libwebcore.so
I/DEBUG   (   31):          #24  pc 00017d74  /system/lib/libdvm.so
I/DEBUG   (   31): 
I/DEBUG   (   31): code around pc:
I/DEBUG   (   31): 80045a28 447a4479 ed0cf7d1 20004c09 ee34f7d1 
I/DEBUG   (   31): 80045a38 447c4808 6bdb5823 d0002b00 49064798 
I/DEBUG   (   31): 80045a48 700a2226 eea0f7d1 000436b7 00045275 
I/DEBUG   (   31): 80045a58 0005eb82 fffffec4 deadd00d b510b40e 
I/DEBUG   (   31): 80045a68 4c0a4b09 447bb083 aa05591b 6b5bca02 
I/DEBUG   (   31): 
I/DEBUG   (   31): code around lr:
I/DEBUG   (   31): afd19354 b0834a0d 589c447b 26009001 686768a5 
I/DEBUG   (   31): afd19364 220ce008 2b005eab 1c28d003 47889901 
I/DEBUG   (   31): afd19374 35544306 d5f43f01 2c006824 b003d1ee 
I/DEBUG   (   31): afd19384 bdf01c30 000281a8 ffffff88 1c0fb5f0 
I/DEBUG   (   31): afd19394 43551c3d a904b087 1c16ac01 604d9004 
I/DEBUG   (   31): 
I/DEBUG   (   31): stack:
I/DEBUG   (   31):     461a0308  00000015  
I/DEBUG   (   31):     461a030c  afd18407  /system/lib/libc.so
I/DEBUG   (   31):     461a0310  afd4270c  /system/lib/libc.so
I/DEBUG   (   31):     461a0314  afd426b8  /system/lib/libc.so
I/DEBUG   (   31):     461a0318  00000000  
I/DEBUG   (   31):     461a031c  afd19375  /system/lib/libc.so
I/DEBUG   (   31):     461a0320  00209f98  [heap]
I/DEBUG   (   31):     461a0324  afd183d9  /system/lib/libc.so
I/DEBUG   (   31):     461a0328  000e1e38  [heap]
I/DEBUG   (   31):     461a032c  0005eb82  [heap]
I/DEBUG   (   31):     461a0330  40510840  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (   31):     461a0334  80085acc  /system/lib/libdvm.so
I/DEBUG   (   31):     461a0338  000e1e38  [heap]
I/DEBUG   (   31):     461a033c  afd18437  /system/lib/libc.so
I/DEBUG   (   31):     461a0340  df002777  
I/DEBUG   (   31):     461a0344  e3a070ad  
I/DEBUG   (   31): #00 461a0348  00000001  
I/DEBUG   (   31):     461a034c  8003774d  /system/lib/libdvm.so
I/DEBUG   (   31): #01 461a0350  00000001  
I/DEBUG   (   31):     461a0354  80039a15  /system/lib/libdvm.so
D/Zygote  (   33): Process 607 terminated by signal (11)
I/ActivityManager(   62): Process com.appcelerator.webview (pid 607) has died.

Sample Code

App.js file
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
var label1 = Ti.UI.createWebView({
	url: 'index.html',
	width: 200,
	height: 200
});

win1.add(label1);
Ti.App.addEventListener('open_browser', function(e){
  alert(e.url);
});
win1.open();

index.html file
<html>
<head>
<script type="text/javascript">
function open_browser(){
   Ti.App.fireEvent("open_browser", {url: 'http://www.test.com'});
}
</script>
</head>
<body>
<a href="#" onclick="open_browser( );return false;">Click to open new window</a>
</body>
</html>

Associated HelpDesk Ticket

http://appc.me/a/APP-475444

Attachments

FileDateSize
webview.zip2011-09-27T08:18:02.000+00002320696

Comments

  1. Pham Tuan Anh 2011-12-11

    Hi team, I tested on version 1.7.5 and still meet this issue. This issue was solved on SDK version 1.8.0, right? Thanks & Best regards, Tuan Anh
  2. Kevin Mack 2012-03-04

    I am also having this same issue, I have this bug outlined in QA here: http://developer.appcelerator.com/question/133174/html-page-webview-event-to-use-native-iosandroid-functionality-like-a-camera#comment-117034

JSON Source