Skip to content

Fix iOS CocoaPods wrapper double compile#467

Merged
alnitak merged 1 commit into
alnitak:mainfrom
DavidPluxia:fix-cocoapods-wrapper-double-compile
May 24, 2026
Merged

Fix iOS CocoaPods wrapper double compile#467
alnitak merged 1 commit into
alnitak:mainfrom
DavidPluxia:fix-cocoapods-wrapper-double-compile

Conversation

@DavidPluxia
Copy link
Copy Markdown
Contributor

Summary

  • exclude the SwiftPM-only flutter_soloud.mm wrapper from the iOS CocoaPods target
  • keep the CMake script phase as the single CocoaPods native implementation path
  • avoid duplicate symbols when the app target force-loads libflutter_soloud_plugin.a

Details

flutter_soloud.mm includes the full C++ implementation so SwiftPM can build the package from that wrapper source. The iOS CocoaPods podspec also builds the implementation through build_cmake.sh and then force-loads libflutter_soloud_plugin.a into the app target. When CocoaPods also compiles flutter_soloud.mm, the same implementation is present twice.

This keeps the wrapper file in the package for SwiftPM, but uses CocoaPods' exclude_files to keep it out of the CocoaPods compile sources.

Validation

  • ruby -c ios/flutter_soloud.podspec
  • pod ipc spec ios/flutter_soloud.podspec
  • NO_XIPH_LIBS=1 pod ipc spec ios/flutter_soloud.podspec
  • local CocoaPods fixture with a stub Flutter pod: pod install, then verified generated Pods.xcodeproj references miniaudio_objc_prefix.h and libflutter_soloud_plugin.a, but no flutter_soloud.mm

@alnitak
Copy link
Copy Markdown
Owner

alnitak commented May 18, 2026

Hi @DavidPluxia, thanks a lot for this PR!

Do you think this fix should also be made for macOS?

@alnitak alnitak merged commit 2a7f098 into alnitak:main May 24, 2026
1 check passed
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.

2 participants