无法通过CocoaPods安装Pod(Mixpanel)-无法编译(找不到文件)-桥接标题问题? [英] Can't install a pod (Mixpanel) via CocoaPods - Fails to compile (file not found) - Bridging header issue?

查看:79
本文介绍了无法通过CocoaPods安装Pod(Mixpanel)-无法编译(找不到文件)-桥接标题问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更新项目的Mixpanel版本以使用Cocoapods,因为它以前是手动安装的。我已经在使用Cocoapods,所以我认为添加 pod‘Mixpanel’,’〜>会很容易。 2.9’到Podfile并运行 pod install 。完成此操作后,出现以下错误:

I'm trying to update my project's version of Mixpanel to use Cocoapods, as it was previously installed manually. I already was using Cocoapods, so I assumed it would have been an easy update to just add pod 'Mixpanel', '~> 2.9' to the Podfile and run pod install. After doing this, I am getting the following errors:

在导入语句中 #import Mixpanel.h

/ Users / timc / ios / app / MyApp / Classes / AnalyticsUtil。 h:10:9:找不到 Mixpanel.h文件

还有一个

无法导入桥接标头'/ Users / timc / ios / app / MyApp / Classes / MyApp-Free-Bridging- Header.h'

我正在尝试将Mixpanel导入到Objective-C文件中。我的 Podfile 看起来像这样...

I'm trying to import Mixpanel into an Objective-C file. My Podfile looks like this...

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'Alamofire', '~> 3.1'
pod 'AlamofireObjectMapper', '~> 2.1'

target 'MyApp' do
    pod 'Mixpanel', '~> 2.9'
end

target 'MyApp Tests' do

end

target 'WatchKit Extension' do
    pod "Mixpanel/AppExtension"
end

target 'WatchKit App' do
    pod "Mixpanel/AppExtension"
end

target 'MyAppSharedFramework' do
    pod 'Alamofire', '~> 3.1'
    pod 'AlamofireObjectMapper', '~> 2.1'
end

所以我需要什么,这样我的项目才能找到Mixpanel源文件?我尝试使用#import进行操作,尽管这允许我 option-click 导航到正确的文件,但是该项目仍然无法构建。

So what do I need so my project can find the Mixpanel source files? I've tried using #import and while that allows me to option-click to navigate to the right file, the project still fails to build.

我正在运行Xcode 7.2,并且项目结合了Objective-C和一些Swift。

I'm running Xcode 7.2, and project is a mix of Objective-C and a bit of Swift.

很高兴提供任何进一步的信息来帮助诊断此问题!

Happy to provide any further information to help diagnose this issue!

推荐答案

我能够通过删除工作区并重新生成它来解决此问题。

I was able fix this issue by removing the workspace and regenerating it.

rm -rf MyProject.xcworkspace
pod install

很明显,我的工作区中的某些内容已损坏...这已解决。

So clearly something with my workspace was corrupted... this resolved it.

这篇关于无法通过CocoaPods安装Pod(Mixpanel)-无法编译(找不到文件)-桥接标题问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