Failed to emit precompiled header for bridging header

后端 未结 20 1409
傲寒
傲寒 2020-11-30 04:35

I downloaded a project from GitHub, then pod the following files, some of which are written by OBJ-C and I used a bridge header.

pod ‘SnapKit’
pod ‘MJRefresh         


        
相关标签:
20条回答
  • 2020-11-30 05:16

    My experience with this is that Xcode is unable to find header files for pods/frameworks imported in the project.

    My Project experience with this: Updating Xcode9.2 - 9.3 where many cocoapods had to be updated due to implicit definitions now unavailable or being outdated.
    I had changed the Podfile to now include 'use_frameworks!'. Following this and after dealing with other compile issues I found the error you are experiencing. I believe adding 'use_frameworks! was preventing some pods with support prior to iOS 8 from compiling correctly. Steps I took to correct this issue:

    1. I tried deleting the Pods/ directory using cocoa pod deintegrate
    2. I then open project with Xcode and cleaned the build folder and the project. (delete content within derived data folder)
    3. I then pod install again but the issue persisted.

    4. Ultimately I removed the use_frameworks line in Podfile and then repeated steps 1-3 and the project was now able to find the missing header files and the issue never presented it self again.

    0 讨论(0)
  • 2020-11-30 05:16

    I also suffered from this after I updated new Xcode. After several hours of investigation, i found that if you have multiple targets, you now have to add more targets in pod file in Xcode 10. So your code should be like this:

    platform :ios, '9.0'
    
    target 'EvoRadio' do
    
    pod ‘SnapKit’
    pod ‘MJRefresh’
    pod ‘Alamofire’
    pod ‘Kingfisher’
    pod ‘MBProgressHUD’
    pod ‘pop’
    pod ‘EVReflection’
    pod ‘StreamingKit’
    pod ‘iCarousel’
    pod ‘ReflectionView’
    
    target 'EvoRadio2ndtarget'   # add your second target
    
    end
    

    I found that in Xcode 9 you don't need to add, but in Xcode 10 you need to add this. Hope this helps.

    0 讨论(0)
  • 2020-11-30 05:16

    I got this error after renaming the existing Xcode project configuration in which I had another Xcode project imported.

    To fix it, you have to rename the same configuration in the imported project as well.

    0 讨论(0)
  • 2020-11-30 05:17

    In my case I had the same compiler error with additional errors like "Unknown type" in one of my project files, So I just added this to the problematic file, and it solved it instantly.

    #import <UIKit/UIKit.h>

    0 讨论(0)
  • 2020-11-30 05:19

    You can try this solution. I have solved the same problem by this way.

    Product > Scheme > Edit Scheme > Select "Build" on Left Menu > Find implicit dependencies

    Under the build tab, check 'Find implicit dependencies':

    Find implicit dependencies

    Then make a clean and build again.

    0 讨论(0)
  • 2020-11-30 05:19

    For Xcode 11 I had an issue with the "Security.framework". I removed this dependency, then re added it. Ultimately fixed the other problems

    0 讨论(0)
提交回复
热议问题