Cannot add embedded binaries (other projects) to project dependencies in XCode

后端 未结 6 1374
天命终不由人
天命终不由人 2021-02-05 10:06

I have an XCode workspace created with XCode 6.0.1. It constains 2 (Swift) libraries and one iOS app (Swift) that depends on those 2 libraries. I had stable setup that allowed m

6条回答
  •  渐次进展
    2021-02-05 11:02

    Here is how I solved the problem:

    1. Build the framwork.

    2. Open the build folder and drag built framework into the app project (so it uses the path to DerivedData).

    3. Add the framework to the list of embedded frameworks.

    4. In the Finder, do a Show Contents on the app's xcodeproj file, then open project.pbxproj in your favorite text editor.

    5. Find the line with the long DerivedData path. Change it so there is no name, the path is the framework name, and source tree is BUILT_PRODUCTS_DIR

    Xcode should notice the change and the library in the app project will be black instead of red and will now build and run properly.

提交回复
热议问题