Skip to content

macos flutter: Could not start Dart VM service HTTP server #899

@adnankaya

Description

@adnankaya

Bug description

I was trying to run the flutter-examples on my macos and received following error

Could not start Dart VM service HTTP server: SocketException: Failed to create server socket (OS Error: Operation not permitted, errno = 1), address = 127.0.0.1, port = 0

I researched the error and found that the issue is related to network permission on macos.

Steps to reproduce

  1. clone the syncfusion/flutter-examples
  2. open with vscode, click Start Debugging, you will see error on debug console

Code sample

I opened a PR. Please review it.

open the file macos/Runner/DebugProfile.entitlements

<!--The below configuration is added to access the network for Maps samples-->
<key>com.apple.security.network.client</key>
<true/>
<!--The below configuration is added to access the network for Maps samples-->
<key>com.apple.security.network.client</key>
<true/>

SOLUTION: there should be a server and client both. the first permission can be changed from client to server.
<key>com.apple.security.network.server</key>

Source: https://stackoverflow.com/questions/61196860/how-to-enable-flutter-internet-permission-for-macos-desktop-app/61201081#61201081

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Stack Traces

Stack Traces
Could not start Dart VM service HTTP server: SocketException: Failed to create server socket (OS Error: Operation not permitted, errno = 1), address = 127.0.0.1, port = 0

On which target platforms have you observed this bug?

macOS

Flutter Doctor output

Doctor output
[Add your output here]

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    generalGeneralopenOpen and need to address

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions