4

Actually my project does compile for an iPhone 6s but not for any iOS simulators. When I want to build for a simulator I get two build time errors.
Errors

'CocoaLumberjack/CocoaLumberjack.h' file not found

and

failed to emit precompiled header 
'/DerivedData/Project/Build/Intermediates.noindex/PrecompiledHeaders/Bridging-Header-swift.pch' 
for bridging header 
'/Users/Development/ProjectMobile/Views/Project-Bridging-Header.h'

What have I tried yet?

  • pod deintegrate, clear Build, delete "DerivedData", pod install and pod update
  • open Project.xcworkspace instead of Project.xcodeproj
  • keep target iOS version in podfile and deployment target the same (iOS 12)
  • check "Framework Search Paths" at targets build settings 1
  • check "Header Search paths" 2

I am not 100% sure if the paths are correct. And I am wondering that Xcode can't find Cocoalumberjack.h, because I can find it under /Pods/CocoaLumberjack/Sources/CocoaLumberjack/Supporting Files/CocoaLumberjack.h.

Questions
Are these paths probably incorrect?
What else could be the problem?

I am happy for every serious answer!

(1) Framework Search Paths
Framework Search Paths

(2) Header Search paths
Header Search paths

oguz ismail
  • 1
  • 16
  • 47
  • 69
Marcel Hofgesang
  • 951
  • 1
  • 15
  • 36

1 Answers1

1

Xcode couldn't build the project for an iOS simulator because there was no valid CPU architecture set for the simulator (respectively for the Mac).

Under Project > Targets > User-Defined > VALID_ARCHS there were just armv7, armv7s and arm64 architectures set.

I added x86_64 architecture to the VALID_ARCHS and it works fine now.

Marcel Hofgesang
  • 951
  • 1
  • 15
  • 36
  • 1
    According to Apple you should remove the VALID_ARCHS property completely (this action also fixes the issue you were experiencing) – rimes Feb 16 '21 at 08:23