Skip to content

[SwiftPM] Plugin not found right after adding #162399

@vashworth

Description

@vashworth

Steps to reproduce

Using Flutter 3.27.1, Xcode 16.2, iOS Simulator 18.2:

  1. Create a SwiftPM plugin:

    flutter config --enable-swift-package-manager
    flutter create --template=plugin --platforms=ios plugin_a
    
  2. Create a SwiftPM app:

    flutter config --enable-swift-package-manager
    flutter create my_app
    cd my_app
    flutter build ios --config-only
    
  3. Open project in Xcode

    1. Open the app's ios/Runner.xcworkspace using Xcode
  4. Modify my_app/pubspec.yaml to depend on the plugin:

      dependencies:
    +   plugin_a:
    +     path: ../plugin_a
  5. Start iOS simulator 18.2

  6. Run the app:

flutter run

Expected results

I expect plugin_a to be found. I suspect this is a caching issue that's cause by having the project open in Xcode while also running from the command line, but we should look into it more.

Actual results

           ComputeTargetDependencyGraph
           note: Building targets in dependency order
           note: Target dependency graph (3 targets)
               Target 'Runner' in project 'Runner'
                   ➜ Explicit dependency on target 'FlutterGeneratedPluginSwiftPackage' in project 'FlutterGeneratedPluginSwiftPackage'
               Target 'FlutterGeneratedPluginSwiftPackage' in project 'FlutterGeneratedPluginSwiftPackage'
                   ➜ Explicit dependency on target 'FlutterGeneratedPluginSwiftPackage' in project 'FlutterGeneratedPluginSwiftPackage'
               Target 'FlutterGeneratedPluginSwiftPackage' in project 'FlutterGeneratedPluginSwiftPackage' (no dependencies)

...

GeneratedPluginRegistrant.m:12:9: error: Module 'plugin_a' not found (in target 'Runner' from project 'Runner')

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions