Swift iOS module not being deployed to expected debug directory

前端 未结 3 827
心在旅途
心在旅途 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:24

    Okay, so I figured out how to work around this. This assumes you have workspace and you have included the framework as a project in the workspace and you are trying to build a product from another project in the workspace which includes the framework.

    What you need to do is find out where the framework is being built. It's usually some crazy directory under the DeriveData directory. Go to the Finder and find it for the configuration you just tried to build.

    In the product target's General settings, under Embedded Binaries, drag that file into it. This should now place it in the Project Navigator. You should also see it in the Linked Frameworks and Libraries which was underneath Embedded Binaries.

    Go to the Project Navigator and select the file and view it under the File Inspector. There, change the Location to Relative to Build Products.

    In the target's Build Settings, for Framework Search Paths, add $(BUILT_PRODUCTS_DIR) and make that recursive. Delete the entry that was automatically added when you added the framework. It will be an explicit path which has the DerivedData path in it.

    Do a deep clean and delete the DerivedData directory for good measure.

    Build.

    You should now see the framework turn black and it should work properly.

提交回复
热议问题