2016-11-16 86 views
4

一切工作正常,直到我得到我的mac格式。格式化後(從El Capitan移至Sierra),我克隆了存儲庫,安裝了Cocoapods,確實是pod update。一切都搞砸了pods。我無法構建應用程序。錯誤與Cocoapods(我認爲是)。錯誤如下:ld:框架未找到GTMOAuth2

ld: framework not found GTMOAuth2 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

我使用Xcode 8.0Swift 2.3,與Cocoapods 1.1.1

Podfile是:

# Uncomment this line to define a global platform for your project 
# platform :ios, '9.0' 

target 'ProjectName' do 
    # Comment this line if you're not using Swift and don't want to use dynamic frameworks 
    use_frameworks! 

    # Firebase Pods 
    pod 'Firebase' 
    pod 'Firebase/Messaging' 
    pod 'Firebase/Auth' 
    pod 'Firebase/Crash' 

    # Google Pods 
    pod 'Google/SignIn' 
    pod 'Google/Analytics' 

    # Crashlytics 
    pod 'Fabric' 
    pod 'Crashlytics' 

    # Facebook 
    # pod 'FacebookCore' 

    # Pods for ProjectName 

    target 'ProjectName Tests' do 
    inherit! :search_paths 
    # Pods for testing 
    end 

    target 'ProjectName UITests' do 
    inherit! :search_paths 
    # Pods for testing 
    end 
end 

也受到警告有關框架路徑。這是如下:

ld: warning: directory not found for option '-F/Users/<user>/Library/Developer/Xcode/DerivedData/<project-name>-ftvbhpamiyfzmwdfpxknyvpcypde/Build/Products/Debug-iphonesimulator/GTMOAuth2' 

ld: warning: directory not found for option '-F/Users/<user>/Library/Developer/Xcode/DerivedData/<project-name>-ftvbhpamiyfzmwdfpxknyvpcypde/Build/Products/Debug-iphonesimulator/GTMSessionFetcher' 

ld: warning: directory not found for option '-F/Users/<user>/Library/Developer/Xcode/DerivedData/<project-name>-ftvbhpamiyfzmwdfpxknyvpcypde/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac' 

回答

15

通過選擇.xcworkspace(不.xcodeproj)重新打開你的項目,這3個警告和1個錯誤將會消失。

0

要解決此問題,請確保Build Active Architecture Only在您的項目構建設置中設置爲No。 同時在所有Pod目標中設置Build Active Architecture OnlyNo,如附圖所示。

enter image description here

然後清理並重建項目。