Xamarin iOS 构建错误:解压本地框架失败

问题描述

我想建一个很久没用的项目。更新所有可能的 nuget 包并尝试自行修复大部分错误后,我得到以下输出


2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277: Found conflicts between different versions of "System.Buffers" that Could not be resolved.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277: There was a conflict between "System.Buffers,Version=4.0.2.0,Culture=neutral,PublicKeyToken=cc7b13ffcd2ddd51" and "System.Buffers,Version=4.0.3.0,PublicKeyToken=cc7b13ffcd2ddd51".
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:     "System.Buffers,PublicKeyToken=cc7b13ffcd2ddd51" was chosen because it was primary and "System.Buffers,PublicKeyToken=cc7b13ffcd2ddd51" was not.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:     References which depend on "System.Buffers,PublicKeyToken=cc7b13ffcd2ddd51" [C:\Users\CRoeder\.nuget\packages\system.buffers\4.5.1\ref\netstandard2.0\System.Buffers.dll].
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:         C:\Users\CRoeder\.nuget\packages\system.buffers\4.5.1\ref\netstandard2.0\System.Buffers.dll
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\CRoeder\.nuget\packages\system.buffers\4.5.1\ref\netstandard2.0\System.Buffers.dll".
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:             C:\Users\CRoeder\.nuget\packages\system.buffers\4.5.1\ref\netstandard2.0\System.Buffers.dll
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,PublicKeyToken=cc7b13ffcd2ddd51" [].
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:         C:\Users\CRoeder\.nuget\packages\system.memory\4.5.4\lib\netstandard2.0\system.memory.dll
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\CRoeder\.nuget\packages\system.memory\4.5.4\lib\netstandard2.0\system.memory.dll".
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:             C:\Users\CRoeder\.nuget\packages\system.memory\4.5.4\lib\netstandard2.0\system.memory.dll
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:             C:\Users\CRoeder\.nuget\packages\sqlite-net-pcl\1.7.335\lib\netstandard2.0\sqlite-net.dll
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:             C:\Users\CRoeder\source\repos\PLUTester\PLUTester\PLUTester\bin\Debug\netstandard2.0\PLUTester.dll
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:             C:\Users\CRoeder\.nuget\packages\sqlitepclraw.core\2.0.3\lib\netstandard2.0\sqlitePCLRaw.core.dll
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:             C:\Users\CRoeder\.nuget\packages\sqlitepclraw.bundle_green\2.0.3\lib\Xamarin.iOS10\sqlitePCLRaw.batteries_v2.dll
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277:             C:\Users\CRoeder\.nuget\packages\sqlitepclraw.provider.dynamic_cdecl\2.0.3\lib\netstandard2.0\sqlitePCLRaw.provider.dynamic_cdecl.dll
2>  Consider app.config remapping of assembly "System.Runtime.CompilerServices.Unsafe,PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.6.0" [] to Version "5.0.0.0" [C:\Users\CRoeder\.nuget\packages\system.runtime.compilerservices.unsafe\5.0.0\ref\netstandard2.1\System.Runtime.CompilerServices.Unsafe.dll] to solve conflict and get rid of warning.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2298,5): warning MSB3836: The explicit binding redirect on "System.Runtime.CompilerServices.Unsafe,PublicKeyToken=b03f5f7f11d50a3a" conflicts with an autogenerated binding redirect. Consider removing it from the application configuration file or disabling autogenerated binding redirects. The build will replace it with: "<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" xmlns="urn:schemas-microsoft-com:asm.v1" />".
2>  PLUTester.iOS -> C:\Users\CRoeder\source\repos\PLUTester\PLUTester\PLUTester.iOS\bin\iPhone\Debug\PLUTester.iOS.exe
2>  Detected signing identity:
2>          
2>    Code Signing Key: *****
2>    Provisioning Profile: *****
2>    Bundle Id: *****
2>    App Id: *****
2>  /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Users/tnd-it/Library/Caches/Xamarin/mtbs/builds/PLUTester.iOS/2baa4fd2be2e05bc09a85ce9bdd5b7fabb67cd3865a973e98aab3f8045e055d9/obj/iPhone/Debug/response-file.rsp -v "--gcc_flags=-ObjC -lsqlite3 -LC:/Users/CRoeder/AppData/Local/XamarinBuildDownloadCache/GAnlytcs-3.17/Libraries -lGoogleAnalytics -force_load C:/Users/CRoeder/AppData/Local/XamarinBuildDownloadCache/GAnlytcs-3.17/Libraries/libGoogleAnalytics.a -ObjC -lz -lsqlite3 -ObjC -lc++ -lsqlite3 -lz -ObjC -lz -lsqlite3 -ObjC -lc++ -lsqlite3 -lz -ObjC -lsqlite3 -ObjC -lc++ -lsqlite3 -lz -ObjC -lz -lsqlite3 -ObjC -lc++ -lsqlite3 -lz -LC:/Users/CRoeder/AppData/Local/XamarinBuildDownloadCache/GAnlytcs-3.17/Libraries -lGoogleAnalytics -force_load C:/Users/CRoeder/AppData/Local/XamarinBuildDownloadCache/GAnlytcs-3.17/Libraries/libGoogleAnalytics.a -ObjC -lz -lsqlite3" 
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,3): error MT5211: Native linking Failed,undefined Objective-C class: GTMAppAuthFetcherAuthorization. The symbol '_OBJC_CLASS_$_GTMAppAuthFetcherAuthorization' Could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,undefined Objective-C class: GTMKeychain. The symbol '_OBJC_CLASS_$_GTMKeychain' Could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,undefined Objective-C class: GTMOAuth2KeychainCompatibility. The symbol '_OBJC_CLASS_$_GTMOAuth2KeychainCompatibility' Could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,undefined Objective-C class: OIDAuthState. The symbol '_OBJC_CLASS_$_OIDAuthState' Could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,undefined Objective-C class: OIDAuthorizationRequest. The symbol '_OBJC_CLASS_$_OIDAuthorizationRequest' Could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,undefined Objective-C class: OIDAuthorizationService. The symbol '_OBJC_CLASS_$_OIDAuthorizationService' Could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,undefined Objective-C class: OIDIDToken. The symbol '_OBJC_CLASS_$_OIDIDToken' Could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,undefined Objective-C class: OIDServiceConfiguration. The symbol '_OBJC_CLASS_$_OIDServiceConfiguration' Could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,undefined Objective-C class: OIDURLQueryComponent. The symbol '_OBJC_CLASS_$_OIDURLQueryComponent' Could not be found in any of the libraries or frameworks linked with your application.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,3): error MT5210: Native linking Failed,undefined symbol: _OBJC_MetaCLASS_$_GTMAppAuthFetcherAuthorization. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,undefined symbol: _OIDOAuthErrorResponseErrorKey. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,undefined symbol: _OIDOAuthTokenErrorDomain. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,undefined symbol: _OIDResponseTypeCode. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,3): warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,3): warning MT5215: References to 'System.Net.Security' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,3): warning MT5215: References to 'Kernel32' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,3): warning MT5215: References to 'libEGL' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,3): warning MT5215: References to 'dl' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,3): warning MT5215: References to 'kernel32' might require additional -framework=XXX or -lXXX instructions to the native linker
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,3): error MT5201: Native linking Failed. Please review the build log and the user flags provided to gcc: -ObjC -lsqlite3 -LC:/Users/CRoeder/AppData/Local/XamarinBuildDownloadCache/GAnlytcs-3.17/Libraries -lGoogleAnalytics -force_load C:/Users/CRoeder/AppData/Local/XamarinBuildDownloadCache/GAnlytcs-3.17/Libraries/libGoogleAnalytics.a -ObjC -lz -lsqlite3 -ObjC -lc++ -lsqlite3 -lz -ObjC -lz -lsqlite3 -ObjC -lc++ -lsqlite3 -lz -ObjC -lsqlite3 -ObjC -lc++ -lsqlite3 -lz -ObjC -lz -lsqlite3 -ObjC -lc++ -lsqlite3 -lz -LC:/Users/CRoeder/AppData/Local/XamarinBuildDownloadCache/GAnlytcs-3.17/Libraries -lGoogleAnalytics -force_load C:/Users/CRoeder/AppData/Local/XamarinBuildDownloadCache/GAnlytcs-3.17/Libraries/libGoogleAnalytics.a -ObjC -lz -lsqlite3
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(425,3): error : linker command Failed with exit code 1 (use -v to see invocation)
========== Rebuild All: 1 succeeded,1 Failed,0 skipped ==========

我应该从哪里以及如何开始挖掘错误? 我对链接器不太熟悉。

解决方法

问题通过删除所有 nuget 包并手动重新安装来解决。