16

When using the new Xcode 10 build system under File -> Workspace Settings -> New Build System (Default) my app will not compile because it cannot find a .h file for an embedded .framework that I am using in my project. Once I set the build system to use the legacy build system the project builds perfectly fine. How can I use the new build system and fix this issue where it cannot find the .framework .h file? The project builds perfectly fine in Xcode 9.4.1 without issues or when using the legacy build system on Xcode 10.

HawkEye1194
  • 298
  • 1
  • 3
  • 14
  • 1
    The new build system has stricter checks. Which means that some of the headers may not be automatically included in the project. Regarding that, I would suggest checking if the needed headers in included in the `public` section of `Build Phases > Headers`. If it is missing try adding the `.h` file manually. Check out this thread - https://stackoverflow.com/a/33734243 – Nikolay Tsonev Nov 01 '18 at 12:48
  • I do not see a headers section. I tried dragging and dropping the file into the root of my project and made sure to check the checkbox to have it added to the target and it did nothing. Any ideas? – HawkEye1194 Nov 01 '18 at 16:30

2 Answers2

2

I ended up fixing this issue. What I ended up doing was going to target -> Build settings and changing the Framework search path to an absolute path.

Before my change it was ~/Documents/FrameworkRootFolder now it is /Users/$(USER)/Documents/FrameworkRootFolder and I set it to recursive. Seems to build fine now.

I also had another issue with multiple apps produce .app error and fixed it with this: In case someone is still struggling with this after updating cocoapods and reinstalling pods:

Open Build Phases of the target which gives you problems Open Copy Pods Resources phase. Make sure the Output Files is empty. In my case I had a strange entry ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}. I removed it and the build was successful

Xcode 10 Error: Multiple commands produce for 'app' and 'appex'

HawkEye1194
  • 298
  • 1
  • 3
  • 14
0

Make sure you run the .xcworkspace XCode file, instead of the .xcodeproj file - so that Pods are loaded as well.

Grant
  • 5,709
  • 2
  • 38
  • 50