【问题标题】:net::ERR_CACHE_MISS Android webview flutter with <uses-permission android:name="android.permission.INTERNET"/>net::ERR_CACHE_MISS Android webview 与 <uses-permission android:name="android.permission.INTERNET"/>
【发布时间】:2021-10-04 09:46:29
【问题描述】:

我有在颤振上使用 webview 的应用程序。

我在设备上启动应用程序时遇到了这个错误。

net::ERR_CACHE_MISS

我搜索了一下,发现很多文章都说在 AndroidManifest.xml 中添加此权限

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

但是我已经在 AndroidManfest.xml 中找到了这个

只有从google play下载应用时才会发生这种情况。

我尝试了一些方法。 1) 2) 有效和 3) 无效

  1. 使用flutter run 安装设备(有效)

  2. 使用签名制作 app bundle fvm flutter build appbundle 并从 bundle 中获取 apk

    bundletool build-apks --bundle=build/app/outputs/bundle/release/app-release.aab
    --output=build/app/outputs/bundle/release/app-release.apks
    --ks=key/my-release-key.jks
    --ks-pass=pass:mypass
    --ks-key-alias=我的别名
    --key-pass=pass:mypass

    然后安装bundletool install-apks --apks=build/app/outputs/bundle/release/app-release.apks

    (有效)

  3. google play 安装(显示错误)

有什么要点,我应该检查一下吗??

app/src/main/AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.guessdrawing">
    <!--THe Internet Permission -->
    <uses-permission android:name="android.permission.INTERNET"/>
   <application
        android:label="My whatapp"
        android:icon="@mipmap/launcher_icon">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

【问题讨论】:

    标签: android flutter


    【解决方案1】:

    您可以尝试在调试中将相同的跟踪添加到清单文件吗? 调试/androidManifest.xml

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

    【讨论】:

    • 如果没有,可以尝试在manifest中添加如下权限:
    • 感谢您的帮助。我尝试了同样的方法,但徒劳无功。我也更新文章中的情况。仅当从 Play 商店下载应用程序时才会发生,如果我直接将 apk 安装到设备上,则不会发生。
    猜你喜欢
    • 1970-01-01
    • 2015-08-18
    • 1970-01-01
    • 1970-01-01
    • 2021-12-05
    • 2015-12-18
    • 2012-09-20
    • 1970-01-01
    • 2016-12-14
    相关资源
    最近更新 更多