2016-10-25 2 views
0

У меня есть активность с ViewPager и TabLayout, как показано ниже:WebView в NestedScrollView дает фатальный сигнал 6 (SIGABRT) код -6 RenderThread

<?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> 

Один из фрагментов является WebView. Чтобы скрыть панель инструментов при прокрутке WebView, у меня есть WebView в NestedScrollView.

До добавления NestedScrollView приложение работало нормально, но оно не скрывало Панель инструментов.

Теперь, как только WebView завершит загрузку, приложение закрывается без трассировки стека Java.

Компоновка Фрагмент ниже

<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 станет видимым.

Андроида Monitor читает:

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: [[email protected] 
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 сигнал 6 код -6, но ни один из них предложил решение.

Любая помощь очень ценится.

Редактировать - я удалил невидимость WebView по умолчанию и код, изменяющий его, и получил более крупную трассировку с более подробной информацией.

Я не могу разместить его здесь пост заканчивается в 59000 символов, но теперь на Pastebin Here

ответ

0

Ну, я нашел способ, чтобы получить поведение я хочу. Но не исправлять исходную проблему.

Я нашел this StackOverflow post, который предложил расширить WebView и реализовать NestedScrollingChild, как было сделано here (Apache2).

Это работает отлично. Однако это не решение реальной проблемы.

Компоновка Сейчас читает

<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"/> 


     <com.tpb.hn.story.NestedWebView 
      android:id="@+id/browser_webview" 
      app:layout_behavior="@string/appbar_scrolling_view_behavior" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:visibility="invisible"> 

     </com.tpb.hn.story.NestedWebView> 



</LinearLayout> 

Единственное изменение существо добавления layout_behavior.

0

У меня была аналогичная проблема. В моем случае проблема была с этим кодом:

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

я удалил эту строку кода, и мое приложение купирован сбой. Я столкнулся с этой проблемой на Android N. BTW Hardware acceleration is enabled by default if your Target API level is >=14, и я думаю, что эта строка кода избыточна.

Смежные вопросы