Skip to content

Xcode fails to resolve dependencies when Flutter plugin uses relative path for their target's source #184021

Description

@vashworth

When a plugin uses a relative path for their target's source, this will result in an error:

xcodebuild: error: Could not resolve package dependencies:
  target 'plugin_1' in package 'plugin_1' is outside the package root
    targets: [
        .target(
            name: "plugin_1",
            dependencies: [],
            path: "../Classes",
        )
    ]

This happens because plugins are symlinked in the same directory (introduced in #168932).

This pattern is not part of our migration guide, so I'm not sure why plugin authors are migrating this way. A couple example I found of people doing this:

https://github.com/rishabhsoftwarepvtltd/FlutterSecureVault/blob/5a91e3d1e789920f1863cde360bbd78eea2a1a5c/ios/rspl_secure_vault/Package.swift#L19-L22
https://github.com/Corkscrews/opus_flutter/blob/34b20c9e30601456e51baf1ac77b286969fb5037/opus_flutter_ios/ios/opus_codec_ios/Package.swift#L24

Activity

  1. stuartmorgan-g commented on Mar 23, 2026

    @stuartmorgan-g
    Contributor

    For migrations that aren't following our instructions and are wrong, we'll probably need to mostly rely on package clients who start trying to use SwiftPM reporting issues to the package authors.

  2. added
    platform-iosiOS applications specifically
    platform-macosBuilding on or for macOS specifically
    team-iosOwned by iOS platform team
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Mar 23, 2026
  3. hellohuanlin commented on Mar 26, 2026

    @hellohuanlin
    Contributor

    @vashworth could you elaborate more about why this happens and how it is related to #168932?

  4. added
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on Mar 26, 2026
  5. changed the title [-]Xcode fails to resolve dependencies when Flutter plugin uses relative path for[/-] [+]Xcode fails to resolve dependencies when Flutter plugin uses relative path for their target's source[/+] on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listplatform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallyteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions