gpt4 book ai didi

android - NestedScrollView 中的 WebView 给出致命信号 6 (SIGABRT) 代码 -6 RenderThread

转载 作者:行者123 更新时间:2023-11-29 00:03:54 28 4
gpt4 key购买 nike

我有一个 ViewPager 和 TabLayout 的 Activity ,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">

<android.support.design.widget.AppBarLayout
android:id="@+id/item_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<android.support.v7.widget.Toolbar
android:id="@+id/item_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="0dp"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed">

</android.support.v7.widget.Toolbar>

<android.support.design.widget.TabLayout
android:id="@+id/item_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content">

</android.support.design.widget.TabLayout>

</android.support.design.widget.AppBarLayout>

<android.support.v4.view.ViewPager
android:id="@+id/item_viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

</android.support.v4.view.ViewPager>

</android.support.design.widget.CoordinatorLayout>

其中一个 fragment 是 WebView。为了在 WebView 滚动时隐藏工具栏,我将 WebView 放在 NestedScrollView 中。

在添加 NestedScrollView 之前,该应用运行良好,但它没有隐藏工具栏。

现在,一旦 WebView 完成加载,应用程序就会在没有 Java 堆栈跟踪的情况下关闭。

fragment 布局如下

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/browser_root"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ProgressBar
android:id="@+id/browser_loading_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminateTintMode="src_atop"
android:indeterminateTint="@color/colorAccent"
android:layout_gravity="center"/>

<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<WebView
android:id="@+id/browser_webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible">

</WebView>

</android.support.v4.widget.NestedScrollView>



</LinearLayout>

当要加载某些内容时,会调用 mWebView.loadUrl。 WebView 有一个客户端,因此当页面加载完成时,Spinner 可见性设置为消失并且 WebView 可见。

Android 监视器显示:

10-25 15:22:12.111 3871-3871/com.tpb.hn I/Browser: loadURL: WebView loading
10-25 15:22:12.113 3871-3871/com.tpb.hn I/cr_Ime: ImeThread is not enabled.
10-25 15:22:12.118 3871-3911/com.tpb.hn I/OpenGLRenderer: Initialized EGL, version 1.4
10-25 15:22:12.118 3871-3911/com.tpb.hn D/OpenGLRenderer: Swap behavior 1

[ 10-25 15:22:12.118 3871: 3911 D/ ]
HostConnection::get() New Host Connection established 0x7ffeeca88c00, tid 3911
10-25 15:22:12.126 3871-3936/com.tpb.hn E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
10-25 15:22:12.136 3871-3936/com.tpb.hn I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es

[ 10-25 15:22:12.138 3871: 3936 D/ ]
HostConnection::get() New Host Connection established 0x7ffeeb7fe080, tid 3936
10-25 15:22:12.219 3871-3871/com.tpb.hn W/chromium: [WARNING:shell.cc(299)] Instance: exe:chrome attempting to register an instance for a process it created for target: exe:chrome_renderer without the mojo:shell{client_process} capability class.
10-25 15:22:12.317 3871-3871/com.tpb.hn W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 3871
10-25 15:22:12.317 3871-3871/com.tpb.hn D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
10-25 15:22:12.418 3871-3876/com.tpb.hn I/art: Do partial code cache collection, code=24KB, data=29KB
10-25 15:22:12.419 3871-3876/com.tpb.hn I/art: After code cache collection, code=24KB, data=29KB
10-25 15:22:12.419 3871-3876/com.tpb.hn I/art: Increasing code cache capacity to 128KB
10-25 15:22:12.635 3871-3871/com.tpb.hn I/HNLoader: onResponse: [I@842b545
10-25 15:22:12.635 3871-3871/com.tpb.hn I/ContentAdapter: IdLoadDone:
10-25 15:22:13.673 3871-3876/com.tpb.hn I/art: Do partial code cache collection, code=55KB, data=61KB
10-25 15:22:13.673 3871-3876/com.tpb.hn I/art: After code cache collection, code=55KB, data=61KB
10-25 15:22:13.673 3871-3876/com.tpb.hn I/art: Increasing code cache capacity to 256KB
10-25 15:22:13.765 3871-3871/com.tpb.hn W/art: Attempt to remove non-JNI local reference, dumping thread
10-25 15:22:13.766 3871-3911/com.tpb.hn E/OpenGLRenderer: GL error: GL_INVALID_VALUE
10-25 15:22:13.766 3871-3911/com.tpb.hn A/OpenGLRenderer: GL errors! frameworks/base/libs/hwui/BakedOpRenderer.cpp:66

--------- beginning of crash
10-25 15:22:13.788 3871-3911/com.tpb.hn W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
10-25 15:22:13.788 3871-3911/com.tpb.hn W/google-breakpad: Chrome build fingerprint:
10-25 15:22:13.788 3871-3911/com.tpb.hn W/google-breakpad: 1.0
10-25 15:22:13.788 3871-3911/com.tpb.hn W/google-breakpad: 1
10-25 15:22:13.788 3871-3911/com.tpb.hn W/google-breakpad: f3e1957e-ea20-4058-8e10-b7e303fde16a
10-25 15:22:13.788 3871-3911/com.tpb.hn W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
10-25 15:22:13.788 3871-3911/com.tpb.hn A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 3911 (RenderThread)

[ 10-25 15:22:13.788 1181: 1181 W/ ]
debuggerd: handling request: pid=3871 uid=10066 gid=10066 tid=3911

loadUrl 是 WebView 开始加载的时间

我看过有关 Fatal signal 6 code -6 的帖子,但没有人提供解决方案。

非常感谢任何帮助。

编辑 - 我删除了 WebView 的默认不可见性以及更改它的代码,并获得了更大的跟踪和更多细节。

我不能在这里发布它,因为帖子最终有 59000 个字符,但它现在在 PasteBin 上 Here

最佳答案

我遇到了类似的问题。就我而言,问题出在这段代码上:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
}

我删除了这行代码,我的应用程序不再崩溃。我在 Android N 上遇到过这个问题。顺便说一句 Hardware acceleration is enabled by default if your Target API level is >=14我认为这行代码是多余的。

关于android - NestedScrollView 中的 WebView 给出致命信号 6 (SIGABRT) 代码 -6 RenderThread,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40242623/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com