Skip to content

[url_launcher] Provide better error message for SE_ERR_NOASSOC (code 31) #138142

Description

@KristijanMitrik

Is there an existing issue for this?

What package does this bug report belong to?

url_launcher

What target platforms are you seeing this bug on?

Windows

Have you already upgraded your packages?

Yes

Dependency versions

pubspec.lock
[Paste file content here]

Steps to reproduce

  1. launchUrl(
    Uri.parse('URL'),
    mode: LaunchMode.externalNonBrowserApplication,
    ),

Expected results

Launching the url

Actual results

PlatformException: PlatformException(open_error, Failed to open "URL HERE" ShellExecute error code 31, null, null)

Code sample

Code sample
[Paste your code here]

launchUrl(
Uri.parse('URL'),
),

Screenshots or Videos

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Activity

  1. changed the title [-][url_launcher] Windows 10 url_launcher package launch error[/-] [+][url_launcher] Provide better error message for `SE_ERR_NOASSOC` (code 31)[/+] on Nov 9, 2023
  2. added
    platform-windowsBuilding on or for Windows specifically
    p: url_launcherPlugin to launch external applications
    packageflutter/packages repository. See also p: labels.
    on Nov 9, 2023
  3. stuartmorgan-g commented on Nov 9, 2023

    @stuartmorgan-g
    Contributor

    Error code 31 is SE_ERR_NOASSOC, meaning there's no handler registered for that URL.

    To make this less confusing, and be more consistent with most of the other platforms, we should special case this error code to return false instead of throwing.

  4. KristijanMitrik commented on Nov 9, 2023

    @KristijanMitrik
    Author

    @stuartmorgan this URL should be handled by the default browser cause it's a regular web app link, this issue only happens on windows 10 and on every other platform and windows 11 it's working perfectly fine. Do you know what can be the cause of this?

  5. stuartmorgan-g commented on Nov 9, 2023

    @stuartmorgan-g
    Contributor

    We don't have any more information that what is in the error message: the plugin requested (via ShellExecute) that the OS open the URL you provided, and got an error in response saying there is no associated handler. Perhaps your default browser has not correctly registered itself as the handler for web URLs, or perhaps there's an issue with the URL itself (you haven't provided the string you are using, so we have less information here than you do).

  6. KristijanMitrik commented on Nov 9, 2023

    @KristijanMitrik
    Author

    @stuartmorgan URL that we try to launch looks something like this https://appdomain.com/oauth/authorize?client_id=app&response_type=code&code_challenge=pvMiMthjGCumrvqcgCJRd2u_sMedCIqbrf0h0BgcnIU&code_challenge_method=s256. I can't reproduce the error myself on windows 10 but I see that couple of users encounter this problem in the Sentry logs and all the users are using windows 10. Maybe you see something in the URL that can be a problem?

  7. github-actions commented on Dec 27, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Dec 27, 2023
  9. added
    team-windowsOwned by the Windows platform team
    and removed on Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

a: desktopRunning on desktopp: url_launcherPlugin to launch external applicationspackageflutter/packages repository. See also p: labels.platform-windowsBuilding on or for Windows specificallyteam-windowsOwned by the Windows platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions