`TargetPLatform.macOS` 尚不受地图插件支持,但我正在为 web 显示构建它。

huangapple go评论49阅读模式
英文:

`TargetPLatform.macOS is not yet supported by the maps plugin`, but I'm building it for a web display

问题

我有一个使用 google_maps_fluttergoogle_maps_flutter_web 的Flutter Web应用,在我的本地机器上运行良好。当我尝试构建它以部署到Web服务器时,我收到错误消息 TargetPLatform.macOS is not yet supported by the maps plugin,地图应该显示在那里。在VSCode的launch.json文件中,用于工作的命令是:

{
    "name": "my_app",
    "request": "launch",
    "type": "dart",
    "args":[
        "--dart-define", "BASE_URL=https://~~~~~~",
        "--web-port", "5050",
        "--web-renderer", "html"
    ]
}

我用于构建部署应用程序的命令是:

flutter build web \
    --dart-define=BASE_URL="$base-url" \
    --web-renderer=html

我是在Mac上构建网站。

英文:

I've got a flutter web app using google_maps_flutter and google_maps_flutter_web and it works fine on my local machine. When I attempt to build it for deploy to the web server, I get the error TargetPLatform.macOS is not yet supported by the maps plugin where a map is supposed to display. The command in launch.json for vscode (that works) is:

        {
            "name": "my_app",
            "request": "launch",
            "type": "dart",
            "args":[
                "--dart-define", "BASE_URL=https://~~~~~~",
                "--web-port", "5050",
                "--web-renderer", "html"
            ]
        },

The command I use for building the app for deploy is:

flutter build web \
        --dart-define=BASE_URL="$base-url" \
        --web-renderer=html

I am building the website on a Mac.

答案1

得分: 1

我使用了这个命令,它有效果了!
英文:
flutter build web --profile --web-renderer=html

I used this command and it worked!

huangapple
  • 本文由 发表于 2023年4月7日 02:15:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/75952575.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定