web-dev-qa-db-fra.com

Qu'est-ce que l'erreur 'Android.webkit.SafeBrowsingResponse'?

J'utilise webview dans mon activité.

Je ne sais pas quand, mais le message d'erreur suivant s'affiche.

Même si je cherche cela, je n'ai pas beaucoup d'informations.

Bien que ce ne soit pas une erreur grave, je voudrais y remédier afin que je ne reçoive pas un tel message.

Si quelqu'un sait comment y remédier, j'aimerais avoir un conseil.

Caused by: Java.lang.ClassNotFoundException: Didn't find class "Android.webkit.SafeBrowsingResponse" on path: DexPathList[[Zip file "/data/app/com.google.Android.webview-8CSSo1rZm_xmerbnZrD5xA==/base.apk"],nativeLibraryDirectories=[/data/app/com.google.Android.webview-8CSSo1rZm_xmerbnZrD5xA==/lib/arm64, /data/app/com.google.Android.webview-8CSSo1rZm_xmerbnZrD5xA==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
        at Java.lang.Class dalvik.system.BaseDexClassLoader.findClass(Java.lang.String) (BaseDexClassLoader.Java:93)
        at Java.lang.Class Java.lang.ClassLoader.loadClass(Java.lang.String, boolean) (ClassLoader.Java:379)
        at Java.lang.Class Java.lang.ClassLoader.loadClass(Java.lang.String) (ClassLoader.Java:312)
        at void com.Android.webview.chromium.WebViewChromium.init(Java.util.Map, boolean) (WebViewChromium.Java:42)
        at void Android.webkit.WebView.<init>(Android.content.Context, Android.util.AttributeSet, int, int, Java.util.Map, boolean) (WebView.Java:651)
        at void Android.webkit.WebView.<init>(Android.content.Context, Android.util.AttributeSet, int, int) (WebView.Java:581)
        at void Android.webkit.WebView.<init>(Android.content.Context, Android.util.AttributeSet, int) (WebView.Java:564)
        at void Android.webkit.WebView.<init>(Android.content.Context, Android.util.AttributeSet) (WebView.Java:551)
        at Java.lang.Object Java.lang.reflect.Constructor.newInstance0(Java.lang.Object[]) (Constructor.Java:-2)
        at Java.lang.Object Java.lang.reflect.Constructor.newInstance(Java.lang.Object[]) (Constructor.Java:334)
        at Android.view.View Android.view.LayoutInflater.createView(Java.lang.String, Java.lang.String, Android.util.AttributeSet) (LayoutInflater.Java:647)
        at Android.view.View com.Android.internal.policy.PhoneLayoutInflater.onCreateView(Java.lang.String, Android.util.AttributeSet) (PhoneLayoutInflater.Java:58)
        at Android.view.View Android.view.LayoutInflater.onCreateView(Android.view.View, Java.lang.String, Android.util.AttributeSet) (LayoutInflater.Java:720)
        at Android.view.View Android.view.LayoutInflater.createViewFromTag(Android.view.View, Java.lang.String, Android.content.Context, Android.util.AttributeSet, boolean) (LayoutInflater.Java:788)
        at Android.view.View Android.view.LayoutInflater.createViewFromTag(Android.view.View, Java.lang.String, Android.content.Context, Android.util.AttributeSet) (LayoutInflater.Java:730)
        at void Android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.content.Context, Android.util.AttributeSet, boolean) (LayoutInflater.Java:863)
        at void Android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.util.AttributeSet, boolean) (LayoutInflater.Java:824)
        at void Android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.content.Context, Android.util.AttributeSet, boolean) (LayoutInflater.Java:866)
        at void Android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.util.AttributeSet, boolean) (LayoutInflater.Java:824)
        at void Android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.content.Context, Android.util.AttributeSet, boolean) (LayoutInflater.Java:866)
        at void Android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.util.AttributeSet, boolean) (LayoutInflater.Java:824)
        at void Android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.content.Context, Android.util.AttributeSet, boolean) (LayoutInflater.Java:866)
        at void Android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.util.AttributeSet, boolean) (LayoutInflater.Java:824)
        at void Android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.content.Context, Android.util.AttributeSet, boolean) (LayoutInflater.Java:866)
        at void Android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.util.AttributeSet, boolean) (LayoutInflater.Java:824)
        at Android.view.View Android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, Android.view.ViewGroup, boolean) (LayoutInflater.Java:515)
        at Android.view.View Android.view.LayoutInflater.inflate(int, Android.view.ViewGroup, boolean) (LayoutInflater.Java:423)
        at Android.view.View Android.view.LayoutInflater.inflate(int, Android.view.ViewGroup) (LayoutInflater.Java:374)
        at void Android.support.v7.app.l.b(int) (SourceFile:287)
        at void Android.support.v7.app.e.setContentView(int) (SourceFile:139)
        at void bateaux.spt.coolnjoy.Activity.ArticleActivity.onCreate(Android.os.Bundle) (SourceFile:109)
        at void Android.app.Activity.performCreate(Android.os.Bundle) (Activity.Java:7174)
        at void Android.app.Instrumentation.callActivityOnCreate(Android.app.Activity, Android.os.Bundle) (Instrumentation.Java:1220)
        at Android.app.Activity Android.app.ActivityThread.performLaunchActivity(Android.app.ActivityThread$ActivityClientRecord, Android.content.Intent) (ActivityThread.Java:2910)
        at void Android.app.ActivityThread.handleLaunchActivity(Android.app.ActivityThread$ActivityClientRecord, Android.content.Intent, Java.lang.String) (ActivityThread.Java:3032)
        at void Android.app.ActivityThread.-wrap11(Android.app.ActivityThread, Android.app.ActivityThread$ActivityClientRecord, Android.content.Intent, Java.lang.String) (ActivityThread.Java:-1)
        at void Android.app.ActivityThread$H.handleMessage(Android.os.Message) (ActivityThread.Java:1696)
        at void Android.os.Handler.dispatchMessage(Android.os.Message) (Handler.Java:105)
        at void Android.os.Looper.loop() (Looper.Java:164)
        at void Android.app.ActivityThread.main(Java.lang.String[]) (ActivityThread.Java:6940)
        at Java.lang.Object Java.lang.reflect.Method.invoke(Java.lang.Object, Java.lang.Object[]) (Method.Java:-2)
        at void com.Android.internal.os.Zygote$MethodAndArgsCaller.run() (Zygote.Java:327)
        at void com.Android.internal.os.ZygoteInit.main(Java.lang.String[]) (ZygoteInit.Java:1374)
