lucaszischka/BottomSheet

Cocoapods integration of BottomSheet doesn't compile

Closed this issue · 4 comments

Describe the bug
When using BottomSheetSwiftUI dependency via Cocoapods, hosting application that uses this dependency doesn't compile with the following error:

_/Users/****/Projects/Playground/TestBottomSheetPodIssue/Pods/Pods.xcodeproj Signing for "BottomSheetSwiftUI-BottomSheet_BottomSheet" requires a development team. Select a development team in the Signing & Capabilities editor.

Minimal reproduce-able code
No special steps required: just an empty project with the following Podfile content (no need to even include the framework):

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'TestBottomSheetPodIssue' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for TestBottomSheetPodIssue
  pod 'BottomSheetSwiftUI'

end

TestBottomSheetPodIssue.zip

Expected behavior
Project that uses BottomSheetSwiftUI dependency compiles without any warnings and/or errors.

Target version

  • Environment: iOS/Swift/SwiftUI
    Xcode: 14.1 (14B47b)
    CocoaPods: 1.11.3
    MacOS Monterey: 12.6

  • Version: 3.1.0

Workaround

In the end of pod file add the following instructions:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      # Xcode 14 complains about selected Development Team for Resource Bundle pod types.
      config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
      config.build_settings['CODE_SIGN_IDENTITY'] = ''
    end
  end
end

I have the exact same problem using the Swift package manager.

error: Signing for "BottomSheet_BottomSheet" requires a development team. 
Select a development team in the Signing & Capabilities editor. (in target 'BottomSheet_BottomSheet' from project 'BottomSheet')

I will have a look, but are you both sure, that you have a development team assigned?

pod project file is generated by cocoapods. i can assign dev team manually but that's not how it suppose to work. next time you update the pod - it will overwrite the settings.

you can use post_install instructions to set the team. but it's a workaround, similar to the one i posted above

Ah yes I see this looks to be a problem with XCode 14 and CocoaPods ref. As to my understand this is a issue that needs to be resolved by CocoaPods and not me. Therefore I will close this issue. If you think I’m wrong or if there any update form cocoapods in this regard, please comment.

For now I can only suggest one of the following workarounds:

  1. Set target to don’t require code signing:
post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
         end
    end
  end
end
  1. Sign the target yourself:
post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings["DEVELOPMENT_TEAM"] = "Your Team ID"
         end
    end
  end
end

Both need to be placed at the bottom of the podfile. ref