【发布时间】: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) 无效
-
使用
flutter run安装设备(有效) -
使用签名制作 app bundle
fvm flutter build appbundle并从 bundle 中获取 apkbundletool 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(有效)
-
从
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>
【问题讨论】: