【问题标题】:Can't install a pod (Mixpanel) via CocoaPods - Fails to compile (file not found) - Bridging header issue?无法通过 CocoaPods 安装 pod (Mixpanel) - 无法编译(找不到文件) - 桥接头问题?
【发布时间】:2015-12-17 18:23:48
【问题描述】:

我正在尝试更新项目的 Mixpanel 版本以使用 Cocoapods,因为它之前是手动安装的。我已经在使用 Cocoapods,所以我认为只需将 pod 'Mixpanel', '~> 2.9' 添加到 Podfile 并运行 pod install 将是一个简单的更新。执行此操作后,我收到以下错误:

在导入语句#import "Mixpanel.h"

/Users/timc/ios/app/MyApp/Classes/AnalyticsUtil.h:10:9: 'Mixpanel.h' file not found

还有这个

Failed to import bridging header '/Users/timc/ios/app/MyApp/Classes/MyApp-Free-Bridging-Header.h'

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

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 导航到正确的文件,但项目仍然无法构建。

我正在运行 Xcode 7.2,项目是 Objective-C 和一些 Swift 的混合体。

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

【问题讨论】:

  • timgcarlson 您在工作区 rm -rf MyProject.xcworkspace pod install 中遇到问题

标签: ios objective-c xcode cocoapods mixpanel


【解决方案1】:

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

rm -rf MyProject.xcworkspace
pod install

很明显,我的工作区有什么东西被破坏了……这解决了它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-14
    • 1970-01-01
    • 2023-03-24
    • 1970-01-01
    • 1970-01-01
    • 2018-01-28
    相关资源
    最近更新 更多