Search code examples
iosxcodecompiler-errorsmbprogresshud

Why is a static library's header file not found for archiving?


I can build for debugging just fine. I've triple checked that the static library is included in the build phases settings for the project. I've also tried other things like header include paths and such to no avail.

When I try to build an IPA for test flight, I get an error: #import <MBProgressHUD/MBProgressHUD.h>

I've been able to build an IPA before, but it didn't implement/use the MBProgressHUD static library before.

I can include the the header and code file manually instead of statically linking it, but I prefer to know what's going on here.

Thanks.

PS - I used the "Static Library" instructions given https://github.com/jdg/MBProgressHUD


Solution

  • With the help of another SO questions(https://stackoverflow.com/a/10159481/143225) I was able to get the header file to include.

    Apparently, the archive build process is somehow different than the debug build process. By adding "$(BUILD_ROOT)/../IntermediateBuildFilesPath/UninstalledProducts" to the "User Header Search Paths" build setting it built successfully.

    I'd still like to understand why this isn't working as I expect it. I have a hunch that the project is built to auto include the header files for debug and release builds, but somehow not for archive builds. This is odd because I thought archive builds inherit from either debug or release settings from Xcode's scheme settings.

    Any additional info is welcome.