I am facing build fail error after moving Bridging-Header objective-c swift on xcode6. Before I moved header file, it had been working fine. The error shows header file not exist. The header file path remains still old path in error log. I tried build clean, but still old path remains. How can clean the objc-header-path?
在xcode6上移动Bridging-Header objective-c swift之后,我将面临构建失败错误。在我移动头文件之前,它一直运行良好。错误显示头文件不存在。头文件路径仍然是错误日志中的旧路径。我试着把它建得干净些,但仍然是老路。怎样才能清理反对的目标?
6 个解决方案
#1
5
You need to update the path in your project's Build Settings to point to the new bridging header location.
您需要更新项目构建设置中的路径,以指向新的桥接头位置。
Click your target and then click 'Build Settings' then search for Objective-C Bridging Header
单击目标,然后单击“构建设置”,然后搜索Objective-C桥接头
#2
3
You'll find the path to the bridging header in your target's Build Settings, under "Swift Compiler - Code Generation"/"Objective C Bridging Header".
在“Swift编译器-代码生成”/“目标C桥接头”下,您将在目标的构建设置中找到桥接头的路径。
#3
1
I tried with Xcode6.1-Beta, as well. But still impossible to update the objective-c header path. I don't know where the configuration file is. I gave up to figure out.
我也尝试过Xcode6.1-Beta。但是仍然不可能更新objective-c头路径。我不知道配置文件在哪里。我放弃了想办法。
Finally, I deleted the target xcode project and recreated new project. Now it is working.
最后,我删除了目标xcode项目并重新创建了新项目。现在是工作。
#4
0
Yes it's possible.
是的,这是可能的。
- Delete the .h file
- . h文件删除
- Clear the path at Objective-C Bridging Header
- 清除Objective-C桥接头的路径。
- Create new Objective-C File
- objective - c创建新的文件
- Name your header file to the same name as before (popup will ask you to create new header file)
- 将头文件命名为与之前相同的名称(popup将要求您创建新的头文件)
- Goto File > Project Settings > Data Location
- Goto文件>项目设置>数据位置
- Make sure your path is correct and press "Done"
- 确保你的路径是正确的,按“完成”
Your app should run again pointing to the right location of the header file and delete the files ModuleCache
您的应用程序应该再次运行,指向头文件的正确位置,并删除文件模块。
Happens to me many times when i move app folder around.
当我移动app文件夹时,它会出现很多次。
#5
0
I had a workspace that I was using when I had the same thing happen. I moved my project to a different folder. Despite having a relative path on my bridge headers, it was still referencing the old location when building and threw an error.
当发生同样的事情时,我有一个工作空间。我把我的项目移到另一个文件夹。尽管在我的桥标头上有一个相对路径,但它在构建和抛出错误时仍然引用旧位置。
Here's what I did to fix this:
以下是我为解决这个问题所做的:
-
Close the workspace
关闭工作空间
-
Open the .xcworkspace file using TextWrangler. TextWrangler allowed me to navigate the package to /xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate. I did a search for the old path and found it. Make the change to the new location of the header file.
使用TextWrangler打开.xcworkspace文件。TextWrangler允许我将包导航到/xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate。我找了一条旧路,找到了。对头文件的新位置进行更改。
-
This by itself didn't fix it. After cleaning and building, the old value showed back up! Then I deleted the Build folder. It has a ModuleCache that I think was holding on to the old value as well.
这本身并不能解决问题。清洁和建筑后,旧的价值又出现了!然后我删除了Build文件夹。它有一个模块,我认为它也保留了原来的值。
After doing this, my project picked up my new value and I was able to build the project. I'm not certain step 2 is necessary. But it did store the old value in there.
在这之后,我的项目获得了新的价值,我能够构建这个项目。我不确定第二步是否必要。但它确实将旧值存储在那里。
#6
0
In my case, I changed the path from relative path to absolute path and solved.
在我的例子中,我将路径从相对路径转换为绝对路径并求解。
like
就像
From: project_name/project_name-Bridging-Header.h
来自:project_name / project_name-Bridging-Header.h
To: $(SRCROOT)/project_name/project_name-Bridging-Header.h
:$(SRCROOT)/ project_name / project_name-Bridging-Header.h
#1
5
You need to update the path in your project's Build Settings to point to the new bridging header location.
您需要更新项目构建设置中的路径,以指向新的桥接头位置。
Click your target and then click 'Build Settings' then search for Objective-C Bridging Header
单击目标,然后单击“构建设置”,然后搜索Objective-C桥接头
#2
3
You'll find the path to the bridging header in your target's Build Settings, under "Swift Compiler - Code Generation"/"Objective C Bridging Header".
在“Swift编译器-代码生成”/“目标C桥接头”下,您将在目标的构建设置中找到桥接头的路径。
#3
1
I tried with Xcode6.1-Beta, as well. But still impossible to update the objective-c header path. I don't know where the configuration file is. I gave up to figure out.
我也尝试过Xcode6.1-Beta。但是仍然不可能更新objective-c头路径。我不知道配置文件在哪里。我放弃了想办法。
Finally, I deleted the target xcode project and recreated new project. Now it is working.
最后,我删除了目标xcode项目并重新创建了新项目。现在是工作。
#4
0
Yes it's possible.
是的,这是可能的。
- Delete the .h file
- . h文件删除
- Clear the path at Objective-C Bridging Header
- 清除Objective-C桥接头的路径。
- Create new Objective-C File
- objective - c创建新的文件
- Name your header file to the same name as before (popup will ask you to create new header file)
- 将头文件命名为与之前相同的名称(popup将要求您创建新的头文件)
- Goto File > Project Settings > Data Location
- Goto文件>项目设置>数据位置
- Make sure your path is correct and press "Done"
- 确保你的路径是正确的,按“完成”
Your app should run again pointing to the right location of the header file and delete the files ModuleCache
您的应用程序应该再次运行,指向头文件的正确位置,并删除文件模块。
Happens to me many times when i move app folder around.
当我移动app文件夹时,它会出现很多次。
#5
0
I had a workspace that I was using when I had the same thing happen. I moved my project to a different folder. Despite having a relative path on my bridge headers, it was still referencing the old location when building and threw an error.
当发生同样的事情时,我有一个工作空间。我把我的项目移到另一个文件夹。尽管在我的桥标头上有一个相对路径,但它在构建和抛出错误时仍然引用旧位置。
Here's what I did to fix this:
以下是我为解决这个问题所做的:
-
Close the workspace
关闭工作空间
-
Open the .xcworkspace file using TextWrangler. TextWrangler allowed me to navigate the package to /xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate. I did a search for the old path and found it. Make the change to the new location of the header file.
使用TextWrangler打开.xcworkspace文件。TextWrangler允许我将包导航到/xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate。我找了一条旧路,找到了。对头文件的新位置进行更改。
-
This by itself didn't fix it. After cleaning and building, the old value showed back up! Then I deleted the Build folder. It has a ModuleCache that I think was holding on to the old value as well.
这本身并不能解决问题。清洁和建筑后,旧的价值又出现了!然后我删除了Build文件夹。它有一个模块,我认为它也保留了原来的值。
After doing this, my project picked up my new value and I was able to build the project. I'm not certain step 2 is necessary. But it did store the old value in there.
在这之后,我的项目获得了新的价值,我能够构建这个项目。我不确定第二步是否必要。但它确实将旧值存储在那里。
#6
0
In my case, I changed the path from relative path to absolute path and solved.
在我的例子中,我将路径从相对路径转换为绝对路径并求解。
like
就像
From: project_name/project_name-Bridging-Header.h
来自:project_name / project_name-Bridging-Header.h
To: $(SRCROOT)/project_name/project_name-Bridging-Header.h
:$(SRCROOT)/ project_name / project_name-Bridging-Header.h