Flutter url_launcher does nothing or canLaunchUrl returns false
canLaunchUrl returns falseShort answer
On Android 11 and newer, and on iOS, canLaunchUrl returns false for any scheme you have not declared. Add a queries entry to AndroidManifest.xml and an LSApplicationQueriesSchemes entry to Info.plist for each scheme. If it is still false, the device may simply have no app for that scheme.
Fix it fast
1Find out which cause you have
Stop relying on canLaunchUrl for a moment and call launchUrl directly. It returns a bool, so you can see whether the launch itself fails.
final ok = await launchUrl(Uri.parse('https://example.com')); debugPrint('launchUrl returned $ok');2Match what you see, then jump to its fix
- 1
canLaunchUrl is false on Android 11 or higher, even though a browser or dialer is installedAndroid: the scheme is not declared in a queries blockFix - 2
canLaunchUrl is false on an iPhone for a scheme such as tel or smsiOS: the scheme is missing from LSApplicationQueriesSchemesFix - 3
Nothing opens for tel: or mailto: on a simulator or an emulator image without a dialer or mail appThe device has no app that handles the schemeFix
- 1
What does the error look like?
canLaunchUrl returns falseException: Could not launch https://example.comtel: and mailto: links do nothing on the emulator or simulator
Cause 1 of 3
Android: the scheme is not declared in a queries block
1Check
Open android/app/src/main/AndroidManifest.xml and look for a queries element. It must be a direct child of the root manifest element, and it needs one intent block per scheme you pass to canLaunchUrl.
grep -n -A12 "<queries>" android/app/src/main/AndroidManifest.xml2Fix
Add the schemes you check. For web links, Android documents this intent. The block sits next to application, not inside it.
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
<!-- one more intent block for each other scheme you check, for example tel or sms -->
</queries>
<application ...>3Verify
Stop the app, run it again (a hot reload does not re-read the manifest) and check the result.
flutter runConfirmed by developer.android.com
Cause 2 of 3
iOS: the scheme is missing from LSApplicationQueriesSchemes
1Check
Look in ios/Runner/Info.plist for the LSApplicationQueriesSchemes key.
grep -n -A6 LSApplicationQueriesSchemes ios/Runner/Info.plist2Fix
List every scheme you pass to canLaunchUrl.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>sms</string>
<string>tel</string>
</array>3Verify
Rebuild the iOS app and test on a device.
flutter run -d <device-id>Confirmed by pub.dev
Cause 3 of 3
The device has no app that handles the scheme
1Check
Test the same link on a real phone. The package notes that iOS simulators have no default email or phone app, so those links cannot open there.
flutter devices2Fix
Test tel and mailto on a real device. In the app, skip canLaunchUrl where you have a fallback: call launchUrl, and when it fails or throws, open an https page instead.
final uri = Uri(scheme: 'mailto', path: 'hello@example.com');
if (!await launchUrl(uri)) {
await launchUrl(Uri.parse('https://example.com/contact'));
}3Verify
On a real device the mail app opens; with none installed, the https fallback opens.
flutter run -d <device-id>Confirmed by pub.dev
How do I stop it coming back?
- Add the queries and LSApplicationQueriesSchemes entries in the same commit as the first canLaunchUrl call.
- Treat the launchUrl result as a bool and always show a message or fallback when it is false.
- Test tel, sms and mailto links on a real phone, not only on emulators.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
Related fixes
Mobile apps
Flutter Image.network shows nothing or throws when the image fails
EXCEPTION: resolving an image codec
Image.network throws an exception that goes to FlutterError.onError when a download or decode fails, so a 404 leaves a red screen or an empty box.
3 causes, each with a fixMobile apps
image_picker closes the app or returns nothing after choosing a photo
With launchMode singleInstance the picker always returns RESULT_CANCELED
On Android the system can kill MainActivity while the picker is open, so the app restarts and the result never arrives.
3 causes, each with a fixMobile apps
CLIENT_ID and REVERSED_CLIENT_ID are not in GoogleService-Info.plist
ANDROID_CLIENT_ID is missing from GoogleService-Info.plist
Firebase's Google sign-in steps enable the Google provider first and only then have you download a new GoogleService-Info.plist.
2 causes, each with a fixMobile apps
Scheduled flutter_local_notifications never appear when the app is closed
zonedSchedule does nothing, with no error shown
Local notifications are scheduled with the system, so they should fire while the app is closed.
5 causes, each with a fixMobile apps
flutter_local_notifications throws ArgumentError: iOS settings must be set
Android settings must be set when targeting Android platform.
The plugin's initialize call checks that InitializationSettings holds settings for the platform the app is running on.
3 causes, each with a fixMobile apps
Flutter cannot open a file: OS Error No such file or directory
FileSystemException: Cannot open file, path = '...' (OS Error: No such file or directory, errno = 2)
Errno 2 means the exact path you gave does not exist on the device.
3 causes, each with a fix