I/zygote64: Rejecting re-init on previously-failed class Java.lang.Class<com.Android.webview.chromium.WebViewContentsClientAdapter$3>: Java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/SafeBrowsingResponse;
        at void com.Android.webview.chromium.WebViewChromium.init(Java.util.Map, boolean) (WebViewChromium.Java:42)
        at void Android.webkit.WebView.<init>(Android.content.Context, Android.util.AttributeSet, int, int, Java.util.Map, boolean) (WebView.Java:651)
        at void Android.webkit.WebView.<init>(Android.content.Context, Android.util.AttributeSet, int, int) (WebView.Java:581)
        at void Android.webkit.WebView.<init>(Android.content.Context, Android.util.AttributeSet, int) (WebView.Java:564)
        at void Android.webkit.WebView.<init>(Android.content.Context, Android.util.AttributeSet) (WebView.Java:551)
        at Java.lang.Object Java.lang.reflect.Constructor.newInstance0(Java.lang.Object[]) (Constructor.Java:-2)
        at Java.lang.Object Java.lang.reflect.Constructor.newInstance(Java.lang.Object[]) (Constructor.Java:334)
        at Android.view.View Android.view.LayoutInflater.createView(Java.lang.String, Java.lang.String, Android.util.AttributeSet) (LayoutInflater.Java:647)
        at Android.view.View com.Android.internal.policy.PhoneLayoutInflater.onCreateView(Java.lang.String, Android.util.AttributeSet) (PhoneLayoutInflater.Java:58)
        at Android.view.View Android.view.LayoutInflater.onCreateView(Android.view.View, Java.lang.String, Android.util.AttributeSet) (LayoutInflater.Java:720)
        at Android.view.View Android.view.LayoutInflater.createViewFromTag(Android.view.View, Java.lang.String, Android.content.Context, Android.util.AttributeSet, boolean) (LayoutInflater.Java:788)
        at Android.view.View Android.view.LayoutInflater.createViewFromTag(Android.view.View, Java.lang.String, Android.content.Context, Android.util.AttributeSet) (LayoutInflater.Java:730)
        at void Android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.content.Context, Android.util.AttributeSet, boolean) (LayoutInflater.Java:863)
        at void Android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.util.AttributeSet, boolean) (LayoutInflater.Java:824)
        at void Android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.content.Context, Android.util.AttributeSet, boolean) (LayoutInflater.Java:866)
        at void Android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.util.AttributeSet, boolean) (LayoutInflater.Java:824)
        at void Android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.content.Context, Android.util.AttributeSet, boolean) (LayoutInflater.Java:866)
        at void Android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.util.AttributeSet, boolean) (LayoutInflater.Java:824)
        at void Android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.content.Context, Android.util.AttributeSet, boolean) (LayoutInflater.Java:866)
        at void Android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.util.AttributeSet, boolean) (LayoutInflater.Java:824)
        at void Android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.content.Context, Android.util.AttributeSet, boolean) (LayoutInflater.Java:866)
        at void Android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, Android.view.View, Android.util.AttributeSet, boolean) (LayoutInflater.Java:824)
        at Android.view.View Android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, Android.view.ViewGroup, boolean) (LayoutInflater.Java:515)
        at Android.view.View Android.view.LayoutInflater.inflate(int, Android.view.ViewGroup, boolean) (LayoutInflater.Java:423)
        at Android.view.View Android.view.LayoutInflater.inflate(int, Android.view.ViewGroup) (LayoutInflater.Java:374)
        at void Android.support.v7.app.l.b(int) (SourceFile:287)
        at void Android.support.v7.app.e.setContentView(int) (SourceFile:139)
        at void bateaux.spt.coolnjoy.Activity.ArticleActivity.onCreate(Android.os.Bundle) (SourceFile:109)
        at void Android.app.Activity.performCreate(Android.os.Bundle) (Activity.Java:7174)
        at void Android.app.Instrumentation.callActivityOnCreate(Android.app.Activity, Android.os.Bundle) (Instrumentation.Java:1220)
        at Android.app.Activity Android.app.ActivityThread.performLaunchActivity(Android.app.ActivityThread$ActivityClientRecord, Android.content.Intent) (ActivityThread.Java:2910)
        at void Android.app.ActivityThread.handleLaunchActivity(Android.app.ActivityThread$ActivityClientRecord, Android.content.Intent, Java.lang.String) (ActivityThread.Java:3032)
        at void Android.app.ActivityThread.-wrap11(Android.app.ActivityThread, Android.app.ActivityThread$ActivityClientRecord, Android.content.Intent, Java.lang.String) (ActivityThread.Java:-1)
        at void Android.app.ActivityThread$H.handleMessage(Android.os.Message) (ActivityThread.Java:1696)
        at void Android.os.Handler.dispatchMessage(Android.os.Message) (Handler.Java:105)
        at void Android.os.Looper.loop() (Looper.Java:164)
        at void Android.app.ActivityThread.main(Java.lang.String[]) (ActivityThread.Java:6940)
        at Java.lang.Object Java.lang.reflect.Method.invoke(Java.lang.Object, Java.lang.Object[]) (Method.Java:-2)
        at void com.Android.internal.os.Zygote$MethodAndArgsCaller.run() (Zygote.Java:327)
        at void com.Android.internal.os.ZygoteInit.main(Java.lang.String[]) (ZygoteInit.Java:1374)
29
01hanst

La solution au problème est la suivante:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
    view.getSettings().setSafeBrowsingEnabled(false);
}

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

Faites-moi savoir si cela ne fonctionne pas pour vous.

1
Niki Izvorski