以下是我的输出中出现错误的部分。我正在使用Visual Studio 2017和Xcode 11进行构建。我已经打扫干净了。从项目中删除了bin / obj以确保不是,并且在查看输出文件后,这似乎与我从未接触过的文件有关。
3> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Wno-receiver-forward-class -Wno-objc-missing-super-calls -Wno-unguarded-availability-new -stdlib=libc++ -gdwarf-2 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/12.4.0.64/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk -Qunused-arguments -miphoneos-version-min=8.0 -arch arm64 -c -o /Users/jbarrientos/Library/Caches/Xamarin/mtbs/builds/ILSMobile.iOS/03074acfdcf196377abbb6532e618958/obj/iPhone/Debug/mtouch-cache/arm64/registrar.o -x objective-c++ -DDEBUG /Users/jbarrientos/Library/Caches/Xamarin/mtbs/builds/ILSMobile.iOS/03074acfdcf196377abbb6532e618958/obj/iPhone/Debug/mtouch-cache/registrar.m
3> In file included from /Users/jbarrientos/Library/Caches/Xamarin/mtbs/builds/ILSMobile.iOS/03074acfdcf196377abbb6532e618958/obj/iPhone/Debug/mtouch-cache/registrar.m:3:
3> In file included from /Users/jbarrientos/Library/Caches/Xamarin/mtbs/builds/ILSMobile.iOS/03074acfdcf196377abbb6532e618958/obj/iPhone/Debug/mtouch-cache/registrar.h:19:
3> In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.h:31:
3> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h:17:47: error: expected identifier or '{'
3> typedef NS_ENUM(NSInteger, UIImageOrientation);
3> ^
3> /Users/jbarrientos/Library/Caches/Xamarin/mtbs/builds/ILSMobile.iOS/03074acfdcf196377abbb6532e618958/obj/iPhone/Debug/mtouch-cache/registrar.m:12096:17: warning: method 'updateSearchResultsForSearchController:' in protocol 'UISearchResultsUpdating' not implemented [-Wprotocol]
3> @implementation UIKit_UISearchController___Xamarin_UISearchResultsUpdating {
3> ^
3> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchController.h:33:1: note: method 'updateSearchResultsForSearchController:' declared here
3> - (void)updateSearchResultsForSearchController:(UISearchController *)searchController;
3> ^
3> /Users/jbarrientos/Library/Caches/Xamarin/mtbs/builds/ILSMobile.iOS/03074acfdcf196377abbb6532e618958/obj/iPhone/Debug/mtouch-cache/registrar.m:12096:17: warning: method 'updateSearchResultsForSearchController:' in protocol 'UISearchResultsUpdating' not implemented [-Wprotocol]
3> @implementation UIKit_UISearchController___Xamarin_UISearchResultsUpdating {
3> ^
3> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchController.h:33:1: note: method 'updateSearchResultsForSearchController:' declared here
3> - (void)updateSearchResultsForSearchController:(UISearchController *)searchController;
3> ^
3> 2 warnings and 1 error generated.
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(795,3): error MT4109: Failed to compile the generated registrar code. Please file a bug report at http://bugzilla.xamarin.com
您将使用较低的iOS SDK版本进行构建,并使用iOS中引入的类型进行更新。
您需要使用最新的SDK(iOS 13)进行构建,可以在您的项目的iOS构建选项)。
如果找不到它,则应在Mac机器上更新Xamarin.iOS!