Flutter webviews gives net::ERR_CACHE_MISS message

5,259

WebView in Debug is working because you have Internet permission in debug/androidManifest.xml

 <uses-permission android:name="android.permission.INTERNET"/>

add the same in main/androidManifest.xml

Share:
5,259
Rakesh
Author by

Rakesh

Updated on December 18, 2022

Comments

  • Rakesh
    Rakesh over 1 year

    When using webview in flutter i am getting this message. here is the code

    import 'package:flutter/material.dart';
    import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
    
    class Webview extends StatelessWidget {
      String url;
      Webview({this.url});
      @override
      Widget build(BuildContext context) {
        return WebviewScaffold(
          url: url,
          withJavascript: true,
          withLocalStorage: true,
          appCacheEnabled: false,
          withZoom: true,
          ignoreSSLErrors: true,
        );
      }
    }
    

    These are the permissions in debug/androidManifest.xml

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    

    I tried using webview_flutter and flutter_webview_plugin plugin both have the same issue.

    The app works fine in simulators but when used on real devices I get thrown this error. Please help and Thank you for reading.