2017-09-26 50 views
0

我最近更新到Xcode 9,當我構建我的應用程序時,出現Apple Mach-0連接器(iD)錯誤。在更新項目之前工作得很好。錯誤看起來像這樣:更新到Xcode 9帶有錯誤

Undefined symbols for architecture arm64: 
"__T0So22AVCapturePhotoSettingsC12AVFoundation01_abC16SwiftNativeTypesACWP", referenced from: 
__T09Lifelapse20CameraViewControllerC14capturePictureyyF in CameraViewController.o 
"__T012AVFoundation39_AVCapturePhotoSettingsSwiftNativeTypesPAAE016availablePreviewc11PixelFormatG0SaySo8NSNumberCGfg", referenced from: 
__T09Lifelapse20CameraViewControllerC14capturePictureyyF in CameraViewController.o 
ld: symbol(s) not found for architecture arm64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

我不知道如何解決這個錯誤,謝謝。

+0

沒有你清除緩存的XCode或清除特定項目** ** DerivedData。例如'rm -rf〜/ Library/Developer/Xcode/DerivedData /' –

+0

感謝您的快速回復。剛從項目中刪除派生的數據,仍然顯示3個錯誤。 –

+0

另外,如果使用第三方庫,可能沒有使用正確的手臂選項。 – ghostatron

回答

0

有一個錯誤的Xcode 9錯誤的蘋果。他們讓一些擴展被製作成私有的。您必須在這些方法調用上放置__

例子:

嘗試改變let previewPixelType = settings.availablePreviewPhotoPixelFormatTypes.first!

let previewPixelType = settings.__availablePreviewPhotoPixelFormatTypes.first!

***蘋果的方法來之前不小心做了一些AVFoundation API外部協議私人因此2個undescores _訪問它們。

來源:https://forums.developer.apple.com/thread/86810#259270

+0

啊好吧,多數民衆贊成,謝謝 –

+0

它也發生在我身上。如果它適合您,您可以將我的答案標記爲正確的答案。 –