Obsolete
Status Update
Comments
ta...@gmail.com <ta...@gmail.com> #2
This bug is critical! Please fix it ASAP!
ad...@gmail.com <ad...@gmail.com> #3
Broke for me too
da...@gmail.com <da...@gmail.com> #4
This should be set to High Priority. As other comments allude, this is critical and is causing our app (and I am sure others) to crash and potential workarounds are pretty ugly.
fc...@gmail.com <fc...@gmail.com> #5
It's a silly JNI mistake, please fix it before 2.3 goes alive on devices
ja...@gmail.com <ja...@gmail.com> #6
Everyone, tell everyone you know to star this issue! This is a crucial, crucial bug to fix.
eh...@gmail.com <eh...@gmail.com> #7
Please fix asap!
ya...@gmail.com <ya...@gmail.com> #8
36 people starred this issue and may be notified of changes. How do I star it?! I agree, this is a pretty big issue, although if you target for 2.2 or below you should be ok.
to...@gmail.com <to...@gmail.com> #9
Hey yakkyjunk, targeting 2.2 does not resolve the issue. Anything that uses that functionality and is running on 2.3 will encounter this and crash.
(Click on the star next to the word 'Issue' in the blue title bar)
(Click on the star next to the word 'Issue' in the blue title bar)
si...@gmail.com <si...@gmail.com> #10
This is a critical issue for us as well.
co...@gmail.com <co...@gmail.com> #11
I can verify the crash using these other sample projects:
https://github.com/commonsguy/cw-advandroid/tree/master/WebView/GeoWeb1
https://github.com/commonsguy/cw-advandroid/tree/master/WebView/GeoWeb2
https://github.com/commonsguy/cw-abj/tree/master/PhoneGap/Checklist
Note that the latter is a PhoneGap project, suggesting that all PhoneGap-powered apps will fail on Android 2.3 as well.
All of these projects work fine on Android 2.2.
--
Mark Murphy (a Commons Guy)
mmurphy@commonsware.com
Note that the latter is a PhoneGap project, suggesting that all PhoneGap-powered apps will fail on Android 2.3 as well.
All of these projects work fine on Android 2.2.
--
Mark Murphy (a Commons Guy)
mmurphy@commonsware.com
co...@gmail.com <co...@gmail.com> #12
Actually, those samples I just posted are not good ones, as there may be a separate SIGSEGV related to mock GPS data sent via DDMS. Here is a really tiny sample project that does demonstrate the addJavascriptInterface() problem:
http://commonsware.com/misc/SIGSEGVOne.zip
--
Mark Murphy (a Commons Guy)
mmurphy@commonsware.com
--
Mark Murphy (a Commons Guy)
mmurphy@commonsware.com
sk...@gmail.com <sk...@gmail.com> #13
I was just about to post very similar to Mark's example. My results are exactly the same - crash 100% of the time.
ch...@gmail.com <ch...@gmail.com> #15
The above link is only a partial workaround.
Major issues:
This does not allow for a synchronous response from java. Any javascript code can be rewritten with return callbacks from java in a continuation passing style, but this generally requires a complete restructuring of the affected code base.
The javascript to java interface presented here does not persist across page loads. The original (broken) mechanism is available to any javascript executing within the webview, whether in the parent document or in any nested iframe, and is unaffected by content reloading.
Major issues:
This does not allow for a synchronous response from java. Any javascript code can be rewritten with return callbacks from java in a continuation passing style, but this generally requires a complete restructuring of the affected code base.
The javascript to java interface presented here does not persist across page loads. The original (broken) mechanism is available to any javascript executing within the webview, whether in the parent document or in any nested iframe, and is unaffected by content reloading.
ja...@gmail.com <ja...@gmail.com> #16
Agreed on both points. That's why this is a workaround, and only for simple cases; the real solution is for the Android team to actually fix the root cause.
to...@gmail.com <to...@gmail.com> #17
If you're really looking for a workaround, I think it'd be easier to override the WebChromeClient's onJSAlert method and write a simple parser. You still can't return values, but you don't have to reload the page.
That said, this does not work for me at all. I'd have to rewrite almost all of my code to get this working, which is pretty terrible.
That said, this does not work for me at all. I'd have to rewrite almost all of my code to get this working, which is pretty terrible.
fc...@gmail.com <fc...@gmail.com> #18
A good news for you guys, the crash doesn't happen on real Nexus S device, so basically this is another bug on emulator as NIO on 2.2
ro...@google.com <ro...@google.com> #19
Repro'd on the 2.3 emulator; verified that this is NOT reproducible on a Nexus S.
to...@gmail.com <to...@gmail.com> #20
Great, that's good news. Any idea when we might get a new emulator build? Also, is there any way to get early device builds for the Nexus One? Alternatively, is there a program we can apply to for early access in the future?
si...@gmail.com <si...@gmail.com> #21
Please solve his.
ab...@gmail.com <ab...@gmail.com> #22
I encountered this issue too. I upgraded the SDK to include version 2.3 of the emulator and our app crashed, so I decided to check the WebViewDemo app to make sure it wasn't a problem with our app. The demo app crashed right away, and that led me to this page. Hopefully they can fix it soon, because this JavaScript functionality is a major part of our app.
an...@gmail.com <an...@gmail.com> #23
learn to qa
hn...@gmail.com <hn...@gmail.com> #24
please solve as soon as, my app depend on the javascript.
hn...@gmail.com <hn...@gmail.com> #25
[Comment deleted]
al...@gmail.com <al...@gmail.com> #26
Grrr, client project testing is not possible on 2.3 emulator because of this issue and 2.2 has issue with camera. Disappointed with emulator.
at...@gmail.com <at...@gmail.com> #27
This is a critical issue for us as well, please fix this ASAP.
Thanks.
Thanks.
us...@gmail.com <us...@gmail.com> #28
This is a big issue, please fix this quickly.
Thanks
Thanks
je...@gmail.com <je...@gmail.com> #29
I'm also experiencing this issue in the 2.3 emulator... when including js in the webview demo... the
ho...@gmail.com <ho...@gmail.com> #30
Just want to confirm that are you guys getting the following like I do?
12-20 19:29:34.582: WARN/dalvikvm(725): JNI WARNING: jarray 0x4074f6e0 points to non-array object (Ljava/lang/String;)
12-20 19:29:34.622: INFO/dalvikvm(725): "WebViewCoreThread" prio=5 tid=9 NATIVE
12-20 19:29:34.622: INFO/dalvikvm(725): | group="main" sCount=0 dsCount=0 obj=0x40521328 self=0x26bea8
12-20 19:29:34.622: INFO/dalvikvm(725): | sysTid=734 nice=0 sched=0/0 cgrp=default handle=2539488
12-20 19:29:34.632: INFO/dalvikvm(725): | schedstat=( 5341953614 5808331660 581 )
12-20 19:29:34.632: INFO/dalvikvm(725): at android.webkit.WebViewCore.nativeTouchUp(Native Method)
12-20 19:29:34.632: INFO/dalvikvm(725): at android.webkit.WebViewCore.nativeTouchUp(Native Method)
12-20 19:29:34.642: INFO/dalvikvm(725): at android.webkit.WebViewCore.access$3300(WebViewCore.java:53)
12-20 19:29:34.652: INFO/dalvikvm(725): at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:1158)
12-20 19:29:34.652: INFO/dalvikvm(725): at android.os.Handler.dispatchMessage(Handler.java:99)
12-20 19:29:34.652: INFO/dalvikvm(725): at android.os.Looper.loop(Looper.java:123)
12-20 19:29:34.652: INFO/dalvikvm(725): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:629)
12-20 19:29:34.662: INFO/dalvikvm(725): at java.lang.Thread.run(Thread.java:1019)
12-20 19:29:34.672: ERROR/dalvikvm(725): VM aborting
12-20 19:29:34.852: INFO/DEBUG(30): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-20 19:29:34.852: INFO/DEBUG(30): Build fingerprint: 'generic/sdk/generic:2.3/GRH55/79397:eng/test-keys'
12-20 19:29:34.862: INFO/DEBUG(30): pid: 725, tid: 734 >>> XXXXXXXX <<<
12-20 19:29:34.862: INFO/DEBUG(30): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
12-20 19:29:34.872: INFO/DEBUG(30): r0 fffffebc r1 deadd00d r2 00000026 r3 00000000
12-20 19:29:34.872: INFO/DEBUG(30): r4 81da45c8 r5 4074f6e0 r6 81d8592c r7 0026d2b8
12-20 19:29:34.872: INFO/DEBUG(30): r8 44174b54 r9 43d72e4c 10 43d72e34 fp 41edd82c
12-20 19:29:34.891: INFO/DEBUG(30): ip 81da4728 sp 44174348 lr afd19375 pc 81d45a02 cpsr 20000030
12-20 19:29:35.912: INFO/DEBUG(30): #00 pc 00045a02 /system/lib/libdvm.so
12-20 19:29:35.912: INFO/DEBUG(30): #01 pc 000376fc /system/lib/libdvm.so
12-20 19:29:35.912: INFO/DEBUG(30): #02 pc 000399c4 /system/lib/libdvm.so
12-20 19:29:35.922: INFO/DEBUG(30): #03 pc 0003a4a0 /system/lib/libdvm.so
12-20 19:29:35.932: INFO/DEBUG(30): #04 pc 0032b6d6 /system/lib/libwebcore.so
12-20 19:29:35.952: INFO/DEBUG(30): #05 pc 002a4da4 /system/lib/libwebcore.so
12-20 19:29:35.952: INFO/DEBUG(30): #06 pc 001a6136 /system/lib/libwebcore.so
12-20 19:29:35.952: INFO/DEBUG(30): #07 pc 002a5870 /system/lib/libwebcore.so
12-20 19:29:35.962: INFO/DEBUG(30): #08 pc 00359e36 /system/lib/libwebcore.so
12-20 19:29:35.972: INFO/DEBUG(30): #09 pc 0035d18e /system/lib/libwebcore.so
12-20 19:29:35.972: INFO/DEBUG(30): #10 pc 0036b078 /system/lib/libwebcore.so
12-20 19:29:35.982: INFO/DEBUG(30): #11 pc 003627ac /system/lib/libwebcore.so
12-20 19:29:35.982: INFO/DEBUG(30): #12 pc 0029fb24 /system/lib/libwebcore.so
12-20 19:29:36.002: INFO/DEBUG(30): #13 pc 0023367e /system/lib/libwebcore.so
12-20 19:29:36.002: INFO/DEBUG(30): #14 pc 00239c0c /system/lib/libwebcore.so
12-20 19:29:36.011: INFO/DEBUG(30): #15 pc 00237a28 /system/lib/libwebcore.so
12-20 19:29:36.011: INFO/DEBUG(30): #16 pc 00237b32 /system/lib/libwebcore.so
12-20 19:29:36.022: INFO/DEBUG(30): #17 pc 0023adba /system/lib/libwebcore.so
12-20 19:29:36.022: INFO/DEBUG(30): #18 pc 0023af4e /system/lib/libwebcore.so
12-20 19:29:36.042: INFO/DEBUG(30): #19 pc 000f80c0 /system/lib/libwebcore.so
12-20 19:29:36.042: INFO/DEBUG(30): #20 pc 000f8c66 /system/lib/libwebcore.so
12-20 19:29:36.052: INFO/DEBUG(30): #21 pc 001b81fa /system/lib/libwebcore.so
12-20 19:29:36.062: INFO/DEBUG(30): #22 pc 001b82f2 /system/lib/libwebcore.so
12-20 19:29:36.062: INFO/DEBUG(30): #23 pc 001b8318 /system/lib/libwebcore.so
12-20 19:29:36.072: INFO/DEBUG(30): #24 pc 00017d34 /system/lib/libdvm.so
12-20 19:29:36.082: INFO/DEBUG(30): code around pc:
12-20 19:29:36.082: INFO/DEBUG(30): 81d459e0 447a4479 ed0cf7d1 20004c09 ee34f7d1
12-20 19:29:36.092: INFO/DEBUG(30): 81d459f0 447c4808 6bdb5823 d0002b00 49064798
12-20 19:29:36.092: INFO/DEBUG(30): 81d45a00 700a2226 eea0f7d1 0004355f 0004511d
12-20 19:29:36.102: INFO/DEBUG(30): 81d45a10 0005ebd2 fffffebc deadd00d b510b40e
12-20 19:29:36.102: INFO/DEBUG(30): 81d45a20 4c0a4b09 447bb083 aa05591b 6b5bca02
12-20 19:29:36.112: INFO/DEBUG(30): code around lr:
12-20 19:29:36.112: INFO/DEBUG(30): afd19354 b0834a0d 589c447b 26009001 686768a5
12-20 19:29:36.112: INFO/DEBUG(30): afd19364 220ce008 2b005eab 1c28d003 47889901
12-20 19:29:36.122: INFO/DEBUG(30): afd19374 35544306 d5f43f01 2c006824 b003d1ee
12-20 19:29:36.122: INFO/DEBUG(30): afd19384 bdf01c30 000281a8 ffffff88 1c0fb5f0
12-20 19:29:36.132: INFO/DEBUG(30): afd19394 43551c3d a904b087 1c16ac01 604d9004
12-20 19:29:36.132: INFO/DEBUG(30): stack:
12-20 19:29:36.132: INFO/DEBUG(30): 44174308 00000015
12-20 19:29:36.132: INFO/DEBUG(30): 4417430c afd18407 /system/lib/libc.so
12-20 19:29:36.142: INFO/DEBUG(30): 44174310 afd4270c /system/lib/libc.so
12-20 19:29:36.142: INFO/DEBUG(30): 44174314 afd426b8 /system/lib/libc.so
12-20 19:29:36.152: INFO/DEBUG(30): 44174318 00000000
12-20 19:29:36.152: INFO/DEBUG(30): 4417431c afd19375 /system/lib/libc.so
12-20 19:29:36.162: INFO/DEBUG(30): 44174320 0026bea8 [heap]
12-20 19:29:36.162: INFO/DEBUG(30): 44174324 afd183d9 /system/lib/libc.so
12-20 19:29:36.162: INFO/DEBUG(30): 44174328 0026d2b8 [heap]
12-20 19:29:36.172: INFO/DEBUG(30): 4417432c 0005ebd2 [heap]
12-20 19:29:36.172: INFO/DEBUG(30): 44174330 4074f6e0 /dev/ashmem/dalvik-heap (deleted)
12-20 19:29:36.172: INFO/DEBUG(30): 44174334 81d8592c /system/lib/libdvm.so
12-20 19:29:36.182: INFO/DEBUG(30): 44174338 0026d2b8 [heap]
12-20 19:29:36.182: INFO/DEBUG(30): 4417433c afd18437 /system/lib/libc.so
12-20 19:29:36.191: INFO/DEBUG(30): 44174340 df002777
12-20 19:29:36.191: INFO/DEBUG(30): 44174344 e3a070ad
12-20 19:29:36.191: INFO/DEBUG(30): #00 44174348 00000001
12-20 19:29:36.191: INFO/DEBUG(30): 4417434c 81d37701 /system/lib/libdvm.so
12-20 19:29:36.191: INFO/DEBUG(30): #01 44174350 00000001
12-20 19:29:36.191: INFO/DEBUG(30): 44174354 81d399c9 /system/lib/libdvm.so
12-20 19:29:34.582: WARN/dalvikvm(725): JNI WARNING: jarray 0x4074f6e0 points to non-array object (Ljava/lang/String;)
12-20 19:29:34.622: INFO/dalvikvm(725): "WebViewCoreThread" prio=5 tid=9 NATIVE
12-20 19:29:34.622: INFO/dalvikvm(725): | group="main" sCount=0 dsCount=0 obj=0x40521328 self=0x26bea8
12-20 19:29:34.622: INFO/dalvikvm(725): | sysTid=734 nice=0 sched=0/0 cgrp=default handle=2539488
12-20 19:29:34.632: INFO/dalvikvm(725): | schedstat=( 5341953614 5808331660 581 )
12-20 19:29:34.632: INFO/dalvikvm(725): at android.webkit.WebViewCore.nativeTouchUp(Native Method)
12-20 19:29:34.632: INFO/dalvikvm(725): at android.webkit.WebViewCore.nativeTouchUp(Native Method)
12-20 19:29:34.642: INFO/dalvikvm(725): at android.webkit.WebViewCore.access$3300(WebViewCore.java:53)
12-20 19:29:34.652: INFO/dalvikvm(725): at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:1158)
12-20 19:29:34.652: INFO/dalvikvm(725): at android.os.Handler.dispatchMessage(Handler.java:99)
12-20 19:29:34.652: INFO/dalvikvm(725): at android.os.Looper.loop(Looper.java:123)
12-20 19:29:34.652: INFO/dalvikvm(725): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:629)
12-20 19:29:34.662: INFO/dalvikvm(725): at java.lang.Thread.run(Thread.java:1019)
12-20 19:29:34.672: ERROR/dalvikvm(725): VM aborting
12-20 19:29:34.852: INFO/DEBUG(30): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-20 19:29:34.852: INFO/DEBUG(30): Build fingerprint: 'generic/sdk/generic:2.3/GRH55/79397:eng/test-keys'
12-20 19:29:34.862: INFO/DEBUG(30): pid: 725, tid: 734 >>> XXXXXXXX <<<
12-20 19:29:34.862: INFO/DEBUG(30): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
12-20 19:29:34.872: INFO/DEBUG(30): r0 fffffebc r1 deadd00d r2 00000026 r3 00000000
12-20 19:29:34.872: INFO/DEBUG(30): r4 81da45c8 r5 4074f6e0 r6 81d8592c r7 0026d2b8
12-20 19:29:34.872: INFO/DEBUG(30): r8 44174b54 r9 43d72e4c 10 43d72e34 fp 41edd82c
12-20 19:29:34.891: INFO/DEBUG(30): ip 81da4728 sp 44174348 lr afd19375 pc 81d45a02 cpsr 20000030
12-20 19:29:35.912: INFO/DEBUG(30): #00 pc 00045a02 /system/lib/libdvm.so
12-20 19:29:35.912: INFO/DEBUG(30): #01 pc 000376fc /system/lib/libdvm.so
12-20 19:29:35.912: INFO/DEBUG(30): #02 pc 000399c4 /system/lib/libdvm.so
12-20 19:29:35.922: INFO/DEBUG(30): #03 pc 0003a4a0 /system/lib/libdvm.so
12-20 19:29:35.932: INFO/DEBUG(30): #04 pc 0032b6d6 /system/lib/libwebcore.so
12-20 19:29:35.952: INFO/DEBUG(30): #05 pc 002a4da4 /system/lib/libwebcore.so
12-20 19:29:35.952: INFO/DEBUG(30): #06 pc 001a6136 /system/lib/libwebcore.so
12-20 19:29:35.952: INFO/DEBUG(30): #07 pc 002a5870 /system/lib/libwebcore.so
12-20 19:29:35.962: INFO/DEBUG(30): #08 pc 00359e36 /system/lib/libwebcore.so
12-20 19:29:35.972: INFO/DEBUG(30): #09 pc 0035d18e /system/lib/libwebcore.so
12-20 19:29:35.972: INFO/DEBUG(30): #10 pc 0036b078 /system/lib/libwebcore.so
12-20 19:29:35.982: INFO/DEBUG(30): #11 pc 003627ac /system/lib/libwebcore.so
12-20 19:29:35.982: INFO/DEBUG(30): #12 pc 0029fb24 /system/lib/libwebcore.so
12-20 19:29:36.002: INFO/DEBUG(30): #13 pc 0023367e /system/lib/libwebcore.so
12-20 19:29:36.002: INFO/DEBUG(30): #14 pc 00239c0c /system/lib/libwebcore.so
12-20 19:29:36.011: INFO/DEBUG(30): #15 pc 00237a28 /system/lib/libwebcore.so
12-20 19:29:36.011: INFO/DEBUG(30): #16 pc 00237b32 /system/lib/libwebcore.so
12-20 19:29:36.022: INFO/DEBUG(30): #17 pc 0023adba /system/lib/libwebcore.so
12-20 19:29:36.022: INFO/DEBUG(30): #18 pc 0023af4e /system/lib/libwebcore.so
12-20 19:29:36.042: INFO/DEBUG(30): #19 pc 000f80c0 /system/lib/libwebcore.so
12-20 19:29:36.042: INFO/DEBUG(30): #20 pc 000f8c66 /system/lib/libwebcore.so
12-20 19:29:36.052: INFO/DEBUG(30): #21 pc 001b81fa /system/lib/libwebcore.so
12-20 19:29:36.062: INFO/DEBUG(30): #22 pc 001b82f2 /system/lib/libwebcore.so
12-20 19:29:36.062: INFO/DEBUG(30): #23 pc 001b8318 /system/lib/libwebcore.so
12-20 19:29:36.072: INFO/DEBUG(30): #24 pc 00017d34 /system/lib/libdvm.so
12-20 19:29:36.082: INFO/DEBUG(30): code around pc:
12-20 19:29:36.082: INFO/DEBUG(30): 81d459e0 447a4479 ed0cf7d1 20004c09 ee34f7d1
12-20 19:29:36.092: INFO/DEBUG(30): 81d459f0 447c4808 6bdb5823 d0002b00 49064798
12-20 19:29:36.092: INFO/DEBUG(30): 81d45a00 700a2226 eea0f7d1 0004355f 0004511d
12-20 19:29:36.102: INFO/DEBUG(30): 81d45a10 0005ebd2 fffffebc deadd00d b510b40e
12-20 19:29:36.102: INFO/DEBUG(30): 81d45a20 4c0a4b09 447bb083 aa05591b 6b5bca02
12-20 19:29:36.112: INFO/DEBUG(30): code around lr:
12-20 19:29:36.112: INFO/DEBUG(30): afd19354 b0834a0d 589c447b 26009001 686768a5
12-20 19:29:36.112: INFO/DEBUG(30): afd19364 220ce008 2b005eab 1c28d003 47889901
12-20 19:29:36.122: INFO/DEBUG(30): afd19374 35544306 d5f43f01 2c006824 b003d1ee
12-20 19:29:36.122: INFO/DEBUG(30): afd19384 bdf01c30 000281a8 ffffff88 1c0fb5f0
12-20 19:29:36.132: INFO/DEBUG(30): afd19394 43551c3d a904b087 1c16ac01 604d9004
12-20 19:29:36.132: INFO/DEBUG(30): stack:
12-20 19:29:36.132: INFO/DEBUG(30): 44174308 00000015
12-20 19:29:36.132: INFO/DEBUG(30): 4417430c afd18407 /system/lib/libc.so
12-20 19:29:36.142: INFO/DEBUG(30): 44174310 afd4270c /system/lib/libc.so
12-20 19:29:36.142: INFO/DEBUG(30): 44174314 afd426b8 /system/lib/libc.so
12-20 19:29:36.152: INFO/DEBUG(30): 44174318 00000000
12-20 19:29:36.152: INFO/DEBUG(30): 4417431c afd19375 /system/lib/libc.so
12-20 19:29:36.162: INFO/DEBUG(30): 44174320 0026bea8 [heap]
12-20 19:29:36.162: INFO/DEBUG(30): 44174324 afd183d9 /system/lib/libc.so
12-20 19:29:36.162: INFO/DEBUG(30): 44174328 0026d2b8 [heap]
12-20 19:29:36.172: INFO/DEBUG(30): 4417432c 0005ebd2 [heap]
12-20 19:29:36.172: INFO/DEBUG(30): 44174330 4074f6e0 /dev/ashmem/dalvik-heap (deleted)
12-20 19:29:36.172: INFO/DEBUG(30): 44174334 81d8592c /system/lib/libdvm.so
12-20 19:29:36.182: INFO/DEBUG(30): 44174338 0026d2b8 [heap]
12-20 19:29:36.182: INFO/DEBUG(30): 4417433c afd18437 /system/lib/libc.so
12-20 19:29:36.191: INFO/DEBUG(30): 44174340 df002777
12-20 19:29:36.191: INFO/DEBUG(30): 44174344 e3a070ad
12-20 19:29:36.191: INFO/DEBUG(30): #00 44174348 00000001
12-20 19:29:36.191: INFO/DEBUG(30): 4417434c 81d37701 /system/lib/libdvm.so
12-20 19:29:36.191: INFO/DEBUG(30): #01 44174350 00000001
12-20 19:29:36.191: INFO/DEBUG(30): 44174354 81d399c9 /system/lib/libdvm.so
la...@gmail.com <la...@gmail.com> #31
This is a very bad! Please fix it ASAP
le...@gmail.com <le...@gmail.com> #32
I also have problems with this. (I think at least)
My app crashes when run on the 2.3 emulator with the log printed above.
I don't use any webview myself in the app startup, but I guess some of the ad network SDKs might do, thus causing the crash (?).
If so, this will possibly break most apps with ads in them...
Why is this bug still rated only priority medium? To me it is a blocker.
Maybe it's only in the emulator? If so, could we please get an official confirmation on that? But even so, I won't be able to test the app on the 2.3 platform before publishing.
My app crashes when run on the 2.3 emulator with the log printed above.
I don't use any webview myself in the app startup, but I guess some of the ad network SDKs might do, thus causing the crash (?).
If so, this will possibly break most apps with ads in them...
Why is this bug still rated only priority medium? To me it is a blocker.
Maybe it's only in the emulator? If so, could we please get an official confirmation on that? But even so, I won't be able to test the app on the 2.3 platform before publishing.
ho...@gmail.com <ho...@gmail.com> #33
Agree, this is a very serious bug. Please raise the priority.
jz...@gmail.com <jz...@gmail.com> #34
I get this error on my builds custom builds for my msm7227 cell phone device when running gmail.
jo...@gmail.com <jo...@gmail.com> #35
Very serious bug, fix please! Raise the priority.
po...@gmail.com <po...@gmail.com> #36
Please fix this ASAP. Thank you.
sa...@gmail.com <sa...@gmail.com> #37
Experiencing the same problem here. Please fix.
ck...@gmail.com <ck...@gmail.com> #38
I have the same issue when interfacing on 2.3. please someone from google give some feedback.
vi...@gmail.com <vi...@gmail.com> #39
Whole development is stuck!
Please fix asap
Please fix asap
sa...@gmail.com <sa...@gmail.com> #40
It shows the status of this has been reviewed, what was the outcome of that review??
hb...@gmail.com <hb...@gmail.com> #41
I think this is being treated as quite a low priority since it only appears to be a bug in the emulator and not real devices. Of course a new release of the emulator (e.g. 2.3.0.1) wouldn't go amiss in fixing this.
fc...@gmail.com <fc...@gmail.com> #42
I think it's high priority even it appears on emulator currently. Please note that most customized OS are built from the public source code of Android which is mostly the same as emulator. I've already seen the bug is transferred to devices with customized 2.3 rom.
br...@gmail.com <br...@gmail.com> #43
Same issue. My app depends on Javascript. Please fix.
nw...@gmail.com <nw...@gmail.com> #44
Pleas fix bug as soon as possible!My app can't run on 2.3
lo...@gmail.com <lo...@gmail.com> #45
I have the similar issue and who can tell me the method of analyzing the LogCat log like this issue.
sa...@gmail.com <sa...@gmail.com> #46
Please fix this quickly.
wi...@gmail.com <wi...@gmail.com> #47
Please make this issue as critical and resolve it ASAP.
he...@gmail.com <he...@gmail.com> #48
Same Issue , same Log, even with Phonegap Example Apps. Please fix this.
ma...@wias.no <ma...@wias.no> #49
Same problem. This have to be fixed soon.. PLEASE...
iu...@yahoo.com <iu...@yahoo.com> #50
Voted to be fixed as well. I think they'll do it next release but not until then.
[Deleted User] <[Deleted User]> #51
Please fix, I use webview/JS alot....Ouch.
fc...@gmail.com <fc...@gmail.com> #52
the new released 2.3.1 doesn't fix it...
ab...@gmail.com <ab...@gmail.com> #53
I was so hopeful when I saw that there was a new release 2.3.1. I downloaded it and the same problem is still there.
ni...@webehome.com <ni...@webehome.com> #54
I have the same problem both in the 2.3 emulator and on ZTE Blade phone using 2.2. It works perfect on for example HTC Desire and some other Android phones we have tested. So it is actually relating both to real devices and to other released than 2.3. We can't make an official release of our application until this is corrected.
ma...@gmail.com <ma...@gmail.com> #55
Amazon Marketplace says my Phonegap app can not run in their tests due to this error. They also say it fails on the Droid Incredible running Android OS 2.2
ia...@gmail.com <ia...@gmail.com> #56
This is a critical bug and should be fixed innan out-of-band update, and nothing less.
cs...@gmail.com <cs...@gmail.com> #57
Please fix this bug, this is critical, many apps based on webview are not working on Android 2.3.1
st...@gmail.com <st...@gmail.com> #58
this is ctritical!
ja...@gmail.com <ja...@gmail.com> #59
Fix please!
yo...@gmail.com <yo...@gmail.com> #60
is there a workaround for this?
bk...@gmail.com <bk...@gmail.com> #61
The only workaround that I know of is to test on the 2.2 or on the device. In my app, there is no 2.3 dependent functionality so it works fine, but I am trying to get my hands on a real device anyway because I understand that the emulator is quite slow.
ko...@gmail.com <ko...@gmail.com> #62
it's critical...
pm...@gmail.com <pm...@gmail.com> #63
just tried the brand-spanking-new 2.3.3 emulator image. Same problem :-(
jp...@gmail.com <jp...@gmail.com> #64
This is critical for me too. Testing all platforms for android apps is critical. Even if it only happnes on simulator, which is not yet confirmed, it's critical.
sa...@gmail.com <sa...@gmail.com> #65
I compiled gingerbread for HTC Magic and it not work.
Is this not only emulator bug?
Is this not only emulator bug?
xa...@gmail.com <xa...@gmail.com> #66
It should be fixed asap
fr...@gmail.com <fr...@gmail.com> #67
Okay folks, other phonegap developer are finding the same bug on real devices,, its effing real serious problem now.
We need to start tracking this by android OS version for emulator, android device OS version , webkit version, etc
If I get the dev job I interview on Monday I am writing an effing parser to fix..
We need to start tracking this by android OS version for emulator, android device OS version , webkit version, etc
If I get the dev job I interview on Monday I am writing an effing parser to fix..
jo...@gmail.com <jo...@gmail.com> #68
The way I see it, unless it's a super-critical _security_ flaw it will not get fixed in any current version of Android. Google is currently working on Gingerbread 2.4 and Honeycomb, so all we can do is pray that they have corrected this issue in those releases.
I'm not sure what's so drastically wrong with Gingerbread 2.3, but there is still only one device out that has it officially: the Nexus S. Google hasn't updated the Nexus 1 yet for some mysterious reason, and none of the manufacturers have released any official updates to it (no surprise there though).
Just target Froyo with your PhoneGap applications for the time being, and wait for Gingerbread 2.4 which will probably be the widely used version. This reminds me of the 2 Eclairs, although I can't remember what was broken in the first one...
I'm not sure what's so drastically wrong with Gingerbread 2.3, but there is still only one device out that has it officially: the Nexus S. Google hasn't updated the Nexus 1 yet for some mysterious reason, and none of the manufacturers have released any official updates to it (no surprise there though).
Just target Froyo with your PhoneGap applications for the time being, and wait for Gingerbread 2.4 which will probably be the widely used version. This reminds me of the 2 Eclairs, although I can't remember what was broken in the first one...
fr...@gmail.com <fr...@gmail.com> #69
Guys, this might be good news..
Try switching addJavascriptInterface to after loadURL
Its not fully tested yet..need to do a better example and fully test it..but Mark Murphy's example with that change is getting no errors.. Yeah!
Try switching addJavascriptInterface to after loadURL
Its not fully tested yet..need to do a better example and fully test it..but Mark Murphy's example with that change is getting no errors.. Yeah!
fr...@gmail.com <fr...@gmail.com> #70
The logcat output when switching addJavascriptInterface to after loadURL:
02-20 21:34:52.452: DEBUG/dalvikvm(486): GC_CONCURRENT freed 103K, 69% free 319K/1024K, external 0K/0K, paused 2ms+1ms
02-20 21:34:52.462: DEBUG/jdwp(486): Got wake-up signal, bailing out of select
02-20 21:34:52.462: DEBUG/dalvikvm(486): Debugger has detached; object registry had 1 entries
02-20 21:34:56.692: INFO/ActivityManager(75): Displayed com.mobilebytes.brokenaddjavascriptinterface/.MainActivity: +4s298ms
02-20 21:35:05.141: DEBUG/dalvikvm(367): GC_EXPLICIT freed 7K, 54% free 2543K/5511K, external 716K/1038K, paused 91ms
02-20 21:35:10.281: DEBUG/dalvikvm(423): GC_EXPLICIT freed 317K, 54% free 2538K/5511K, external 716K/1038K, paused 219ms
02-20 21:35:15.223: DEBUG/dalvikvm(438): GC_EXPLICIT freed 481K, 55% free 2595K/5703K, external 716K/1038K, paused 138ms
02-20 21:35:20.251: DEBUG/dalvikvm(148): GC_EXPLICIT freed 93K, 51% free 2934K/5895K, external 2048K/2461K, paused 158ms
02-20 21:39:33.452: DEBUG/SntpClient(75): request time failed: java.net.SocketException: Address family not supported by protocol
02-20 21:44:33.461: DEBUG/SntpClient(75): request time failed: java.net.SocketException: Address family not supported by protocol
02-20 21:49:33.472: DEBUG/SntpClient(75): request time failed: java.net.SocketException: Address family not supported by protocol
As you can see no errors...
That would mean something not being loaded that addJavascriptInterface needs until loadURL is called..in 2.2, 2.3 emulators and some devices
02-20 21:34:52.452: DEBUG/dalvikvm(486): GC_CONCURRENT freed 103K, 69% free 319K/1024K, external 0K/0K, paused 2ms+1ms
02-20 21:34:52.462: DEBUG/jdwp(486): Got wake-up signal, bailing out of select
02-20 21:34:52.462: DEBUG/dalvikvm(486): Debugger has detached; object registry had 1 entries
02-20 21:34:56.692: INFO/ActivityManager(75): Displayed com.mobilebytes.brokenaddjavascriptinterface/.MainActivity: +4s298ms
02-20 21:35:05.141: DEBUG/dalvikvm(367): GC_EXPLICIT freed 7K, 54% free 2543K/5511K, external 716K/1038K, paused 91ms
02-20 21:35:10.281: DEBUG/dalvikvm(423): GC_EXPLICIT freed 317K, 54% free 2538K/5511K, external 716K/1038K, paused 219ms
02-20 21:35:15.223: DEBUG/dalvikvm(438): GC_EXPLICIT freed 481K, 55% free 2595K/5703K, external 716K/1038K, paused 138ms
02-20 21:35:20.251: DEBUG/dalvikvm(148): GC_EXPLICIT freed 93K, 51% free 2934K/5895K, external 2048K/2461K, paused 158ms
02-20 21:39:33.452: DEBUG/SntpClient(75): request time failed: java.net.SocketException: Address family not supported by protocol
02-20 21:44:33.461: DEBUG/SntpClient(75): request time failed: java.net.SocketException: Address family not supported by protocol
02-20 21:49:33.472: DEBUG/SntpClient(75): request time failed: java.net.SocketException: Address family not supported by protocol
As you can see no errors...
That would mean something not being loaded that addJavascriptInterface needs until loadURL is called..in 2.2, 2.3 emulators and some devices
pm...@gmail.com <pm...@gmail.com> #71
I'm unable to make addJavascriptInterface to work, even after calling it after loadUrl(). If I call addJavascriptInterface immediately after the loadUrl(), I get the same trap as if I had put it before. If I make the call well after loadUrl() - I do it in a consoleMessage callback - then the "object" I'm trying to install never gets installed.
Perhaps it's a bug in my code. Anyone else have any luck?
Perhaps it's a bug in my code. Anyone else have any luck?
cs...@gmail.com <cs...@gmail.com> #72
So far I've only had a chance to try moving addJavascriptInterface() to immediately after loadUrl(), but it didn't help.
fr...@gmail.com <fr...@gmail.com> #73
Sorry folks I still get same locat errors.
However, if I do not touch the app no user input I am not seeing WebViewCore messages such as th AddJavascritInterface succeeded so is this a WebViewCore initialization and native lib interference?
However, if I do not touch the app no user input I am not seeing WebViewCore messages such as th AddJavascritInterface succeeded so is this a WebViewCore initialization and native lib interference?
ny...@gmail.com <ny...@gmail.com> #74
Please fix this bug, this is critical.
jo...@gmail.com <jo...@gmail.com> #75
The Honeycomb emulator was officially released today, and I think I noticed the Gingerbread emulator getting some updates. Anyone tried this in the new SDK yet?
ty...@gmail.com <ty...@gmail.com> #76
Works in 3.0 emulator.
For the 2.3.1 and 2.3.3 emulators - no change.
02-22 22:47:55.529: WARN/dalvikvm(404): JNI WARNING: jarray 0x4051a6e8 points to non-array object (Ljava/lang/String;)
02-22 22:47:55.538: INFO/dalvikvm(404): "WebViewCoreThread" prio=5 tid=9 NATIVE
02-22 22:47:55.538: INFO/dalvikvm(404): | group="main" sCount=0 dsCount=0 obj=0x40520330 self=0x1f5278
02-22 22:47:55.538: INFO/dalvikvm(404): | sysTid=412 nice=0 sched=0/0 cgrp=default handle=2054032
02-22 22:47:55.548: INFO/dalvikvm(404): | schedstat=( 1467256456 1411922893 266 )
02-22 22:47:55.548: INFO/dalvikvm(404): at android.webkit.LoadListener.nativeFinished(Native Method)
02-22 22:47:55.558: INFO/dalvikvm(404): at android.webkit.LoadListener.nativeFinished(Native Method)
02-22 22:47:55.570: INFO/dalvikvm(404): at android.webkit.LoadListener.tearDown(LoadListener.java:1200)
02-22 22:47:55.570: INFO/dalvikvm(404): at android.webkit.LoadListener.handleEndData(LoadListener.java:721)
02-22 22:47:55.577: INFO/dalvikvm(404): at android.webkit.LoadListener.handleMessage(LoadListener.java:219)
02-22 22:47:55.577: INFO/dalvikvm(404): at android.os.Handler.dispatchMessage(Handler.java:99)
02-22 22:47:55.577: INFO/dalvikvm(404): at android.os.Looper.loop(Looper.java:123)
02-22 22:47:55.577: INFO/dalvikvm(404): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:629)
02-22 22:47:55.587: INFO/dalvikvm(404): at java.lang.Thread.run(Thread.java:1019)
02-22 22:47:55.587: ERROR/dalvikvm(404): VM aborting
02-22 22:47:55.798: INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-22 22:47:55.798: INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic:2.3.1/GSI11/93351:eng/test-keys'
02-22 22:47:55.798: INFO/DEBUG(31): pid: 404, tid: 412 >>> -------------------------------------- <<<
02-22 22:47:55.808: INFO/DEBUG(31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
02-22 22:53:51.301: WARN/dalvikvm(418): JNI WARNING: jarray 0x40518c48 points to non-array object (Ljava/lang/String;)
02-22 22:53:51.310: INFO/dalvikvm(418): "WebViewCoreThread" prio=5 tid=9 NATIVE
02-22 22:53:51.310: INFO/dalvikvm(418): | group="main" sCount=0 dsCount=0 obj=0x40520988 self=0x1f4ec8
02-22 22:53:51.310: INFO/dalvikvm(418): | sysTid=426 nice=0 sched=0/0 cgrp=default handle=2054608
02-22 22:53:51.310: INFO/dalvikvm(418): | schedstat=( 1769120282 2152704812 298 )
02-22 22:53:51.310: INFO/dalvikvm(418): at android.webkit.LoadListener.nativeFinished(Native Method)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.webkit.LoadListener.nativeFinished(Native Method)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.webkit.LoadListener.tearDown(LoadListener.java:1200)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.webkit.LoadListener.handleEndData(LoadListener.java:721)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.webkit.LoadListener.handleMessage(LoadListener.java:219)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.os.Handler.dispatchMessage(Handler.java:99)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.os.Looper.loop(Looper.java:123)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:629)
02-22 22:53:51.310: INFO/dalvikvm(418): at java.lang.Thread.run(Thread.java:1019)
02-22 22:53:51.310: ERROR/dalvikvm(418): VM aborting
02-22 22:53:51.322: DEBUG/dalvikvm(277): GC_EXPLICIT freed 86K, 54% free 2718K/5831K, external 716K/1038K, paused 7092ms
02-22 22:53:51.431: INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-22 22:53:51.431: INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic:2.3.3/GRI34/101070:eng/test-keys'
02-22 22:53:51.431: INFO/DEBUG(31): pid: 418, tid: 426 >>> -------------------------------------- <<<
02-22 22:53:51.431: INFO/DEBUG(31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
For the 2.3.1 and 2.3.3 emulators - no change.
02-22 22:47:55.529: WARN/dalvikvm(404): JNI WARNING: jarray 0x4051a6e8 points to non-array object (Ljava/lang/String;)
02-22 22:47:55.538: INFO/dalvikvm(404): "WebViewCoreThread" prio=5 tid=9 NATIVE
02-22 22:47:55.538: INFO/dalvikvm(404): | group="main" sCount=0 dsCount=0 obj=0x40520330 self=0x1f5278
02-22 22:47:55.538: INFO/dalvikvm(404): | sysTid=412 nice=0 sched=0/0 cgrp=default handle=2054032
02-22 22:47:55.548: INFO/dalvikvm(404): | schedstat=( 1467256456 1411922893 266 )
02-22 22:47:55.548: INFO/dalvikvm(404): at android.webkit.LoadListener.nativeFinished(Native Method)
02-22 22:47:55.558: INFO/dalvikvm(404): at android.webkit.LoadListener.nativeFinished(Native Method)
02-22 22:47:55.570: INFO/dalvikvm(404): at android.webkit.LoadListener.tearDown(LoadListener.java:1200)
02-22 22:47:55.570: INFO/dalvikvm(404): at android.webkit.LoadListener.handleEndData(LoadListener.java:721)
02-22 22:47:55.577: INFO/dalvikvm(404): at android.webkit.LoadListener.handleMessage(LoadListener.java:219)
02-22 22:47:55.577: INFO/dalvikvm(404): at android.os.Handler.dispatchMessage(Handler.java:99)
02-22 22:47:55.577: INFO/dalvikvm(404): at android.os.Looper.loop(Looper.java:123)
02-22 22:47:55.577: INFO/dalvikvm(404): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:629)
02-22 22:47:55.587: INFO/dalvikvm(404): at java.lang.Thread.run(Thread.java:1019)
02-22 22:47:55.587: ERROR/dalvikvm(404): VM aborting
02-22 22:47:55.798: INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-22 22:47:55.798: INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic:2.3.1/GSI11/93351:eng/test-keys'
02-22 22:47:55.798: INFO/DEBUG(31): pid: 404, tid: 412 >>> -------------------------------------- <<<
02-22 22:47:55.808: INFO/DEBUG(31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
02-22 22:53:51.301: WARN/dalvikvm(418): JNI WARNING: jarray 0x40518c48 points to non-array object (Ljava/lang/String;)
02-22 22:53:51.310: INFO/dalvikvm(418): "WebViewCoreThread" prio=5 tid=9 NATIVE
02-22 22:53:51.310: INFO/dalvikvm(418): | group="main" sCount=0 dsCount=0 obj=0x40520988 self=0x1f4ec8
02-22 22:53:51.310: INFO/dalvikvm(418): | sysTid=426 nice=0 sched=0/0 cgrp=default handle=2054608
02-22 22:53:51.310: INFO/dalvikvm(418): | schedstat=( 1769120282 2152704812 298 )
02-22 22:53:51.310: INFO/dalvikvm(418): at android.webkit.LoadListener.nativeFinished(Native Method)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.webkit.LoadListener.nativeFinished(Native Method)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.webkit.LoadListener.tearDown(LoadListener.java:1200)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.webkit.LoadListener.handleEndData(LoadListener.java:721)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.webkit.LoadListener.handleMessage(LoadListener.java:219)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.os.Handler.dispatchMessage(Handler.java:99)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.os.Looper.loop(Looper.java:123)
02-22 22:53:51.310: INFO/dalvikvm(418): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:629)
02-22 22:53:51.310: INFO/dalvikvm(418): at java.lang.Thread.run(Thread.java:1019)
02-22 22:53:51.310: ERROR/dalvikvm(418): VM aborting
02-22 22:53:51.322: DEBUG/dalvikvm(277): GC_EXPLICIT freed 86K, 54% free 2718K/5831K, external 716K/1038K, paused 7092ms
02-22 22:53:51.431: INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-22 22:53:51.431: INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic:2.3.3/GRI34/101070:eng/test-keys'
02-22 22:53:51.431: INFO/DEBUG(31): pid: 418, tid: 426 >>> -------------------------------------- <<<
02-22 22:53:51.431: INFO/DEBUG(31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
pm...@gmail.com <pm...@gmail.com> #77
Works for me in the 3.0 emulator as well. It appears that the 3.0 emulator still uses JSC (try eval("\") and look at the exception).
go...@gmail.com <go...@gmail.com> #78
[Comment deleted]
ia...@gmail.com <ia...@gmail.com> #79
Frankly, the lack of response (or acknowledgment) by Google regarding this issue is a cataclysmic failure and a black eye for the Android platform. By not addressing this, Google is making it clear that they do not care about their developers nor do they care about the operating system. Pathetic. This makes Apple seem open.
zz...@gmail.com <zz...@gmail.com> #80
This is ctritical...
jp...@gmail.com <jp...@gmail.com> #81
Ahah yes, I'm also amazed by the lack of response by google on this one.
be...@gmail.com <be...@gmail.com> #82
I'd put good money on the lack of response being that it's fixed in Honeycomb, and the fix will be back-ported into 2.4 (which is still Gingerbread), and they'll never bother to fix 2.3 because 2.3 won't actually end up on devices other than the Nexus S.
Of course, they should've come out and actually said that officially.....
Of course, they should've come out and actually said that officially.....
cs...@gmail.com <cs...@gmail.com> #83
I just realized that no one announced this in this thread: the issue appears to be fixed in the version of Gingerbread that got pushed to the Nexus One last week (2.3.3).
The lack of official response is still a bummer, but it looks like disaster has been averted.
The lack of official response is still a bummer, but it looks like disaster has been averted.
ja...@gmail.com <ja...@gmail.com> #84
The issue has never shown itself on the phone. It has always been on the emulator.
as...@gmail.com <as...@gmail.com> #85
This is problem with 2.3 emulator and Google Apis version 9
aj...@gmail.com <aj...@gmail.com> #86
Yes its a confirmed bug in android 2.3.3 level 9..I tested it on i get the same log mentioned above....
gu...@gmail.com <gu...@gmail.com> #87
[Comment deleted]
co...@gmail.com <co...@gmail.com> #88
The Nexus S never has suffered from this problem and does not now (2.3.3). Please try the sample apps from comment #10 .
[Deleted User] <[Deleted User]> #89
the same problem on nexus one 2.3.3!
li...@gmail.com <li...@gmail.com> #90
the same problem.
em...@gmail.com <em...@gmail.com> #91
Same problem Galaxy S I9000XWJV1
li...@gmail.com <li...@gmail.com> #92
the same problem on emutor
go...@gmail.com <go...@gmail.com> #93
Apparently, a PhoneGap developer named Bryce Curtis has addressed this issue as it affects PhoneGap by implementing a creative workaround that eliminates PhoneGap's dependency upon addJavascriptInterface(). From what I can tell, his fix is likely to go into the next (0.9.5) release of PhoneGap.
In particular, this fix would seem to restore PhoneGap's plugin functionality. It may fix some or all of the PhoneGap problems reported above that were due to its dependency upon addJavascriptInterface().
Since PhoneGap plugins provide an alternative (for PhoneGap apps) to using addJavascriptInterface() for crossing the Javascript to Java boundary, once Bryce's fix eliminating PhoneGap's own dependency upon addJavascriptInterface goes in, it seems possible that applications using PhoneGap that are presently dependent upon addJavascriptInterface() might be able to resolve the problems caused by the addJavascriptInterface() anomalies reported here by recoding their Javascript-to-Java bridge code to use PhoneGap plugins instead of using addJavascriptInterface(). And it seems possible that apps already using the plugin facility will start to work better in Android 2.3 once they update to a PhoneGap version that includes this fix.
It also seems possible that non-PhoneGap Android apps that need to communicate between a WebView and Java might be able to adapt Bryce's approach to their own needs, although since it was designed primarily as a workaround to restore PhoneGap's own functionality it will not necessarily be as pretty an approach as using the plugin facility itself.
Note that I'm reporting this second hand, as something I came across while searching for an alternative to addJavascriptInterface() for my own development. I'm relatively new to PhoneGap, and can't claim to fully understand Bryce's code myself. However, the code itself can be found here:
https://github.com/phonegap/phonegap-android/commit/2bc7bd6768be3d82eab2e1b4f295abebffa79359
and a discussion of the problem that includes Bryce can be found here:
http://phonegap.lighthouseapp.com/projects/20118/tickets/99-phonegap-apps-rejected-by-amazon-marketplace#ticket-99-12
Once again, I can't be sure that I have accurately reported the above, so if I've misread this discussion and development, somebody please post a correction. But since no one else had mentioned this so far on this issue list, and since it appears to me, given what I do understand of it, to be highly pertinent to this issue, I wanted to make it known here. When in doubt, please refer to the two links above and to those actually involved in addressing this very significant issue.
In particular, this fix would seem to restore PhoneGap's plugin functionality. It may fix some or all of the PhoneGap problems reported above that were due to its dependency upon addJavascriptInterface().
Since PhoneGap plugins provide an alternative (for PhoneGap apps) to using addJavascriptInterface() for crossing the Javascript to Java boundary, once Bryce's fix eliminating PhoneGap's own dependency upon addJavascriptInterface goes in, it seems possible that applications using PhoneGap that are presently dependent upon addJavascriptInterface() might be able to resolve the problems caused by the addJavascriptInterface() anomalies reported here by recoding their Javascript-to-Java bridge code to use PhoneGap plugins instead of using addJavascriptInterface(). And it seems possible that apps already using the plugin facility will start to work better in Android 2.3 once they update to a PhoneGap version that includes this fix.
It also seems possible that non-PhoneGap Android apps that need to communicate between a WebView and Java might be able to adapt Bryce's approach to their own needs, although since it was designed primarily as a workaround to restore PhoneGap's own functionality it will not necessarily be as pretty an approach as using the plugin facility itself.
Note that I'm reporting this second hand, as something I came across while searching for an alternative to addJavascriptInterface() for my own development. I'm relatively new to PhoneGap, and can't claim to fully understand Bryce's code myself. However, the code itself can be found here:
and a discussion of the problem that includes Bryce can be found here:
Once again, I can't be sure that I have accurately reported the above, so if I've misread this discussion and development, somebody please post a correction. But since no one else had mentioned this so far on this issue list, and since it appears to me, given what I do understand of it, to be highly pertinent to this issue, I wanted to make it known here. When in doubt, please refer to the two links above and to those actually involved in addressing this very significant issue.
go...@gmail.com <go...@gmail.com> #94
wo...@gmail.com <wo...@gmail.com> #95
the same problem.
al...@gmail.com <al...@gmail.com> #96
this seems to be a bug in the default JS engine(JSC) on emulator
in mydroid emulator build
if you enable v8 as default JS engine
this crashes is gone
this is also the reason why this crash will NOT happen on the device(nexus S)
in mydroid emulator build
if you enable v8 as default JS engine
this crashes is gone
this is also the reason why this crash will NOT happen on the device(nexus S)
sj...@gmail.com <sj...@gmail.com> #97
Its been a while, it should have been fixed by now. Serious issue for developers.
sj...@gmail.com <sj...@gmail.com> #98
Has someone found a workaround, for developers not using PhoneGap.
Also, enabling v8 engine is a solution that cannot be used for devices. Because it is required to rebuild image. I am beginner, dont mind if this question is awfully noob. Thanks.
Also, enabling v8 engine is a solution that cannot be used for devices. Because it is required to rebuild image. I am beginner, dont mind if this question is awfully noob. Thanks.
li...@126.com <li...@126.com> #99
the issue exists now.
ou...@gmail.com <ou...@gmail.com> #100
As usual, this screws small developers who can't afford to buy every phone on the market to test. Can I test my app on 2.3 now? No, because the emulator is buggy. Note this isn't the first issue - the LVL tools also don't work on 2.3.
sj...@gmail.com <sj...@gmail.com> #101
Agreed! And even for smaller developers like me who cant even figure out how the fix works for webview only. This is a pain in the ass.
a3...@gmail.com <a3...@gmail.com> #102
I'm work on the framework,I've resolved it on our tablet and written it here.
my English is poor, so I hope you can understand.
http://blog.csdn.net/a345017062/archive/2011/05/04/6394864.aspx
my English is poor, so I hope you can understand.
ef...@gmail.com <ef...@gmail.com> #103
2.2 seems destined to become Google's XP, while 2.3 is Vista. Or maybe 2.3 is Windows Me and 3.0 is Vista. Anyway my point is please fix this.
ge...@gmail.com <ge...@gmail.com> #104
is it fixed in 2.3.4?
tr...@gmail.com <tr...@gmail.com> #105
[Comment deleted]
tr...@gmail.com <tr...@gmail.com> #106
This problem makes me a big trouble .Has Anyone known how to fix it yet ?
da...@gmail.com <da...@gmail.com> #107
I am not sure if this bug is real on devices or just in the emulator as I hear some rumors, but it still is crashing my code on the 2.3.3 emulator which I thought had received a fix.
ba...@gmail.com <ba...@gmail.com> #108
Any updates on this issue....any workaround solution which is completely feasible
ba...@gmail.com <ba...@gmail.com> #109
If we make a debug build for libwebcore and then use addJavaScriptInterface api it do not crash, strange, hard to make out what is the issue
bo...@gmail.com <bo...@gmail.com> #110
The issue is when the API returns. I've been banging my head on this issue for months, but if you look at Comment 101, you can see that the issue is related to issues with the JNI bridge. However, I don't see any fix to this. After looking at the CTS, it SHOULD (and probably has) cause the CTS to fail, which may explain why there are very few low-end phones that run Android 2.3, since they would never pass that test.
ra...@gmail.com <ra...@gmail.com> #111
We have a similar feature which needs to be supported on 2.3.3, but it seems to be failing. When will this be fixed.
[Deleted User] <[Deleted User]> #112
This issue seems clearly to be a crucial one and there was no change since...December 2010?
Are you kidding me?
Are you kidding me?
jo...@gmail.com <jo...@gmail.com> #113
Wait, JS to Java breaks on Gingerbread?? Not having Gingerbread, this is the first I've heard of this, and the app I am developing fundamentally relies on this!
ke...@gmail.com <ke...@gmail.com> #114
Are people only seeing this on devices? There is some thrash in the comments and it is hard to tell if it is only the emulator or the phones as well.
If you are seeing it on a real phone, can you send us which phone model? We are trying to reproduce?
Also, how are people handling this crash bug in their apps? Targeting around it?
Thx everyone for the help!
If you are seeing it on a real phone, can you send us which phone model? We are trying to reproduce?
Also, how are people handling this crash bug in their apps? Targeting around it?
Thx everyone for the help!
sa...@gmail.com <sa...@gmail.com> #115
This is terrible. I am trying to be a responsible developer by testing my code on Gingerbread (I only got a 2.2 device on hand), yet I am punished and wasted my whole morning to trace my code to discover this bug. Even if the bug just occurred on the emulator, it should be fixed asap!
ji...@gmail.com <ji...@gmail.com> #116
I am learning [Hello Android] with simulator of version 2.3.3 and get crashed.
I changed the version of simulator to 2.2 after reading comments above and passed the test.
However I want the question be solved ASAP, just like everyone wishes.
I changed the version of simulator to 2.2 after reading comments above and passed the test.
However I want the question be solved ASAP, just like everyone wishes.
di...@gmail.com <di...@gmail.com> #117
May i know when will this be fixed? in 2.3.5 ?
Do google provide any emergency workaround ??
Do google provide any emergency workaround ??
jo...@gmail.com <jo...@gmail.com> #118
I have done some investigation into this bug, and I believe it is a problem introduced in the JSC javascript engine in Gingerbread.
First, some background:
Versions of Android 2.2 and greater include the v8 javascript engine in addition to the original WebKit Javascript engine (JavaScriptCore, or JSC). The vast majority of devices use v8, but not necessarily all - some low-memory devices may apparently use JSC. From the WebKit makefile:
# The default / alternative engine depends on the device class.
# On devices with a lot of memory (e.g. Passion/Sholes), the
# default is V8. On everything else, the only choice is JSC.
# TODO: use ARCH_ARM_HAVE_ARMV7 once that variable is added to
# the build system.
However, emulator images always use JSC. You can determine which JS engine is in use at runtime through the following javascript snippet:
if (window.devicePixelRatio) { //If WebKit browser
var st = escape(navigator.javaEnabled.toString());
if (st === 'function%20javaEnabled%28%29%20%7B%20%5Bnative%20code%5D%20%7D') {
document.write('V8 detected');
} else {
document.write('JSC detected');
}
} else {
document.write("Not a WebKit browser");
}
My Nexus one has 2.3.4 on it, and when I ran this piece of javascript it reported 'v8', and I wasn't able to repro this bug.
I then downloaded and build the android source with the JS_ENGINE environment variable set to 'jsc', then installed the custom image onto my Nexus One. Now my phone reports having 2.3.4 on it, and the JS snippet above reports 'jsc', and I can consistently repro this JNI warning. So this bug _can_ happen on devices, and likely is happening in the wild on certain low-memory devices.
Unfortunately, I have not found any workaround other than detecting at runtime which JS engine is in use and conditionally disabling JavaScript-to-Java behavior in our app.
First, some background:
Versions of Android 2.2 and greater include the v8 javascript engine in addition to the original WebKit Javascript engine (JavaScriptCore, or JSC). The vast majority of devices use v8, but not necessarily all - some low-memory devices may apparently use JSC. From the WebKit makefile:
# The default / alternative engine depends on the device class.
# On devices with a lot of memory (e.g. Passion/Sholes), the
# default is V8. On everything else, the only choice is JSC.
# TODO: use ARCH_ARM_HAVE_ARMV7 once that variable is added to
# the build system.
However, emulator images always use JSC. You can determine which JS engine is in use at runtime through the following javascript snippet:
if (window.devicePixelRatio) { //If WebKit browser
var st = escape(navigator.javaEnabled.toString());
if (st === 'function%20javaEnabled%28%29%20%7B%20%5Bnative%20code%5D%20%7D') {
document.write('V8 detected');
} else {
document.write('JSC detected');
}
} else {
document.write("Not a WebKit browser");
}
My Nexus one has 2.3.4 on it, and when I ran this piece of javascript it reported 'v8', and I wasn't able to repro this bug.
I then downloaded and build the android source with the JS_ENGINE environment variable set to 'jsc', then installed the custom image onto my Nexus One. Now my phone reports having 2.3.4 on it, and the JS snippet above reports 'jsc', and I can consistently repro this JNI warning. So this bug _can_ happen on devices, and likely is happening in the wild on certain low-memory devices.
Unfortunately, I have not found any workaround other than detecting at runtime which JS engine is in use and conditionally disabling JavaScript-to-Java behavior in our app.
zh...@gmail.com <zh...@gmail.com> #119
I tried in HTC desire with a custom rom of 2.3, it's not crashed but the javascriptinterface is not called. The same is in the emultor. My app relies on this feature. please fix it asap.
ma...@gmail.com <ma...@gmail.com> #120
The addJavascriptInterface seems to work fine, the error seems to be raised once a method is invoked through the interface.
Leaving off any method invokation and keeping the (this way useless, so should be fixed) addJavascriptInterface seems to avoid the crash.
Anyone else got this same result?
As real device I have a Galaxy S I9000 updated on Gingerbread via official channels, it works fine (I suppose it uses the V8 interpreter).
Leaving off any method invokation and keeping the (this way useless, so should be fixed) addJavascriptInterface seems to avoid the crash.
Anyone else got this same result?
As real device I have a Galaxy S I9000 updated on Gingerbread via official channels, it works fine (I suppose it uses the V8 interpreter).
ti...@gmail.com <ti...@gmail.com> #121
Just to confirm comment 117. I compiled android 2.3.4 using JS_ENGINE=v8 to get a emulator image using v8 Javascript (defaults to jsc). This problem is not reproducible in the emulator. (though this configuration has other problems: most Javascript dies with ILL_ILLOPC exception, due to v8 requiring a later instruction set than the emulator provides).
I guess older phones should only upgrade to 2.2.
I guess older phones should only upgrade to 2.2.
fi...@gmail.com <fi...@gmail.com> #122
this problem seems caused by template callJNIMethod<>, replace it with direct function define and replace all call in JNIBridge.cpp JavaClassJSC.cpp JavaInstanceJSC.cpp, it works fine on emulator,but it is strange why v8 engine doesn't have this problem, it also call callJNIMethod<> func
ji...@gmail.com <ji...@gmail.com> #123
Very serious bug, fix please!
ma...@gmail.com <ma...@gmail.com> #124
This is a total NFC showstopper. Is this politically intentional? Please fix this ASAP.
ma...@gmail.com <ma...@gmail.com> #125
This is frustrating. Please fix, Google.
[Deleted User] <[Deleted User]> #126
Droid2 testing device running 2.3.3 runs fine. Please fix emu.
ll...@gmail.com <ll...@gmail.com> #127
We're using phoneGap 1.0 and an app using file:/// based html files.
we had the problem of unwanted javscript "gap_poll:" prompts on Android phones and emulators.
We found the problem went away when we put all the files in one folder (the www folder).
we had the problem of unwanted javscript "gap_poll:" prompts on Android phones and emulators.
We found the problem went away when we put all the files in one folder (the www folder).
li...@gmail.com <li...@gmail.com> #128
unblievable
li...@gmail.com <li...@gmail.com> #129
[Comment deleted]
hu...@gmail.com <hu...@gmail.com> #130
Fix it please, google.
It's a very serious bug.
It's a very serious bug.
su...@gmail.com <su...@gmail.com> #131
It's really a critical bug, please fix it.
pa...@gmail.com <pa...@gmail.com> #132
This critical bug has been there for almost a year and google is not showing any interest of fixing. frustrating indeed
de...@gmail.com <de...@gmail.com> #133
fuck google, it is real a serious bug.
sz...@gmail.com <sz...@gmail.com> #134
Come on man, I don't believe it's unrepairable...
ma...@gmail.com <ma...@gmail.com> #135
This bug interacts badly with the ability to open ParcelFileDescriptor pipes (which requires Gingerbread) to provide additional content:// URL's for custom WebView content. The workaround isn't realistic for anything other than the most trivial triggers (i.e. you can't pass complex data structures back and forth).
mi...@gmail.com <mi...@gmail.com> #136
this bug is blocking, not just medium priority. fix this ASAP, google. your sells depends on customers being able to buy recent apps
cd...@gmail.com <cd...@gmail.com> #137
This is still an issue almost 1 year on.
I have an app I'd like to publish.
It will not work on 80-90% of devices. 4.0 is not out for updates yet and even then a small percentage of users with that version for the next year as the up_X work thru the system.
I have an app I'd like to publish.
It will not work on 80-90% of devices. 4.0 is not out for updates yet and even then a small percentage of users with that version for the next year as the up_X work thru the system.
ro...@gmail.com <ro...@gmail.com> #138
Experiencing the same problem. This is a critical issue and needs to be fixed!
no...@hotmail.com <no...@hotmail.com> #139
Try mobilelite framework: http://code.google.com/p/mobilelite/
We have already solved this problem in the lightweight framework.
We have already solved this problem in the lightweight framework.
tr...@gmail.com <tr...@gmail.com> #140
Hmmm, Android is a nightmare for developers, NICE! Things just don't get fixed I guess.
dm...@gmail.com <dm...@gmail.com> #141
I have just implemented the fully synchronous workaround using WebViewChrome::onJsPrompt().
@Override
public boolean onJsPrompt(WebView view, String url,
String message, String defaultValue,
JsPromptResult result) {
if(TextUtils.isEmpty(message) || !message.startsWith(SIGNATURE))
return false;
String json = message.substring(SIGNATURE.length());
try{
//It is our object
JSONObject info = new JSONObject(json);
JSONArray params = info.getJSONArray("params");
int len = params.length();
Object []paramValues = new Object[len];
for(int i=0; i<len; ++i){
Object obj = params.opt(i);
paramValues[i] = obj;
}
Method method = ReflectionUtils.findOnlyMethod(api.getClass(), info.getString("method"));
Object ret = method.invoke(api, paramValues);
JSONObject res = new JSONObject();
res.put("result", ret);
result.confirm(res.toString());
}catch(JSONException e){
api.m_error_message = "Couldn't parse rpc call: " + json;
result.confirm(null);
return true;
}catch(NoSuchMethodException e){
api.m_error_message = "Can not find method: " + e.getMessage() + " on data " + json;
result.confirm(null);
return true;
}catch(InvocationTargetException e){
api.m_error_message = "Can not invoke method: " + e.getMessage() + " on data " + json;
result.confirm(null);
return true;
}catch(IllegalAccessException e){
api.m_error_message = "Can not access method: " + e.getMessage() + " on data " + json;
result.confirm(null);
return true;
}
return true;
}
On the javascript side it needs some changes as well, for example:
function callApiWorkaround(name, args){
if(!args) args = [];
var ret = prompt(g_api_signature + stringify({method: name, params: args}));
if(ret && typeof ret == 'string'){
ret = parse(ret);
return ret.result;
}
return ret;
}
function api_trace(msg, callee){
var method = 'trace';
if(api)
return api[method](msg, callee);
return callApiWorkaround(method, [msg, callee]);
}
@Override
public boolean onJsPrompt(WebView view, String url,
String message, String defaultValue,
JsPromptResult result) {
if(TextUtils.isEmpty(message) || !message.startsWith(SIGNATURE))
return false;
String json = message.substring(SIGNATURE.length());
try{
//It is our object
JSONObject info = new JSONObject(json);
JSONArray params = info.getJSONArray("params");
int len = params.length();
Object []paramValues = new Object[len];
for(int i=0; i<len; ++i){
Object obj = params.opt(i);
paramValues[i] = obj;
}
Method method = ReflectionUtils.findOnlyMethod(api.getClass(), info.getString("method"));
Object ret = method.invoke(api, paramValues);
JSONObject res = new JSONObject();
res.put("result", ret);
result.confirm(res.toString());
}catch(JSONException e){
api.m_error_message = "Couldn't parse rpc call: " + json;
result.confirm(null);
return true;
}catch(NoSuchMethodException e){
api.m_error_message = "Can not find method: " + e.getMessage() + " on data " + json;
result.confirm(null);
return true;
}catch(InvocationTargetException e){
api.m_error_message = "Can not invoke method: " + e.getMessage() + " on data " + json;
result.confirm(null);
return true;
}catch(IllegalAccessException e){
api.m_error_message = "Can not access method: " + e.getMessage() + " on data " + json;
result.confirm(null);
return true;
}
return true;
}
On the javascript side it needs some changes as well, for example:
function callApiWorkaround(name, args){
if(!args) args = [];
var ret = prompt(g_api_signature + stringify({method: name, params: args}));
if(ret && typeof ret == 'string'){
ret = parse(ret);
return ret.result;
}
return ret;
}
function api_trace(msg, callee){
var method = 'trace';
if(api)
return api[method](msg, callee);
return callApiWorkaround(method, [msg, callee]);
}
dm...@gmail.com <dm...@gmail.com> #142
With the workaround in comment 140 the only problem left is how to determine when it should be used instead of addJavaScriptInterface.
The comment 117 gives us a clue that it should be used when there is JSC on Gingerbread, but I don't think it's enough, because in comments 53, 54 they mentioned bugs on 2.2 phones.
The comment 117 gives us a clue that it should be used when there is JSC on Gingerbread, but I don't think it's enough, because in comments 53, 54 they mentioned bugs on 2.2 phones.
r....@gmail.com <r....@gmail.com> #143
Hi
I am facing the same issue . Has anyone found a fix or workaround for this yet? Any help is appreciated.
Thanks
I am facing the same issue . Has anyone found a fix or workaround for this yet? Any help is appreciated.
Thanks
ha...@gmail.com <ha...@gmail.com> #144
Hi,
I'm facing with this issue but i got some what different info in my logcat i'm attaching here..For the total project i have used 2.3.3,so for maps also i used this but now i'm facing this issue.How can i over come this .please help me in solving this issue.
I'm facing with this issue but i got some what different info in my logcat i'm attaching here..For the total project i have used 2.3.3,so for maps also i used this but now i'm facing this issue.How can i over come this .please help me in solving this issue.
dm...@gmail.com <dm...@gmail.com> #145
For those who lacks detailed solution, I present the more detailed one.
Say for calling simple toast function :
wb.addJavascriptInterface(new JavaScriptInterface(this), "Android");
In class JavaScriptInterface :
public void showToast(String toast) {
Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
}
suppose api is JavaScriptInterface implementation
wb is WebView
SIGNATURE is string constant defined by you to identify JSON RPC calls
First you need to implement WebChromeClient interface:
wb.setWebChromeClient(new WebChromeClient(){
@Override
public boolean onJsPrompt(WebView view, String url,
String message, String defaultValue,
JsPromptResult result) {
if(TextUtils.isEmpty(message) || !message.startsWith(SIGNATURE))
return false;
String json = message.substring(SIGNATURE.length());
try{
// Это наш объект
JSONObject info = new JSONObject(json);
JSONArray params = info.getJSONArray("params");
int len = params.length();
Object []paramValues = new Object[len];
for(int i=0; i<len; ++i){
Object obj = params.opt(i);
paramValues[i] = obj;
}
Method method = ReflectionUtils.findOnlyMethod(api.getClass(),
info.getString("method"));
Object ret = method.invoke(api, paramValues);
JSONObject res = new JSONObject();
res.put("result", ret);
result.confirm(res.toString());
}catch(JSONException e){
api.m_error_message = "Couldn't parse rpc call: " + json;
result.confirm(null);
return true;
}catch(NoSuchMethodException e){
api.m_error_message = "Can not find method: " + e.getMessage()
+ " on data " + json;
result.confirm(null);
return true;
}catch(InvocationTargetException e){
api.m_error_message = "Can not invoke method: " +
e.getMessage() + " on data " + json;
result.confirm(null);
return true;
}catch(IllegalAccessException e){
api.m_error_message = "Can not access method: " +
e.getMessage() + " on data " + json;
result.confirm(null);
return true;
}
return true;
}
});
//Now we can add javascript interface. In order to deal with gingerbread bug we can
//check current API level and if it is Gingerbread just not add the interface.
//Or as in this case we can pass api level to javascript for it to determine if it should call
//prompt instead of javascript interface
wb.addJavascriptInterface(new JavaScriptInterface(this), "Android");
onJsPrompt uses ReflectionUtils.findOnlyMethod:
/**
* Utilities for reflection.
*/
public class ReflectionUtils {
private static Map<String, Set<Method>> METHOD_CACHE
= new HashMap<String, Set<Method>>();
private ReflectionUtils() { }
/**
* Finds methods with the given name on the given class.
* @param clazz the class
* @param name the method name
* @return the methods
*/
public static Set<Method> findMethods(Class<?> clazz, String name) {
String cacheKey = clazz.getName().concat("::").concat(name);
if (METHOD_CACHE.containsKey(cacheKey)) {
return METHOD_CACHE.get(cacheKey);
}
Set<Method> methods = new HashSet<Method>();
for (Method method : clazz.getMethods()) {
if (method.getName().equals(name)) {
methods.add(method);
}
}
methods = Collections.unmodifiableSet(methods);
METHOD_CACHE.put(cacheKey, methods);
return methods;
}
/**
* Finds methods with the given name on the given class.
* @param clazz the class
* @param name the method name
* @return the methods
* @throws NoSuchMethodException
*/
public static Method findOnlyMethod(Class<?> clazz, String
name) throws NoSuchMethodException {
Set<Method> set = findMethods(clazz, name);
if(set.size() != 1)
throw new NoSuchMethodException(name + " zero or not
exactly one");
return set.iterator().next();
}
}
So the java part is done. Now let's make changes to the client.
Instead of just calling
Android.showToast('something') make the following:
var g_api_signature = 'SIGNATURE value from java part';
var g_api_androidAPI = 9; //This should be set to current
//android API level somehow from java part
var AndroidAPI = function(){
function isJSC(){
//You can determine which JS engine is in use at runtime through
//the following javascript snippet:
//(fromhttp://code.google.com/p/android/issues/detail?id=12987#c117 )
return window.devicePixelRatio &&
escape(navigator.javaEnabled.toString()) !==
'function%20javaEnabled%28%29%20%7B%20%5Bnative%20code%5D%20%7D';
}
function isGingerbread(){
var androidAPI = g_api_androidAPI;
return 9 <= androidAPI && androidAPI <= 10;
}
function shouldUseGingerbreadWorkaround(){
//The addJavaScriptInterface is encountered on gingerbread with
//JSC javascript engine
//So use workaround
return isGingerbread() && isJSC();
}
function ApiSystemError(msg){
this.name = 'AndroidApiError';
this.message = msg;
}
var api = shouldUseGingerbreadWorkaround() ? null : window.Android,
stringify = JSON.stringify, //You should also include json2.js
parse = JSON.parse; //fromhttps://github.com/douglascrockford/JSON-js
function callAndroid(name, args){
if(!args) args = [];
var ret = promptfunc(g_api_signature + stringify({method: name,
params: args}));
if(ret && typeof ret == 'string'){
if(ret.charAt(0) == '{'){
ret = parse(ret);
return ret.result;
}else{
//Error, a JSON object should have returned
throw new ApiSystemError(ret);
}
}else{
throw new ApiSystemError('Api returned nothing!');
}
}
/* the api_xxx functions are workaround for gingerbread bug *
*http://code.google.com/p/android/issues/detail?id=12987 */
function api_showToast(str){
var method = 'showToast';
//Please note that it is not even necessary for javascript
//interface to be really added. In such case we just call
//Java through prompt
if(api)
return api[method](str);
return callAndroid(method, [str]);
}
return {
showToast: function(str){
return api_showToast(str);
}
};
}();
//Safely show Toast:
AndroidAPI.showToast('something');
Well, something like that. Enjoy.
Say for calling simple toast function :
wb.addJavascriptInterface(new JavaScriptInterface(this), "Android");
In class JavaScriptInterface :
public void showToast(String toast) {
Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
}
suppose api is JavaScriptInterface implementation
wb is WebView
SIGNATURE is string constant defined by you to identify JSON RPC calls
First you need to implement WebChromeClient interface:
wb.setWebChromeClient(new WebChromeClient(){
@Override
public boolean onJsPrompt(WebView view, String url,
String message, String defaultValue,
JsPromptResult result) {
if(TextUtils.isEmpty(message) || !message.startsWith(SIGNATURE))
return false;
String json = message.substring(SIGNATURE.length());
try{
// Это наш объект
JSONObject info = new JSONObject(json);
JSONArray params = info.getJSONArray("params");
int len = params.length();
Object []paramValues = new Object[len];
for(int i=0; i<len; ++i){
Object obj = params.opt(i);
paramValues[i] = obj;
}
Method method = ReflectionUtils.findOnlyMethod(api.getClass(),
info.getString("method"));
Object ret = method.invoke(api, paramValues);
JSONObject res = new JSONObject();
res.put("result", ret);
result.confirm(res.toString());
}catch(JSONException e){
api.m_error_message = "Couldn't parse rpc call: " + json;
result.confirm(null);
return true;
}catch(NoSuchMethodException e){
api.m_error_message = "Can not find method: " + e.getMessage()
+ " on data " + json;
result.confirm(null);
return true;
}catch(InvocationTargetException e){
api.m_error_message = "Can not invoke method: " +
e.getMessage() + " on data " + json;
result.confirm(null);
return true;
}catch(IllegalAccessException e){
api.m_error_message = "Can not access method: " +
e.getMessage() + " on data " + json;
result.confirm(null);
return true;
}
return true;
}
});
//Now we can add javascript interface. In order to deal with gingerbread bug we can
//check current API level and if it is Gingerbread just not add the interface.
//Or as in this case we can pass api level to javascript for it to determine if it should call
//prompt instead of javascript interface
wb.addJavascriptInterface(new JavaScriptInterface(this), "Android");
onJsPrompt uses ReflectionUtils.findOnlyMethod:
/**
* Utilities for reflection.
*/
public class ReflectionUtils {
private static Map<String, Set<Method>> METHOD_CACHE
= new HashMap<String, Set<Method>>();
private ReflectionUtils() { }
/**
* Finds methods with the given name on the given class.
* @param clazz the class
* @param name the method name
* @return the methods
*/
public static Set<Method> findMethods(Class<?> clazz, String name) {
String cacheKey = clazz.getName().concat("::").concat(name);
if (METHOD_CACHE.containsKey(cacheKey)) {
return METHOD_CACHE.get(cacheKey);
}
Set<Method> methods = new HashSet<Method>();
for (Method method : clazz.getMethods()) {
if (method.getName().equals(name)) {
methods.add(method);
}
}
methods = Collections.unmodifiableSet(methods);
METHOD_CACHE.put(cacheKey, methods);
return methods;
}
/**
* Finds methods with the given name on the given class.
* @param clazz the class
* @param name the method name
* @return the methods
* @throws NoSuchMethodException
*/
public static Method findOnlyMethod(Class<?> clazz, String
name) throws NoSuchMethodException {
Set<Method> set = findMethods(clazz, name);
if(set.size() != 1)
throw new NoSuchMethodException(name + " zero or not
exactly one");
return set.iterator().next();
}
}
So the java part is done. Now let's make changes to the client.
Instead of just calling
Android.showToast('something') make the following:
var g_api_signature = 'SIGNATURE value from java part';
var g_api_androidAPI = 9; //This should be set to current
//android API level somehow from java part
var AndroidAPI = function(){
function isJSC(){
//You can determine which JS engine is in use at runtime through
//the following javascript snippet:
//(from
return window.devicePixelRatio &&
escape(navigator.javaEnabled.toString()) !==
'function%20javaEnabled%28%29%20%7B%20%5Bnative%20code%5D%20%7D';
}
function isGingerbread(){
var androidAPI = g_api_androidAPI;
return 9 <= androidAPI && androidAPI <= 10;
}
function shouldUseGingerbreadWorkaround(){
//The addJavaScriptInterface is encountered on gingerbread with
//JSC javascript engine
//So use workaround
return isGingerbread() && isJSC();
}
function ApiSystemError(msg){
this.message = msg;
}
var api = shouldUseGingerbreadWorkaround() ? null : window.Android,
stringify = JSON.stringify, //You should also include json2.js
parse = JSON.parse; //from
function callAndroid(name, args){
if(!args) args = [];
var ret = promptfunc(g_api_signature + stringify({method: name,
params: args}));
if(ret && typeof ret == 'string'){
if(ret.charAt(0) == '{'){
ret = parse(ret);
return ret.result;
}else{
//Error, a JSON object should have returned
throw new ApiSystemError(ret);
}
}else{
throw new ApiSystemError('Api returned nothing!');
}
}
/* the api_xxx functions are workaround for gingerbread bug *
*
function api_showToast(str){
var method = 'showToast';
//Please note that it is not even necessary for javascript
//interface to be really added. In such case we just call
//Java through prompt
if(api)
return api[method](str);
return callAndroid(method, [str]);
}
return {
showToast: function(str){
return api_showToast(str);
}
};
}();
//Safely show Toast:
AndroidAPI.showToast('something');
Well, something like that. Enjoy.
ga...@gmail.com <ga...@gmail.com> #146
@ comment 144:
I have tried the code you have posted above, i am getting some other errors..
and what is "api" in java code..
Can you please attach a sample project where you have enabled this??
Thanks,
Deepak K Garg
gargengineer.blogspot.com
I have tried the code you have posted above, i am getting some other errors..
and what is "api" in java code..
Can you please attach a sample project where you have enabled this??
Thanks,
Deepak K Garg
ju...@gmail.com <ju...@gmail.com> #148
So, I assume this has still not been fixed judging by the recent activity.
In summary...
I still get this error on 2.3.1 and 2.3.3 emulators.
However does it actually affect 2.3.3 devices? There seems to be some dispute in the thread about whether it does or not.
In summary...
I still get this error on 2.3.1 and 2.3.3 emulators.
However does it actually affect 2.3.3 devices? There seems to be some dispute in the thread about whether it does or not.
ul...@gmail.com <ul...@gmail.com> #149
What a Terrible Failure (WTF)
Please fix asap
Please fix asap
ag...@gmail.com <ag...@gmail.com> #150
fatality... mortality... bugality!
Please fix it
Please fix it
to...@gmail.com <to...@gmail.com> #151
Any news about this issue?
I'm experiencing the same problem with 3.1 and 4.0 version.
I'm experiencing the same problem with 3.1 and 4.0 version.
ha...@gmail.com <ha...@gmail.com> #152
I also get this error on android 2.3.3 emulators.
an...@gmail.com <an...@gmail.com> #153
Just got this error on android 2.3.3 emulators too.
ho...@gmail.com <ho...@gmail.com> #154
[2012-03-22 11:02:48 - LogCatFilter] Ignoring invalid text regex.
[2012-03-22 11:02:48 - LogCatFilter] Dangling meta character '*' near index 0
*:S
^
I also get this error on android 2.3.3 emulators and htc wildfire S
[2012-03-22 11:02:48 - LogCatFilter] Dangling meta character '*' near index 0
*:S
^
I also get this error on android 2.3.3 emulators and htc wildfire S
ma...@gmail.com <ma...@gmail.com> #155
I also get this error on android 2.3.3 emulator on Windows 7 Japanese.
(BTW, my au/KDDI IS03 (Android 2.2.1) do not get this error)
(BTW, my au/KDDI IS03 (Android 2.2.1) do not get this error)
bo...@gmail.com <bo...@gmail.com> #156
i wonder whether the issue was fixed
vo...@gmail.com <vo...@gmail.com> #157
FIXED!!!PLS!!! Google!!!
he...@gmail.com <he...@gmail.com> #158
[Comment deleted]
he...@gmail.com <he...@gmail.com> #159
[Comment deleted]
he...@gmail.com <he...@gmail.com> #160
I can reproduce this on Galaxy Nexus
da...@gmail.com <da...@gmail.com> #161
I wasted half a day trying to figure out why code that ran fine in 1.6 was crashing in 2.3.3 emulator.
do...@gmail.com <do...@gmail.com> #162
I re-ran into this issue today. What is shameful is that it has been 18 months since the issue was reported with apparently no fix or response from the Android team. (If there is a response, please link to it here). If only a small fraction of Android devices were still running 2.3.x then this problem would be a non-issue. This obviously isn't the case.
ju...@gmail.com <ju...@gmail.com> #163
GGGGGGGGGG OOOOOOOOOOOOOO OOOOOOOOOOOOOOOO GGGGGGGGGGGGGGG LLLLLLLLLLLLLL EEEEEEEEEEEE
Android 2.3 is still VERY relevent and this is f@#!ing pathetic!
Keep the hate mail coming, the tipping point may be near!
Android 2.3 is still VERY relevent and this is f@#!ing pathetic!
Keep the hate mail coming, the tipping point may be near!
el...@gmail.com <el...@gmail.com> #164
its too risky to use javascriptinterface callback since there are many device with os 2.3.+ around.
so i avoided it and used the html "a href" calling to pass back the data from my webview to the activity and process it there on. I used a webviewclient to listen to the called url and perform my stuff accordingly based on the url.
my codes are as below hope someone can comments or point out any weakness in it.
before that, sorry for my bad written english.
onCreate section:
WebView myWebView= (WebView) findViewById(R.id.myWebview);
myWebView.setWebViewClient(new myWebViewClient());
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
String myHTML = "<html><body><a href='androidcall01|123456'>Call Back to Android 01 with param 123456</a>my Content<p>my Content<p>my Content<p><a href='androidcall02|7890123'>Call Back to Android 01 with param 7890123</a></body></html>";
myWebView.loadDataWithBaseURL("about:blank", myHTML, "text/html", "utf-8", "");
Webview client utilize shouldOverrideUrlLoading:-
private class myWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
//Toast.makeText(getBaseContext(), "shouldOverrideUrlLoadin url: " + url, Toast.LENGTH_SHORT).show();
StringTokenizer st = new StringTokenizer(url, "|");
String function = st.nextToken();
String parameter = st.nextToken();
if ( function.equalsIgnoreCase("androidcall01") ) {
Toast.makeText(getApplicationContext(), "android call 01 value received: " + parameter, Toast.LENGTH_SHORT).show();
// do your stuff here.....
return true;
} else if ( function.equalsIgnoreCase("androidcall02") ) {
Toast.makeText(getApplicationContext(), "android call 02 value received: " + parameter, Toast.LENGTH_SHORT).show();
// do your stuff here.....
return true;
} else {
// its not an android call back
// let the browser navigate normally
return false;
}
}
}
so i avoided it and used the html "a href" calling to pass back the data from my webview to the activity and process it there on. I used a webviewclient to listen to the called url and perform my stuff accordingly based on the url.
my codes are as below hope someone can comments or point out any weakness in it.
before that, sorry for my bad written english.
onCreate section:
WebView myWebView= (WebView) findViewById(R.id.myWebview);
myWebView.setWebViewClient(new myWebViewClient());
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
String myHTML = "<html><body><a href='androidcall01|123456'>Call Back to Android 01 with param 123456</a>my Content<p>my Content<p>my Content<p><a href='androidcall02|7890123'>Call Back to Android 01 with param 7890123</a></body></html>";
myWebView.loadDataWithBaseURL("about:blank", myHTML, "text/html", "utf-8", "");
Webview client utilize shouldOverrideUrlLoading:-
private class myWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
//Toast.makeText(getBaseContext(), "shouldOverrideUrlLoadin url: " + url, Toast.LENGTH_SHORT).show();
StringTokenizer st = new StringTokenizer(url, "|");
String function = st.nextToken();
String parameter = st.nextToken();
if ( function.equalsIgnoreCase("androidcall01") ) {
Toast.makeText(getApplicationContext(), "android call 01 value received: " + parameter, Toast.LENGTH_SHORT).show();
// do your stuff here.....
return true;
} else if ( function.equalsIgnoreCase("androidcall02") ) {
Toast.makeText(getApplicationContext(), "android call 02 value received: " + parameter, Toast.LENGTH_SHORT).show();
// do your stuff here.....
return true;
} else {
// its not an android call back
// let the browser navigate normally
return false;
}
}
}
an...@gmail.com <an...@gmail.com> #165
Can anyone verify here that the javascript bridge has been fixed post-gingerbread? Can we assume business as usual on honeycomb and ics?
[Deleted User] <[Deleted User]> #166
I still get error on android 2.3.3 emulator......
vi...@gmail.com <vi...@gmail.com> #167
Rather than an application level workaround, does anybody know of a framework/webkit fix for this issue?
yu...@gmail.com <yu...@gmail.com> #168
2 years and the issue is still reproducible...
bu...@gmail.com <bu...@gmail.com> #169
i have got error on android 2.1
[Deleted User] <[Deleted User]> #170
I got same issue on both 2.3.3 emulator and real phone(Motorola 2.3.3).
jo...@gmail.com <jo...@gmail.com> #171
Clearly not fixed - got error on 2.3.3 AVD - I am wondering why this has not been fixed yet , it seems critical.
re...@gmail.com <re...@gmail.com> #172
Still not fixed on 2.3.3 emulator
re...@gmail.com <re...@gmail.com> #173
I just got the example of comment 140 to work, it was the best solution I could find for now...
In response to comment 145: 'api' should be an instance of the JavaScriptInterface class:
public JavaScriptInterface api = new JavaScriptInterface(this);
This object has to be reachable from within the onJsPrompt function.
I removed all references from 'api' to 'm_error_message', but if you do want to use this you have to add this property to your JavaScriptInterface class or else it will not build.
Another thing is that the Javascript part of the example uses a function called 'promptfunc'. You have to replace this with 'prompt'. This will invoke the onJsPrompt function declared in Java.
ra...@gmail.com <ra...@gmail.com> #174
For anyone who encounter this issue dealing with GWT application - in my case the workaround was to use Scheduler.get().scheduleDeferred(...) for the problematic instruction. I suppose for pure JavaScript app setTimeout() might be useful.
av...@gmail.com <av...@gmail.com> #175
wanted to express thanks to dmitry.k (comment 140) for the workaround. Although it still won't work in my case, as I am trying to simulate function calls into javascript that return values. Using the broken JavaScriptInterface it was possible to do it by busy-waiting, but the same trick will work with the onJsPrompt.
ro...@gmail.com <ro...@gmail.com> #176
I'm just wondering what is wrong in your guys' development and QA process that so many fatal bugs make it through your releases. How come Mobile Safari gets it right, but you guys can't? You're building a platform for thousands of developers running on millions of phones for f#43 sake!! You are the IE6 of mobile!!!
ju...@gmail.com <ju...@gmail.com> #177
I just want to know if the problem is on the emulator only? Is it also crashed on real devices??
at...@gmail.com <at...@gmail.com> #178
I've the same problem, I'm working on Android 4.0.3 on real device.
[Deleted User] <[Deleted User]> #179
[Comment deleted]
ya...@gmail.com <ya...@gmail.com> #180
Thanks 140 for workaround :)
sa...@gmail.com <sa...@gmail.com> #181
This is completely and utterly ridiculous that a patch has not been released for this
sa...@gmail.com <sa...@gmail.com> #182
163 is the best workaround. Thank god for this.
co...@gmail.com <co...@gmail.com> #183
I'm just wondering what is wrong in Google's development and QA process that so many fatal bugs make it through to production releases.
mr...@gmail.com <mr...@gmail.com> #184
thanks a lot!!! 144 and 172 workaround solved the issue for me :-)
ro...@gmail.com <ro...@gmail.com> #185
I get this error on the 2.3 simulator while loading ads from inneractive (and some other ad providers). Is there any way to detect, if the device supports V8 Engine from Java code?
This way, I could just load ads from another provider for this few devices.
About 32% of my users still have 2.3.x devices.
This way, I could just load ads from another provider for this few devices.
About 32% of my users still have 2.3.x devices.
ts...@gmail.com <ts...@gmail.com> #186
it's a shame
ng...@gmail.com <ng...@gmail.com> #187
This issue happened only on 2.3.3 emulator. It works on 4.0 and above emulators/devices.
Too bad I don't have a 2.3.3 device to test...
Too bad I don't have a 2.3.3 device to test...
ha...@gmail.com <ha...@gmail.com> #188
Woah, reported in 2010, now we have 2013 and still this isn't fixed.
Shame on you, Google.
Shame on you, Google.
ch...@gmail.com <ch...@gmail.com> #189
Since this is only on 2.3.3 I'm guessing at this point the estimated risk of losing business/upsetting developers outweighs the cost of fixing a bug almost 2 versions old.
pa...@appade.com <pa...@appade.com> #190
[Comment deleted]
pa...@appade.com <pa...@appade.com> #191
This is just another example of Google's web beta mentality where the end-users beta test their code. The problem is on Android, these bugs stick around forever on low-end Android handsets that never get updated. The poor suffering masses on Android developers must forever work-around Google's bugs because we can't just move onto the next release on Android like they do. One of my biggest clients is in the Czech Republic and the most popular Android handsets in the Czech Republic have this bug.
my...@gladesoft.com <my...@gladesoft.com> #192
I can't believe a major piece of functionality like this is completely broken. Sadly it's far from the only major API in Android that is completely non-functional.
my...@gladesoft.com <my...@gladesoft.com> #193
[Comment deleted]
si...@gmail.com <si...@gmail.com> #194
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
It is to be added for sdk versions more than 9 or 9
I hope this helps
Add this code in on Create method
this code should be placed fist in on create means it should be executed first
If it gives error than suppress warnings .
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
It is to be added for sdk versions more than 9 or 9
I hope this helps
Add this code in on Create method
this code should be placed fist in on create means it should be executed first
If it gives error than suppress warnings .
jb...@android.com <jb...@android.com> #195
[Comment deleted]
jb...@android.com <jb...@android.com> #196
[Comment deleted]
jb...@android.com <jb...@android.com>
al...@android.com <al...@android.com>
sg...@android.com <sg...@android.com>
te...@gmail.com <te...@gmail.com> #197
Webview death issue arrise for english language if i run same url by updating language from english to japan then it works fine but for English language not working please provide solution high priorty basis
Description
Note: The project file for that app is a little messed up, however, if you recreate the project, keeping the code the same, you can reproduce the error. The sample is old, but the code should still run as none of these interfaces have been deprecated.
It is also easily reproducible by creating a simple application that creates a webview, enables javascript, adds a JS interface, then loads a script into the webview. The code for this even simpler app is attached as well as WebViewTest and a secondary Test class as the "bridge".
The demos work as expected when using 2.2
This is a serious issue as it will cause crashes for any app using the webview to do any serious work. Thanks in advance for taking a look at this.
Attached is the output from logcat as well as the output from adb bugreport.