Skip to content

Xcode fails to resolve dependencies when Flutter plugin uses relative path for #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

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions