Skip to content

Fix SPM support: remove FlutterFramework dependency#576

Open
danyabdo94 wants to merge 1 commit into
ponnamkarthik:masterfrom
danyabdo94:feature/fix-spm-support
Open

Fix SPM support: remove FlutterFramework dependency#576
danyabdo94 wants to merge 1 commit into
ponnamkarthik:masterfrom
danyabdo94:feature/fix-spm-support

Conversation

@danyabdo94
Copy link
Copy Markdown

Summary

  • Remove explicit FlutterFramework dependency from Package.swift — Flutter's build system automatically injects the Flutter framework for plugins, so having it as an explicit SPM dependency causes build failures when integrating via flutter build ios
  • Add explicit #import <UIKit/UIKit.h> to FluttertoastPlugin.m since SPM doesn't provide prefix headers
  • Simplify header layout: move headers from include/fluttertoast/ subdirectory to source root and use publicHeadersPath: ""

Context

When using Flutter's built-in SPM support (flutter config --enable-swift-package-manager), the current Package.swift fails because FlutterFramework is not available as a resolved SPM package — Flutter resolves it through its own build pipeline instead.

Test plan

  • flutter build ios succeeds with SPM enabled and zero CocoaPods fallback warnings
  • flutter build ios --release produces a valid IPA

🤖 Generated with Claude Code

Flutter's build system automatically injects the Flutter framework for
plugins. Having FlutterFramework as an explicit SPM dependency causes
build failures when integrating via Flutter's native SPM support.

Also adds explicit UIKit import since SPM doesn't provide prefix headers,
and simplifies the header layout to use publicHeadersPath.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant