lucaszischka / BottomSheet

A sliding Sheet from the bottom of the Screen with 3 States build with SwiftUI.
MIT License
1.03k stars 138 forks source link

Cocoapods integration of BottomSheet doesn't compile #108

Closed lonsky closed 1 year ago

lonsky commented 1 year ago

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-BottomSheetBottomSheet" 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

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
CharlesMcD commented 1 year ago

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')
lucaszischka commented 1 year ago

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

lonsky commented 1 year ago

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

lucaszischka commented 1 year ago

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