Skip to content

SwiftPM fails to compile plugin when plugin version changes while project is open in Xcode #182099

Description

@vashworth
  1. flutter config --enable-swift-package-manager
  2. flutter create my_app && cd my_app
  3. flutter pub add image_picker_ios:0.8.13+2
  4. flutter build ios --config-only
  5. open ios/Runner.xcworkspace
  6. Build app in Xcode
  7. flutter pub add image_picker_ios:0.8.13+6
  8. Build app in Xcode

This will cause an error. Looks like it's still using image_picker_ios:0.8.13+2, despite the symlink being updated to image_picker_ios:0.8.13+6

Image
In file included from /path/to/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.13+2/ios/image_picker_ios/Sources/image_picker_ios/FLTImagePickerPlugin.m:15:
/path/to/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.13+2/ios/image_picker_ios/Sources/image_picker_ios/./include/image_picker_ios/messages.g.h:16:29: error: redefinition of 'FLTSourceCamera'
   16 | typedef NS_ENUM(NSUInteger, FLTSourceCamera) {
      |                             ^

So far the only way I can figure out how to fix it, is to hard close Xcode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementteam-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