nathantannar4 / InputBarAccessoryView

A simple and easily customizable InputAccessoryView for making powerful input bars with autocomplete and attachments
MIT License
1.15k stars 229 forks source link

Unable to build framework when including this via SPM #246

Open civatrix opened 1 year ago

civatrix commented 1 year ago

Describe the bug I'm building an XCFramework that includes this as a dependency via SPM. Because of a bug in the swift compiler, I'm unable to build my framework with yours included. tl;dr The module shares a name with a class within the module and Swift can't generate a correct swiftinterface file

Ideally if you could change the name of the module to something like InputBarAccessoryViewKit that would fix the issue until the compiler bug is resolved.

To Reproduce

  1. Create a new Framework project in Xcode 14.3
  2. Add https://github.com/nathantannar4/InputBarAccessoryView as a package (File -> Add Packages...)
  3. From the Terminal run xcodebuild archive -scheme <Name> -archivePath archives -destination "generic/platform=iOS" -sdk iphoneos BUILD_LIBRARY_FOR_DISTRIBUTION=YES
  4. You should get an error like
    The following build commands failed:
    SwiftVerifyEmittedModuleInterface normal arm64 Verifying\ emitted\ module\ interface\ InputBarAccessoryView.private.swiftinterface ... (in target 'InputBarAccessoryView' from project 'InputBarAccessoryView')

Screenshots Screenshot 2023-06-07 at 5 56 32 PM

Expected behavior The archive command should succeed

Environment

Additional context Add any other context about the problem here.

barakwei commented 9 months ago

I see the same issue

nathantannar4 commented 9 months ago

Are you able to use SPMs module aliases feature now?

barakwei commented 9 months ago

I'm not using SPM at all, I'm just trying to build the framework as a binary with BUILD_LIBRARY_FOR_DISTRIBUTION=YES, as the author suggested.

jposes22 commented 5 months ago

To solve this problem execute the archive with OTHER_SWIFT_FLAGS='-no-verify-emitted-module-interface' Like: xcodebuild archive -scheme <Name> -archivePath archives -destination "generic/platform=iOS" -sdk iphoneos BUILD_LIBRARY_FOR_DISTRIBUTION=YES OTHER_SWIFT_FLAGS='-no-verify-emitted-module-interface'