Xcode 9 - Failed to release precompiled header

I have a project in Objective-C, as well as in swift, taking MyProjectName-Bridging-Header.hand also setting the Objective-C Bridging Header header. I also added 'MyprojectName-Swift.h' to the .pch file.

This works fine on xcode 8.2, but when I create my project from xcode 9, I get the following error.

Failed to Issue Precompiled Header '/Library/Developer/Xcode/DerivedData/MyprojectName-lajanjvhqjnfjksdsndsfkads/Build/Intermediates.noindex/PrecompiledHeaders/MyprojectNameJpChtJVJJQJQJJJQJQJQJQJJJQJQJQJJQJJQJJFJ_JMPJV_JM_JPJV_JM_JV_JMJ_JV_JM_JV_JM_JF_JVJ -Bridging-Header.h '

Please help me with this. Thank!

+16
source share
11 answers

Finally, I got a solution to this problem. In my project, the path is Prefix Headernot defined. There used to be a way

$ (SRCROOT) /MyPrefixHeaderFile.pch

MyPrefixHeaderFile.pchlocated in another folder inside the project folder. Therefore, I am updating the path Prefix Headerto

$ (SRCROOT) /FolderName/MyPrefixHeaderFile.pch

+4
source

Read this if you are using cocoapods in a project. I just upgrade the deployment target to iOS 10 or 11 in my case after updating the modules and xcode makes the first build success. So the problem was inside the podfile where I had the line

platform :ios, '11.0'

and my deployment goal in the project is 9.0 after I change my file to the platform on

platform :ios, '9.0'

has been fixed.

+5
source

. .

Click on the logo

  1. " ":

Edit Scheme

  1. , build, " ":

Find implicit dependencies

.

+4

.

+2

, ProjectName.xcodeproj  , ProjectName.xcworkspace.

xcworkspace, !

+2

, , podfile

enter image description here

+1

, " " . , .

#import <UIKit/UIKit.h>

0

, , , #import .

0

xcodebuild, , -workspace YourWorkspace.xcworkspace

0

.

, le'Ts ,

#import "File.h"

Inside the header file, File.hthere was a type referenced by the import, which was inside Prefix.pch, had to add the missing #import to File.h

0
source

@Li Yakun This solution, if you have more than one goal in the project, each new goal in the podfile should have:

target 'NEWTARGET' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!

    # Pods for MAINTARGET
    shared_pods
end
0
source

Source: https://habr.com/ru/post/1689633/


All Articles