当前位置:  开发笔记 > 编程语言 > 正文

Webview显示错误"没找到类"android.webkit.RenderProcessGoneDetail"

如何解决《Webview显示错误"没找到类"android.webkit.RenderProcessGoneDetail"》经验,为你挑选了2个好方法。

我的平板电脑Android版本为7.0,Chrome版本为62.0.3202.84.

首次运行我的webview应用程序时,调试窗口显示

没有找到类"android.webkit.RenderProcessGoneDetail

RenderProcessGoneDetail是android 8.0 API

如何防止出现错误消息?

11-28 13:23:13.133 28584-28584/com.himart.omni.himartomniapp I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art: Rejecting re-init on previously-failed class java.lang.Class: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/RenderProcessGoneDetail;
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at com.android.webview.chromium.Ap com.android.webview.chromium.WebViewChromiumFactoryProvider.G(android.webkit.WebView, android.content.Context) (WebViewChromiumFactoryProvider.java:323)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:42)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int, int, java.util.Map, boolean) (WebView.java:636)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int, int) (WebView.java:572)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int) (WebView.java:555)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet) (WebView.java:542)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at java.lang.Object java.lang.reflect.Constructor.newInstance0!(java.lang.Object[]) (Constructor.java:-2)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:430)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:652)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View com.android.internal.policy.PhoneLayoutInflater.onCreateView(java.lang.String, android.util.AttributeSet) (PhoneLayoutInflater.java:58)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.onCreateView(android.view.View, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:724)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:792)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:734)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:865)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:828)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:873)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:828)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:525)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:427)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:378)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void com.android.internal.policy.PhoneWindow.setContentView(int) (PhoneWindow.java:459)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.Activity.setContentView(int) (Activity.java:2548)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void com.himart.omni.himartomniapp.view.activity.WebViewActivity.onCreate(android.os.Bundle) (WebViewActivity.java:257)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6955)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1126)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2927)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3045)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.ActivityThread.-wrap14(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1642)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.os.Looper.loop() (Looper.java:154)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6776)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1496)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1386)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.webkit.RenderProcessGoneDetail" on path: DexPathList[[zip file "/data/app/com.android.chrome-1/base.apk"],nativeLibraryDirectories=[/data/app/com.android.chrome-1/lib/arm, /data/app/com.android.chrome-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at com.android.webview.chromium.Ap com.android.webview.chromium.WebViewChromiumFactoryProvider.G(android.webkit.WebView, android.content.Context) (WebViewChromiumFactoryProvider.java:323)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:42)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int, int, java.util.Map, boolean) (WebView.java:636)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int, int) (WebView.java:572)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int) (WebView.java:555)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet) (WebView.java:542)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at java.lang.Object java.lang.reflect.Constructor.newInstance0!(java.lang.Object[]) (Constructor.java:-2)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:430)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:652)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View com.android.internal.policy.PhoneLayoutInflater.onCreateView(java.lang.String, android.util.AttributeSet) (PhoneLayoutInflater.java:58)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.onCreateView(android.view.View, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:724)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:792)
11-28 13:23:13.273 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:734)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:865)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:828)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:873)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:828)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:525)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:427)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:378)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void com.android.internal.policy.PhoneWindow.setContentView(int) (PhoneWindow.java:459)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.Activity.setContentView(int) (Activity.java:2548)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void com.himart.omni.himartomniapp.view.activity.WebViewActivity.onCreate(android.os.Bundle) (WebViewActivity.java:257)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6955)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1126)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2927)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3045)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.ActivityThread.-wrap14(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1642)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.os.Looper.loop() (Looper.java:154)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6776)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1496)
11-28 13:23:13.274 28584-28584/com.himart.omni.himartomniapp I/art:     at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1386)

user1991679.. 29

这似乎是一个错误,更多详情请访问:https://groups.google.com/a/chromium.org/forum/#!topic/installer -webview-dev/m0EtO3IXNn0

在N +新的艺术记录似乎已经出台,让应用程序开发者了解他们的某些代码的二进制兼容性问题.不幸的是,这触发了WebView中一些API级别的保护代码.

