I built an app in Flutter that has a link to my website. When I click on the link, the browser opens with an error code: "Unable to load page https://… because of net:ERR_CACHE_MISS".
pubspec.yaml
url_launcher: ^6.1.1
Mianifest.xml
<queries>
<intent>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="mailto" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
</queries>
Function call my websaid (example www.google.com):
Future<void> _launchUrl() async {
final Uri _url = Uri.parse('https://www.google.com');
if (!await launchUrl(_url)) {
throw Exception('Could not launch $_url');
}
}
If I additionally add to the Manifest:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="www.google.com" />
</intent-filter>
, then the built application installs on the phone, but does not start or depending on the hardware, it starts, but only information about the application.
Flutter 3.10.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f468f3366c (5 weeks ago) • 2023-07-12 15:19:05 -0700
Engine • revision cdbeda788a
Tools • Dart 3.0.6 • DevTools 2.23.1