【问题标题】:linker problems after updating pods in xcode 7 swift project在 xcode 7 swift 项目中更新 pod 后的链接器问题
【发布时间】:2016-10-05 23:04:42
【问题描述】:

我有一个使用以下 Podfile 的项目:

target 'XXX' do
    pod 'Google/Analytics'   
    pod 'Google/SignIn'
    pod 'HockeySDK', '~> 4.0.1'
    pod 'GoogleMaps'
    pod 'Google-Mobile-Ads-SDK', '~> 7.0'
    pod 'TesseractOCRiOS', '4.0.0'
    pod 'TOCropViewController'

end

这编译和运行完美。

执行 $pod update 后,我会收到很多更新,请参见下文:

Analyzing dependencies
Downloading dependencies
Installing FirebaseAnalytics (3.2.0)
Installing FirebaseInstanceID (1.0.6)
Installing Google 3.0.3 (was 2.0.3)
Installing Google-Mobile-Ads-SDK 7.8.1 (was 7.8.0)
Using GoogleAnalytics (3.14.0)
Installing GoogleAppUtilities 1.1.1 (was 1.1.0)
Installing GoogleAuthUtilities 2.0.1 (was 2.0.0)
Installing GoogleInterchangeUtilities 1.2.1 (was 1.2.0)
Using GoogleMaps (1.13.2)
Installing GoogleNetworkingUtilities 1.2.1 (was 1.2.0)
Installing GoogleSignIn 4.0.0 (was 3.0.0)
Installing GoogleSymbolUtilities 1.1.1 (was 1.1.0)
Installing GoogleUtilities 1.3.1 (was 1.2.0)
Using HockeySDK (4.0.1)
Using TOCropViewController (1.3.7)
Using TesseractOCRiOS (4.0.0)
Generating Pods project
Integrating client project
Sending stats
Sending stats
Pod installation complete! There are 7 dependencies from the Podfile and 16
total pods installed.

然后我尝试构建并收到以下错误:

ld: file not found:       /Users/user/Desktop/Personal/xxx/Pods/GoogleUtilities/Libraries/libGTM_NSData+zlib_external.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)

所以我决定从 Other Linker Flags ($(PODS_ROOT)/GoogleUtilities/Libraries/libGTM_NSData+zlib_external.a) 中删除该条目,然后问题就消失了,但现在我收到以下错误:

ld: file not found: -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我在 xcode 7 上。

有什么想法吗?这让我发疯了。

谢谢。

【问题讨论】:

  • 您是否尝试过清理项目、派生数据和构建文件夹?
  • 是的,没有区别。

标签: swift xcode7 cocoapods linker-errors


【解决方案1】:

我自己解决了这个问题。

我所做的是:

  1. 使用查找器转到我的项目文件夹
  2. “显示包内容”为我的 project.xcodeproj
  3. 编辑文件 .pbxproj
  4. 删除调试和发布的其他链接部分

然后我重新启动了 xcode,一切又像魅力一样工作了。

呼!

【讨论】:

    猜你喜欢
    • 2017-04-13
    • 2016-03-22
    • 2015-08-08
    • 2019-11-05
    • 2017-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多