一个例子是"失败的解析:Landroid/webkit/RenderProcessGoneDetail;",只要在N设备上使用最新版本的带有O功能的WebView,就会触发该错误.这对于查看logcat的开发人员来说是无害的,但令人困惑和垃圾.

你能在N台设备上解决这个问题吗?我面临同样的事情. (2认同)


palamunder.. 7

Android 7.0之后出现问题,但我设法找到了解决方案.对我来说,它遵循本教程.在摘要中,片段应如下所示:

public class WebFragment1 extends Fragment{
    public WebFragment1() {
        // Required empty public constructor
    }

    WebView wvPage1;
    String url = "http://apptimist.studio";
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View v = inflater.inflate(R.layout.fragment_web_fragment1, container, false);
        wvPage1 = (WebView)v.findViewById(R.id.wvPage1);
        wvPage1.loadUrl(url);
        WebSettings settings = wvPage1.getSettings();
        settings.setJavaScriptEnabled(true);
        wvPage1.setWebViewClient(new MyWebViewClient());
        return v;
    }

    private class MyWebViewClient extends WebViewClient{
        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            // TODO Auto-generated method stub
            super.onPageStarted(view, url, favicon);
        }

        @SuppressWarnings("deprecation")
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            final Uri uri = Uri.parse(url);
            return true;
        }

        @TargetApi(Build.VERSION_CODES.N)
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
            view.loadUrl(request.getUrl().toString());
            return true;
        }
    }

我尝试了没有这两行,但它没有工作,所以我把它们包括起来并且它起作用了.注意添加它们

WebSettings settings = wvPage1.getSettings();
settings.setJavaScriptEnabled(true);

有通知可能存在XSS攻击的漏洞,您应该优先打开受信任的网站.

这是布局:



    


希望这会帮助别人,因为我花了很多时间寻找解决方案



1> user1991679..:

这似乎是一个错误,更多详情请访问:https://groups.google.com/a/chromium.org/forum/#!topic/installer -webview-dev/m0EtO3IXNn0

在N +新的艺术记录似乎已经出台,让应用程序开发者了解他们的某些代码的二进制兼容性问题.不幸的是,这触发了WebView中一些API级别的保护代码.

一个例子是"失败的解析:Landroid/webkit/RenderProcessGoneDetail;",只要在N设备上使用最新版本的带有O功能的WebView,就会触发该错误.这对于查看logcat的开发人员来说是无害的,但令人困惑和垃圾.


你能在N台设备上解决这个问题吗?我面临同样的事情.

2> palamunder..:

Android 7.0之后出现问题,但我设法找到了解决方案.对我来说,它遵循本教程.在摘要中,片段应如下所示:

public class WebFragment1 extends Fragment{
    public WebFragment1() {
        // Required empty public constructor
    }

    WebView wvPage1;
    String url = "http://apptimist.studio";
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View v = inflater.inflate(R.layout.fragment_web_fragment1, container, false);
        wvPage1 = (WebView)v.findViewById(R.id.wvPage1);
        wvPage1.loadUrl(url);
        WebSettings settings = wvPage1.getSettings();
        settings.setJavaScriptEnabled(true);
        wvPage1.setWebViewClient(new MyWebViewClient());
        return v;
    }

    private class MyWebViewClient extends WebViewClient{
        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            // TODO Auto-generated method stub
            super.onPageStarted(view, url, favicon);
        }

        @SuppressWarnings("deprecation")
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            final Uri uri = Uri.parse(url);
            return true;
        }

        @TargetApi(Build.VERSION_CODES.N)
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
            view.loadUrl(request.getUrl().toString());
            return true;
        }
    }

我尝试了没有这两行,但它没有工作,所以我把它们包括起来并且它起作用了.注意添加它们

WebSettings settings = wvPage1.getSettings();
settings.setJavaScriptEnabled(true);

有通知可能存在XSS攻击的漏洞,您应该优先打开受信任的网站.

这是布局:



    


希望这会帮助别人,因为我花了很多时间寻找解决方案

推荐阅读
保佑欣疼你的芯疼
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有