I Cant Open Flutter URL Via URL Launcher

109

Solution 1

If you are trying out the URL launcher in Android and the device API is 30+, try adding the query intent outside of the application tag in the Android Manifest.

<queries>
  <intent>
    <action android:name="android.intent.action.VIEW" />
    <data android:scheme="https" />
  </intent>
</queries>

Note: Use a stable Gradle version greater than 4 and update the studio to the latest version.

You can refer to: https://pub.dev/packages/url_launcher#android

Solution 2

The syntax you use is old. You also need to parse the url.

final url = Uri.parse('https://google.com');
    if (await canLaunchUrl(url)) {
      await launchUrl(url);
    }
Share:
109
Md. Kaosarul Islam
Author by

Md. Kaosarul Islam

Updated on January 04, 2023

Comments

  • Md. Kaosarul Islam
    Md. Kaosarul Islam over 1 year

    My Launcher is not working ! launch (overwitted).. What's the problem here?

    enter image description here

    • gretal
      gretal almost 2 years
      You can refer here for a reference.
  • Md. Kaosarul Islam
    Md. Kaosarul Islam almost 2 years
    Ok... But Still Link Not Working ... What's Going On .. ibb.co/1qhFtFQ
  • Sulaymon Ne'matov
    Sulaymon Ne'matov almost 2 years
    Is the internet enabled on the device? It works for me.
  • Harsh Sureja
    Harsh Sureja almost 2 years
    Wrap with try catch so that you can catch error with app crash and identify error easily