Swift iOS module not being deployed to expected debug directory

前端 未结 3 828
心在旅途
心在旅途 2020-12-24 09:33

I have a module/framework written in Swift, intended to be used on iOS. When I try to include the framework in my app, I first notice some red \"not found\" hints in the bui

3条回答
  •  [愿得一人]
    2020-12-24 10:14

    These are slightly modified steps provided by @Mobile Ben

    Assume, you have the following Xcode project structure

    -YourWorkspace
    --YourFramework project
    --YourApp project
    

    step 1. Clear all the targets with Cmd+Shift+K and Cmd+Option+Shift+K (by choosing each of them in the Scheme selector and pressing the hotkey combination)

    step 2. Select YourFramework project.

    step 3. Choose a simulator and build (Cmd+B) YourFramework framework target

    step 4: Choose Generic iOS Device and build (Cmd+B) YourFramework framework target

    step 5: Select YourApp project. Press + in Embedded Binaries and choose the framework under YourFramework project

    step 6: now locate the just added framework in Project Navigator (on the left). In File Inspector (on the right) select location Relative to build product.

    NOTE: I believe the step 6 is required b/c of some bug in Xcode. But, though, not selecting Relative to build product by default might be a deliberate act

    UPD#1: Since Xcode 8.0 (8A218a), step 6 is not needed anymore - the IDE sets Relative to Build Products automatically.

提交回复
热议问题