Xcode unable to find strip-frameworks.sh directory

In my case, change the process order in Build Phases to solve

  • not OK

11

  • OK

555


From the error message, it seems like, you didn't added Realm.framework and RealmSwift.framework to the Embedded Binaries pane, which you find in the General tab of your project, as shown below:

Embedded Binaries

For further validation, you can check the tab Build Phases. It should look like below:

Build Phases

Note: Make sure that the run script phase comes after the Embed Frameworks phase.

Why is this script needed?

The vendored frameworks are not just single executables, but actually FAT binaries which are archives of linked executables on different architectures. This includes architecture slices for arm64 and armv7, which are necessary for deployment on the phone as well as i386 and x86_64 which are necessary for running the app in the simulator.

The strip-frameworks.sh script main responsibility is to take care of removing unnecessary slices. This reduces the final package size and is necessary for AppStore deployment because iTunes Connect rejects apps with simulator architectures.

More Details

The script works on base of the build setting VALID_ARCHS. Because that is changing the signed executable of the framework, it also needs to take care of code signing. Since introduction of bitcode, it also got further post processing as responsibility. It extracts the included *.bcsymbolmap files from the framework bundle and places them into correct path in the *.xcarchive.

The FAQ topic on Bitcode of PSPDFKit has a good explanation on what BCSymbolMaps are:

A BCSymbolMap is a lot like a dSYM for bitcode. Xcode builds it as part of creating the app binary, and also for every dynamic framework. It's required for re-symbolicating function/method names to understand crashers.

Tags:

Ios

Xcode

Realm