Android reports an error when calling each other using the WebView component js and java

Source: Internet
Author: User

VM crash caused by Webkit engine in Android2.3
Java code
WARN/dalvikvm (429): jni warning: jarray 0x405986b0 points to non-array object (Ljava/lang/String ;)
INFO/dalvikvm (429): "WebViewCoreThread" prio = 5 tid = 9 NATIVE
INFO/dalvikvm (429): | group = "main" sCount = 0 dsCount = 0 obj = 0x4051_e0 self = 0x25b558
INFO/dalvikvm (429): | kernel id = 563 nice = 0 sched = 0/0 CRL = default handle = 2866504
INFO/dalvikvm (429): | schedstat = (496679324 479902011 97)
INFO/dalvikvm (429): at android. webkit. LoadListener. nativeFinished (Native Method)
INFO/dalvikvm (429): at android. webkit. LoadListener. nativeFinished (Native Method)
INFO/dalvikvm (429): at android. webkit. LoadListener. tearDown (LoadListener. java: 1200)
INFO/dalvikvm (429): at android. webkit. LoadListener. handleEndData (LoadListener. java: 721)
INFO/dalvikvm (429): at android. webkit. LoadListener. handleMessage (LoadListener. java: 219)
INFO/dalvikvm (429): at android. OS. Handler. dispatchMessage (Handler. java: 99)
INFO/dalvikvm (429): at android. OS. low.loop (low.java: 123)
INFO/dalvikvm (429): at android. webkit. WebViewCore $ WebCoreThread. run (WebViewCore. java: 629)
INFO/dalvikvm (429): at java. lang. Thread. run (Thread. java: 1019)
ERROR/dalvikvm (429): VM aborting
INFO/DEBUG (31 ): **************************************** ********
INFO/DEBUG (31): Build fingerprint: 'generic/sdk/generic: 2.3.1/GSI11/93351: eng/test-keys'
INFO/DEBUG (31): pid: 429, tid: 563 >>> org. mdx <
INFO/DEBUG (31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
INFO/DEBUG (31): r0 fffffebc r1 deadd00d r2 00000026 r3 00000000
INFO/DEBUG (31): r4 81da45c8 r5 405986b0 r6 81d859ec r7 002105f0
INFO/DEBUG (31): r8 4456bb58 r9 43db9ecc 10 43db9eb4 fp 41edd82c
INFO/DEBUG (31): ip 81da4728 sp 4456b4c8 lr afd19375 pc 81d45a02 cpsr 20000030
INFO/DEBUG (31): #00 pc 00045a02/system/lib/libdvm. so
INFO/DEBUG (31): #01 pc 000376fc/system/lib/libdvm. so
INFO/DEBUG (31): #02 pc 000399c4/system/lib/libdvm. so
INFO/DEBUG (31): #03 pc 0003a4a0/system/lib/libdvm. so
INFO/DEBUG (31): #04 pc 0032b6e6/system/lib/libwebcore. so
INFO/DEBUG (31): #05 pc 002a4db4/system/lib/libwebcore. so
INFO/DEBUG (31): #06 pc 001a6146/system/lib/libwebcore. so
INFO/DEBUG (31): #07 pc 002a5880/system/lib/libwebcore. so
INFO/DEBUG (31): #08 pc 00359e5e/system/lib/libwebcore. so
INFO/DEBUG (31): #09 pc 0035d1b6/system/lib/libwebcore. so
INFO/DEBUG (31): #10 pc 0036b0a0/system/lib/libwebcore. so
INFO/DEBUG (31): #11 pc 003627d8/system/lib/libwebcore. so
INFO/DEBUG (31): #12 pc 0029fb34/system/lib/libwebcore. so
INFO/DEBUG (31): #13 pc 0023366e/system/lib/libwebcore. so
INFO/DEBUG (31): #14 pc 000f5276/system/lib/libwebcore. so
INFO/DEBUG (31): #15 pc 000f6ad8/system/lib/libwebcore. so
INFO/DEBUG (31): #16 pc 0022a3ea/system/lib/libwebcore. so
INFO/DEBUG (31): #17 pc 0022af34/system/lib/libwebcore. so
INFO/DEBUG (31): #18 pc 000e2256/system/lib/libwebcore. so
INFO/DEBUG (31): #19 pc 000e3ab2/system/lib/libwebcore. so
INFO/DEBUG (31): #20 pc 000e3b92/system/lib/libwebcore. so
INFO/DEBUG (31): #21 pc 0022add8/system/lib/libwebcore. so
INFO/DEBUG (31): #22 pc 0026ee82/system/lib/libwebcore. so
INFO/DEBUG (31): #23 pc 000d13ec/system/lib/libwebcore. so
INFO/DEBUG (31): #24 pc 000d15cc/system/lib/libwebcore. so
INFO/DEBUG (31): #25 pc 00224446/system/lib/libwebcore. so
INFO/DEBUG (31): #26 pc 000e2676/system/lib/libwebcore. so
INFO/DEBUG (31): #27 pc 000e2696/system/lib/libwebcore. so
INFO/DEBUG (31): #28 pc 002719e2/system/lib/libwebcore. so
INFO/DEBUG (31): #29 pc 000e39d6/system/lib/libwebcore. so
INFO/DEBUG (31): #30 pc 00272d7c/system/lib/libwebcore. so
INFO/DEBUG (31): #31 pc 000eac5e/system/lib/libwebcore. so
INFO/DEBUG (31): code around pc:
INFO/DEBUG (31): 81d459e0 447a4479 ed0cf7d1 20004c09 ee34f7d1
INFO/DEBUG (31): 81d459f0 447c4808 6bdb5823 d0002b00 49064798
INFO/DEBUG (31): 81d45a00 700a2226 eea0f7d1 0004361f 000451dd
INFO/DEBUG (31): 81d45a10 0005ebd2 fffffebc deadd00d b510b40e
INFO/DEBUG (31): 81d45a20 4c0a4b09 447bb083 aa05591b 6b5bca02
INFO/DEBUG (31): code around lr:
INFO/DEBUG (31): afd19354 b0834a0d 589c447b 26009001 686768a5
INFO/DEBUG (31): afd19364 220ce008 2b005eab 1c28d003 47889901
INFO/DEBUG (31): afd19374 35544306 d5f43f01 2c006824 b003d1ee
INFO/DEBUG (31): afd19384 bdf01c30 000281a8 ffffff88 1c0fb5f0
INFO/DEBUG (31): afd19394 43551c3d a904b087 1c16ac01 604d9004
INFO/DEBUG (31): stack:
INFO/DEBUG (31): 4456b488 00000015
INFO/DEBUG (31): 4456b48c afd18407/system/lib/libc. so
INFO/DEBUG (31): 4456b490 afd4270c/system/lib/libc. so
INFO/DEBUG (31): 4456b494 afd1_b8/system/lib/libc. so
INFO/DEBUG (31): 4456b498 00000000
INFO/DEBUG (31): 4456b49c afd19375/system/lib/libc. so
INFO/DEBUG (31): 4456b4a0 0025b558 [heap]
INFO/DEBUG (31): 4456b4a4 afd183d9/system/lib/libc. so
INFO/DEBUG (31): 4456b4a8 002105f0 [heap]
INFO/DEBUG (31): 4456b4ac 0005ebd2 [heap]
INFO/DEBUG (31): 4456b4b0 405986b0/dev/ashmem/dalvik-heap (deleted)
INFO/DEBUG (31): 4456b4b4 81d859ec/system/lib/libdvm. so
INFO/DEBUG (31): 4456b4b8 002105f0 [heap]
INFO/DEBUG (31): 4456b4bc afd18437/system/lib/libc. so
INFO/DEBUG (31): 4456b4c0 df002777
INFO/DEBUG (31): 4456b4c4 e3a070ad
INFO/DEBUG (31): #00 4456b4c8 00000001
INFO/DEBUG (31): 4456b4cc 81d37701/system/lib/libdvm. so
INFO/DEBUG (31): #01 4456b4d0 00000001
INFO/DEBUG (31): 4456b4d4 81d399c9/system/lib/libdvm. so


I checked it on the Internet. It seems that the solution is quite troublesome. All the information on the Internet is a 2.3 Bug.
A bug exists in Android2.2, 2.3, and 2.3.3, which is described in detail here.
Http://code.google.com/p/android/issues/detail? Id = 12987
The core of the problem lies in the following sentence: jni warning: jarray 0x4074f6e0 points to non-array object (Ljava/lang/String ;)
That is, when JNI is called, a String object in Java is accessed as an array, resulting in Virtual Machine crash.

I checked on the Internet and found that it was basically a serious BUG and could not be solved. So if the WebView component was used to call each other between js and java, it would not be able to adapt to all models, therefore, we recommend that you do not use the WebView component when creating android native applications. Otherwise, the 2.3 system will crash directly.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.