当使用webview启动活动时,应用程序崩溃时出现“致命信号5(SIGTRAP),tid 13058中的代码1(Chrome_InProcRe)”

时间:2016-07-13 11:44:16

标签: android webview crash

有时,当Activity启用webview时,应用会崩溃。 Logcat包含以下消息:

  4982 11924 I ActivityManager: START u0 {cmp=com.ssp.software.fairstays.uk/com.ssp.software.fairstays.activities.HotelWebviewActivity (has extras)} from uid 10199 on display 0
  4982  7279 I sensors : batch
  4982  6602 I hubconnection: sensorhub said: 'batch 1 flags:0, sampling_rate_Hz:6.25, max_report_latency_us:0'
  4982  6719 D ConnectivityService: listenForNetwork for Listen from uid/pid:10199/9417 for NetworkRequest [ id=464, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
  9417  9417 D cr_Ime  : [InputMethodManagerWrapper.java:30] Constructor
  9417  9417 W cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
  9417  9417 D cr_Ime  : [InputMethodManagerWrapper.java:59] isActive: false
  9417  9417 I cr_Ime  : ImeThread is not enabled.
  9417 14058 F libc    : Fatal signal 5 (SIGTRAP), code 1 in tid 14058 (Chrome_InProcRe)
  4982  7460 I sensors : flush
  4982  6602 I hubconnection: sensorhub said: 'flush 1'
  4982  6602 I hubconnection: saw sensor 1 flushed
  9417  9417 D MixpanelAPI.AL: Please install the Bolts library >= 1.1.2 to track App Links: bolts.AppLinks
  3811  3811 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
  3811  3811 F DEBUG   : Build fingerprint: 'google/angler/angler:6.0.1/MTC19V/2862947:user/release-keys'
  3811  3811 F DEBUG   : Revision: '0'
  3811  3811 F DEBUG   : ABI: 'arm64'
  3811  3811 F DEBUG   : pid: 9417, tid: 14058, name: Chrome_InProcRe  >>> com.ssp.software.fairstays.uk <<<
  3811  3811 F DEBUG   : signal 5 (SIGTRAP), code 1 (TRAP_BRKPT), fault addr 0x27d7000024c9
  3811  3811 W debuggerd64: type=1400 audit(0.0:379591): avc: denied { search } for name="com.google.android.gms" dev="dm-2" ino=408839 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
  4982  4995 I art     : Background partial concurrent mark sweep GC freed 44648(2MB) AllocSpace objects, 14(296KB) LOS objects, 23% free, 50MB/66MB, paused 1.011ms total 111.445ms
  3811  3811 W debuggerd64: type=1400 audit(0.0:379592): avc: denied { search } for name="com.google.android.gms" dev="dm-2" ino=408839 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
  3811  3811 F DEBUG   :     x0   0000007f967e25dc  x1   0000007f98e5b000  x2   0000000000000001  x3   0000000000000001
  3811  3811 F DEBUG   :     x4   0000000000000000  x5   0000000000000001  x6   0000000000000000  x7   0000000000000000
  3811  3811 F DEBUG   :     x8   0000000000000001  x9   00000000030e544c  x10  0000007fabe8f888  x11  0000000021398c02
  3811  3811 F DEBUG   :     x12  0000000000000018  x13  ffffffffa87d457e  x14  00150497e0000000  x15  003b9aca00000000
  3811  3811 F DEBUG   :     x16  0000007f98d80fa8  x17  0000000000000000  x18  0000007f5aa1d8a0  x19  0000007f98e5c000
  3811  3811 F DEBUG   :     x20  0000007f57e32780  x21  0000007f8ea80080  x22  0000007f8ea80070  x23  0000007f98d83000
  3811  3811 F DEBUG   :     x24  0000007f8f59b600  x25  0000007f98d83000  x26  0000007f8ea80298  x27  0000007f8ea802e0
  3811  3811 F DEBUG   :     x28  0000007f8ea80370  x29  0000007f8ea7ff40  x30  0000007f967e27b4
  3811  3811 F DEBUG   :     sp   0000007f8ea7ff40  pc   0000007f967a35f4  pstate 0000000020000000
  3811  3811 F DEBUG   : 
  3811  3811 F DEBUG   : backtrace:
  3811  3811 F DEBUG   :     #00 pc 000000000117a5f4  /data/app/com.google.android.webview-2/lib/arm64/libwebviewchromium.so
  3811  3811 F DEBUG   :     #01 pc 00000000011b97b0  /data/app/com.google.android.webview-2/lib/arm64/libwebviewchromium.so
  3811  3811 W debuggerd64: type=1400 audit(0.0:379593): avc: denied { read } for name="kgsl-3d0" dev="tmpfs" ino=1239 scontext=u:r:debuggerd:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file permissive=0
  3811  3811 W debuggerd64: type=1400 audit(0.0:379594): avc: denied { read } for name="kgsl-3d0" dev="tmpfs" ino=1239 scontext=u:r:debuggerd:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file permissive=0
  7959  8454 D hunt    : DEFAULT_PERIOD: {}
  3811  3811 W debuggerd64: type=1400 audit(0.0:379595): avc: denied { search } for name="com.google.android.gms" dev="dm-2" ino=408839 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
  3811  3811 F DEBUG   : 
  3811  3811 F DEBUG   : Tombstone written to: /data/tombstones/tombstone_04
  3811  3811 E DEBUG   : AM write failed: Broken pipe
  4982 14073 W ActivityManager:   Force finishing activity com.ssp.software.fairstays.uk/com.ssp.software.fairstays.activities.HotelWebviewActivity
  4982 14073 W ActivityManager:   Force finishing activity com.ssp.software.fairstays.uk/com.ssp.software.fairstays.activities.TabBarActivity

WebView已启用javascript并在onCreate():

中加载网址
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl(url);

应用程序在多个设备上崩溃,而不是在所有设备上崩溃。这个问题有什么解决方案吗?

1 个答案:

答案 0 :(得分:1)

我也被这个类似的问题困扰了好几天。我出现的场景是App升级。

abiFilters'armeabi-v7a'升级到'armeabi-v7a','arm64-v8a',我的手机采用arm 64架构。

最后,我通过删除/data/data/packagename/app_webview文件夹解决了这个问题,希望以后可以帮助遇到此问题的人。