1. Michael

    Founder of

    /DevStory: /macos/Flutter/GeneratedPluginRegistrant.swift:8:8: error build: No such module

    TLDR (solution for "/macos/Flutter/GeneratedPluginRegistrant.swift:8:8: error build: No such module")

    Open "Runner.xcworkspace" instead of "Runner.xcodeproj", then try to Product => Archive (in xcode), and voilà, your application should build without any problems.

    Story

    Today, I want to write about an issue I had recently which resulted in a lot of research and trying, and I wanted to share my experience as well as save you a lot of time. I recently wanted to publish a Flutter app to the Apple App Store. I had only had very good experiences with publishing iOS apps, but I had never before published a macOS app.

    When I was trying to publish my app at first using the normal "flutter build macos --release" command, which outputs an ".app" file, and then package it into a pkg file using some wild Thinktert chat-GPT script, I came across this Flutter post on how to publish the application.

    When you happen to run into a weird and really annoying issue which results in an error when you try to build or archive the application on Xcode: "/macos/Flutter/GeneratedPluginRegistrant.swift:8:8: error build: No such module 'xyz'", but you are able to run it via "flutter build macos --release" (or any other build command).

    How to solve this problem:

    For me, the problem was that I didn't open the .xcworkspace file but I tried to build from the "Runner.xcodeproj", in this case, open "Runner.xcworkspace" and then try to Product => Archive (in xcode) and voilà, your application should build without any problems.