【问题标题】:'RestKit/RestKit.h' file not found on xcode 6在 xcode 6 上找不到“RestKit/RestKit.h”文件
【发布时间】:2014-12-10 03:55:27
【问题描述】:

我几乎尝试了所有解决方案,但这对我不起作用。我有 Xcode 6,我收到此错误。我也更新了可可豆荚并更新了豆荚文件。

安装更新后,我在下面添加了几行:

[!] From now on use `PocketLobbyiOS.xcworkspace`.

[!] The use of implicit sources has been deprecated. To continue using all of the sources currently on your machine, add the following to the top of your Podfile:

    source 'https://github.com/CocoaPods/Specs.git'


[!] The `PocketLobbyiOS [Debug]` target overrides the `GCC_PREPROCESSOR_DEFINITIONS` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `PocketLobbyiOS [Release]` target overrides the `GCC_PREPROCESSOR_DEFINITIONS` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `PocketLobbyiOS [Distribution]` target overrides the `GCC_PREPROCESSOR_DEFINITIONS` build setting defined in `Pods/Target Support Files/Pods/Pods.distribution.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] OHAttributedLabel has been deprecated in favor of DTCoreText
Sajs-MacBook-Pro:PockyiOS sk$ 

这就是我在 podfile 中的内容。我已删除 podfile 并再次安装,但仍然出现同样的错误。

platform :ios, '6.0'

pod 'MWPhotoBrowser', :git => 'https://github.com/floriankrueger/MWPhotoBrowser.git', :tag => '1.4.1'
pod 'TestFlightSDK', '~> 3.0.2'
pod 'RestKit', '~> 0.23.1'
pod 'RestKit/ObjectMapping'
pod 'RestKit/Search'
pod 'RestKit/Testing'
pod 'PKRevealController', '~> 2.0.6'
pod 'Mapbox', :git => 'https://github.com/mapbox/mapbox-ios-sdk.git', :tag => '1.2.0'
pod 'MagicalRecord/Shorthand', '~> 2.2'
pod 'DDPageControl', '~> 0.1'
pod 'MWPhotoBrowser'
pod 'Reachability', '~> 3.1.1'
pod 'Mixpanel', '~> 2.4.0'
pod 'OHAttributedLabel', '~> 3.5.4'

# ignore all warnings from all pods
inhibit_all_warnings!

post_install do |installer_representation|
    installer_representation.project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
        end
    end
end

更新

再次重新安装 pod 后,Restkit 错误消失了,但出现以下错误:

ld:警告:忽略文件 /Users/sanojkashyap/Library/Developer/Xcode/DerivedData/PocketLobbyiOS-euffofwxmoaqxqbfslgkbnhhzdsz/Build/Products/Debug-iphonesimulator/PocketLobbyiOS.app/PocketLobbyiOS, 文件是为 i386 构建的,它不是被链接的架构 (x86_64): /Users/sanojkashyap/Library/Developer/Xcode/DerivedData/PocketLobbyiOS-euffofwxmoaqxqbfslgkbnhhzdsz/Build/Products/Debug-iphonesimulator/PocketLobbyiOS.app/PocketLobbyiOS 架构 x86_64 的未定义符号:
“_OBJC_CLASS_$_PLArticle”,引用自: PLArticleTests.o 中的 objc-class-ref (也许你的意思是:_OBJC_CLASS_$_PLArticleTests)“_OBJC_CLASS_$_PLLocation”,引用自: PLArticleTests.o "_OBJC_CLASS_$_XCTestCase" 中的 objc-class-ref,引用自: _OBJC_CLASS_$_PLArticleTests in PLArticleTests.o "_OBJC_EHTYPE_$__XCTestCaseInterruptionException",引用自: PLArticleTests.o "_OBJC_METACLASS_$_XCTestCase" 中的 GCC_except_table2,引用自: _OBJC_METACLASS_$_PLArticleTests 中的 PLArticleTests.o "__XCTDescriptionForValue",引用自: -PLArticleTests.o "__XCTFailureFormat" 中的[PLArticleTests testExample],引用自: -PLArticleTests.o“__XCTFailureHandler”中的[PLArticleTests testExample],引用自: -PLArticleTests.old 中的 [PLArticleTests testExample]:未找到体系结构 x86_64 的符号:错误:链接器命令失败 退出代码为 1(使用 -v 查看调用)

(null):“_OBJC_CLASS_$_PLArticle”,引用自:

(null): PLArticleTests.o 中的 Objc-class-ref

(null):(也许你的意思是:_OBJC_CLASS_$_PLArticleTests)

(null): "_OBJC_CLASS__$_PLLLocation",引用自:

(null): PLArticleTests.o 中的 Objc-class-ref

(null):“_OBJC_CLASS_$_XCTestCase”,引用自:

(null):PLArticleTests.o 中的_OBJC_CLASS_$_PLArticleTests

(null): "_OBJC_EHTYPE_$__XCTestCaseInterruptionException",引用 来自:

(null): PLArticleTests.o 中的 GCC_except_table2

(null):“_OBJC_METACLASS_$_XCTestCase”,引用自:

(null):PLArticleTests.o 中的_OBJC_METACLASS_$_PLArticleTests

(null): "__XCTDescriptionForValue",引用自:

(null): -[PLArticleTests testExample] in PLArticleTests.o

(null): "__XCTFailureFormat",引用自:

(null): -[PLArticleTests testExample] in PLArticleTests.o

(null): "__XCTFailureHandler",引用自:

(null): -[PLArticleTests testExample] in PLArticleTests.o

(null): 未找到 x86_64 架构的符号

(null):链接器命令失败,退出代码为 1(使用 -v 查看 调用)

Ld /Users/sanojkashyap/Library/Developer/Xcode/DerivedData/PocketLobbyiOS-euffofwxmoaqxqbfslgkbnhhzdsz/Build/Intermediates/PocketLobbyiOS.build/Debug-iphonesimulator/PocketLobbyiOSTests.build/Objects-normal/i386/PocketLobbyiOSTests 普通 i386 cd /Users/sanojkashyap/pocketlobbyiOS/PocketLobbyiOS 导出 IPHONEOS_DEPLOYMENT_TARGET=6.1 导出 PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin: /usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -L/Users/sanojkashyap/Library/Developer/Xcode/DerivedData/PocketLobbyiOS-euffofwxmoaqxqbfslgkbnhhzdsz/Build/Products/Debug-iphonesimulator -L/Users/sanojkashyap/pocketlobbyiOS/PocketLobbyiOS/Pods/Mapbox/Proj4 -L/Users/sanojkashyap/pocketlobbyiOS/PocketLobbyiOS/Pods/TestFlightSDK -F/Users/sanojkashyap/Library/Developer/Xcode/DerivedData/PocketLobbyiOS-euffofwxmoaqxqbfslgkbnhhzd /产品/调试-iphone模拟器 -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/Developer/Library/Frameworks -filelist /Users/sanojkashyap/Library/Developer/Xcode/DerivedData/PocketLobbyiOS-euffofwxmoaqxqbfslgkbnhhzdsz/Build/Intermediates/PocketLobbyiOS.build/Debug-iphonesimulator/PocketLobbyiOSTests.build/Objects-normal/i386/PocketLobbyiOSTests.LinkFileList -bundle_loader /Users/sanojkashyap/Library/Developer/Xcode/DerivedData/PocketLobbyiOS-euffofwxmoaqxqbfslgkbnhhzdsz/Build/Products/Debug-iphonesimulator/PocketLobbyiOS.app/PocketLobbyiOS -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-AFNetworking -lPods-DACCircularProgress -lPods-DDPageControl -lPods-FMDB -lPods-GRMustache -lPods-ISO8601DateFormatterValueTransformer -lPods-JRSwizzle -lPods-MBProgressHUD -lPods-MWPhotoRecor-Browser -lPods lPods-Mapbox -lPods-Mixpanel -lPods-OHAttributedLabel -lPods-PKRevealController -lPods-PSTCollectionView -lPods-RKValueTransformers -lPods-Reachability -lPods-RestKit -lPods-SDWebImage -lPods-SMCalloutView -lPods-SOCKit -lPods-TestFlightSDK -lPods- TransitionKit -lProj4 -lTestFlight -lsqlite3 -lz -framework Accelerate -framework AssetsLibrary -framework CFNetwork -framework CoreData -framework CoreGraphics -framework CoreLocation -framework CoreTelephony -framework CoreText -framework Foundation -framework ImageIO -framework MapKit -framework MessageUI -framework MobileCoreServices -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -framework UIKit -framework Foundation -lPods -Xlinker -dependency_info -Xlinker /Users/sanojkashyap/Library /Developer/Xcode/DerivedData/PocketLobbyiOS-euffofwxmoaqxqbfslgkbnhhzdsz/Build/Intermediates/PocketLobbyiOS.build/Debug-iphonesimulator/PocketLobbyiOSTests.build/Objects-normal/i386/PocketLobbyiOSTests_dependency_info.dat -o /Users/sanojkashyap/Library/Developer/Xcode/DerivedData/PocketLobbyiOS-euffofwxmoaqxqbfslgkbnhhzdsz/Build/Intermediates/PocketLobbyiOS.build/Debug-iphonesimulator/PocketLobbyiOSTests.build/Objects-normal/i386/PocketLobbyiOSTests

架构 i386 的未定义符号:“_OBJC_CLASS_$_XCTestCase”, 参考自: _OBJC_CLASS_$_PLArticleTests in PLArticleTests.o "_OBJC_EHTYPE_$__XCTestCaseInterruptionException",引用自: PLArticleTests.o "_OBJC_METACLASS_$_XCTestCase" 中的 GCC_except_table2,引用自: _OBJC_METACLASS_$_PLArticleTests 中的 PLArticleTests.o "__XCTDescriptionForValue",引用自: -PLArticleTests.o "__XCTFailureFormat" 中的[PLArticleTests testExample],引用自: -PLArticleTests.o“__XCTFailureHandler”中的[PLArticleTests testExample],引用自: -PLArticleTests.old 中的 [PLArticleTests testExample]:未找到体系结构 i386 的符号:错误:链接器命令失败 退出代码为 1(使用 -v 查看调用)

【问题讨论】:

  • 我昨天帮助了一个有类似问题的人。请看我的回答,我已经处理了多个问题-stackoverflow.com/questions/26321543/…
  • 如果您解决了问题,请在此处更新。否则,您能否分享您的 Podfile,以便我们找出您的问题所在?
  • @Sandy : 找到解决方案了吗?

标签: ios restkit xcode6 cocoapods


【解决方案1】:

尝试将 Pods.debug 添加到您的项目 -> Info -> Configurations -> Debug,并将 Pods.release 添加到 Release 部分。我通过这个设置解决了我丢失的“RestKit.h”问题。

【讨论】:

  • 它不工作,我并没有突然停止工作。我已经重新安装了 cocoapods。还是同样的问题。
  • @Sandy,你能否分享一下你的 Pods.debug 文件内容以及它报告 RestKit.h 丢失时的错误。
  • 现在 Restkit 错误消失了,但似乎与测试套件有关的其他问题即将到来。
  • 是的,所有这些 pod 都被选中。
  • @Sandy,是的,我之前也遇到过test kit compile error,你应该通过Pods.debug和Pods.release文件看看这两个文件是否配置错误。
【解决方案2】:

尝试以这种方式编写您的 podfile:

source 'https://github.com/CocoaPods/Specs.git'
link_with  ['PocketLobbyiOS', 'PocketLobbyiOSTests']
platform :ios, '6.0'

pod 'MWPhotoBrowser', :git => 'https://github.com/floriankrueger/MWPhotoBrowser.git', :tag => '1.4.1'
pod 'TestFlightSDK', '~> 3.0.2'
pod 'RestKit', '~> 0.23.1'
pod 'RestKit/ObjectMapping'
pod 'RestKit/Search'
pod 'RestKit/Testing'
pod 'PKRevealController', '~> 2.0.6'
pod 'Mapbox', :git => 'https://github.com/mapbox/mapbox-ios-sdk.git', :tag => '1.2.0'
pod 'MagicalRecord/Shorthand', '~> 2.2'
pod 'DDPageControl', '~> 0.1'
pod 'MWPhotoBrowser'
pod 'Reachability', '~> 3.1.1'
pod 'Mixpanel', '~> 2.4.0'
pod 'OHAttributedLabel', '~> 3.5.4'

# ignore all warnings from all pods
inhibit_all_warnings!

post_install do |installer_representation|
    installer_representation.project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
        end
    end
end

安装 pod,然后在您的项目 Build Setting->Other Linker Flags 添加 $(inherited)。

【讨论】:

  • 嘿,我遇到了另一个问题。
  • 新签出的项目也有问题,其他项目运行良好。有什么想法吗?
  • 谢谢,这个拯救了我的一天! “安装 pod,然后在你的项目 Build Setting->Other Linker Flags,添加 $(inherited)。”
猜你喜欢
  • 1970-01-01
  • 2012-04-27
  • 1970-01-01
  • 2012-12-28
  • 2015-02-02
  • 1970-01-01
  • 2012-08-22
  • 2015-06-04
  • 1970-01-01
相关资源
最近更新 更多