首页 > WebView组件出现unfortunately has stopped

WebView组件出现unfortunately has stopped

logcat:

04-11 08:57:01.327: W/System(3862): ClassLoader referenced unknown path: /data/app/com.bluehaw-2/lib/x86
04-11 08:57:01.354: I/WebViewFactory(3862): Loading com.android.webview version 44.0.2403.119 (code 246011910)
04-11 08:57:01.365: W/System(3862): ClassLoader referenced unknown path: /system/app/webview/lib/x86
04-11 08:57:01.371: I/LibraryLoader(3862): Time to load native libraries: 1 ms (timestamps 9904-9905)
04-11 08:57:01.371: I/LibraryLoader(3862): Expected native library version number "",actual native library version number ""
04-11 08:57:01.377: V/WebViewChromiumFactoryProvider(3862): Binding Chromium to main looper Looper (main, tid 1) {d58cbd3}
04-11 08:57:01.377: I/LibraryLoader(3862): Expected native library version number "",actual native library version number ""
04-11 08:57:01.377: I/chromium(3862): [INFO:library_loader_hooks.cc(120)] Chromium logging enabled: level = 0, default verbosity = 0
04-11 08:57:01.393: I/BrowserStartupController(3862): Initializing chromium process, singleProcess=true
04-11 08:57:01.394: W/art(3862): Attempt to remove non-JNI local reference, dumping thread
04-11 08:57:01.394: E/SysUtils(3862): ApplicationContext is null in ApplicationStatus
04-11 08:57:01.403: W/chromium(3862): [WARNING:resource_bundle.cc(285)] locale_file_path.empty()
04-11 08:57:01.405: E/libEGL(3862): validate_display:255 error 3008 (EGL_BAD_DISPLAY)
04-11 08:57:01.405: E/libEGL(3862): validate_display:255 error 3008 (EGL_BAD_DISPLAY)
04-11 08:57:01.405: E/chromium(3862): [ERROR:gl_surface_egl.cc(327)] No suitable EGL configs found.
04-11 08:57:01.405: E/chromium(3862): [ERROR:gl_surface_android.cc(23)] GLSurfaceEGL::InitializeOneOff failed.
04-11 08:57:01.405: E/chromium(3862): [ERROR:browser_main_loop.cc(698)] GLSurface::InitializeOneOff failed
04-11 08:57:01.412: W/AudioManagerAndroid(3862): Requires BLUETOOTH permission
04-11 08:57:01.418: E/DataReductionProxySettingListener(3862): No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
04-11 08:57:01.487: W/art(3862): Attempt to remove non-JNI local reference, dumping thread
04-11 08:57:01.492: W/AwContents(3862): onDetachedFromWindow called when already detached. Ignoring
04-11 08:57:01.528: W/chromium(3862): [WARNING:data_reduction_proxy_config.cc(423)] SPDY proxy OFF at startup
04-11 08:57:01.796: D/gralloc_ranchu(3862): Emulator without host-side GPU emulation detected.
04-11 08:57:01.835: A/chromium(3862): [FATAL:gl_surface_android.cc(58)] Check failed: kGLImplementationNone != GetGLImplementation() (0 vs. 0)
04-11 08:57:01.835: A/libc(3862): Fatal signal 6 (SIGABRT), code -6 in tid 3900 (GpuThread)

main.xml文件

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin" >

    <WebView 
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/webView"/>

</RelativeLayout>

MainActivity.java

package com.bluehaw;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends Activity {

    private WebView webView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        webView = (WebView) findViewById(R.id.webView);//获得网页视图
        webView.loadUrl("file:///android:asset/index.html");//加载网页资源
    }
}

file:///android:asset/index.html
你确定你这路径没用写错??

【热门文章】
【热门文章】