问题
I'm using an external library (RHAddressBook) when I run the app in the simulator or in device there is no issue. But when I choose to archive the app I run into the issue where it's saying 'RHAddressBook/AddressBook.h' file not found
at the line #import <RHAddressBook/AddressBook.h>
I have checked that the header search paths are the same for debug and release.
Not really sure what to check else.
回答1:
When you setup the use of the external library for your development builds, you may have needed to update a build setting to specify an additional include search path.
When you do an Archive build, this isn't a development build. You probably didn't update the include search path for your Release (or possibly Distribution) build.
Go back to the build settings and make sure the "Header Search Paths" is updated for the build configuration used by Archive.
回答2:
(I adapted this answer from here however given that I ran into the same problem with RHAddressBook also I figured some paraphrasing was in order. I hope this doesn't upset anyone).
Open
Build Settings
for your app target and underHeader Search Paths
add:"$(PROJECT_DIR)/.."
recursive enabled
This worked for me for RHAddressBook
回答3:
Open Build Settings
for your app target and under Header Search Paths
add:
"$(SOURCE_ROOT)/ThirdParty/RHAddressBook"
This path is RHAddressBook folder under your project folder.
来源:https://stackoverflow.com/questions/15528133/when-archiving-app-xcode-complains-about-missing-files