对于我的 Xamarin Forms iOS 项目,我总是将链接器行为设置为“仅链接框架 SDK”,它在过去有效,但突然我不能再使用它了。尝试编译时出现以下错误。
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(885,3): error : undef: _OBJC_CLASS_$_MLModelConfiguration
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(885,3): error : undef: _OBJC_CLASS_$_MLModel
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(885,3): error : undef: _OBJC_CLASS_$_MLDictionaryFeatureProvider
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(885,3): error : undef: _OBJC_CLASS_$_MLFeatureValue
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(885,3): error : undef: _OBJC_CLASS_$_MLMultiArray
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(885,3): error MT5211: Native linking failed, undefined Objective-C class: MLModelConfiguration. The symbol '_OBJC_CLASS_$_MLModelConfiguration' 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(885,3): error MT5211: Native linking failed, undefined Objective-C class: MLModel. The symbol '_OBJC_CLASS_$_MLModel' 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(885,3): error MT5211: Native linking failed, undefined Objective-C class: MLDictionaryFeatureProvider. The symbol '_OBJC_CLASS_$_MLDictionaryFeatureProvider' 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(885,3): error MT5211: Native linking failed, undefined Objective-C class: MLFeatureValue. The symbol '_OBJC_CLASS_$_MLFeatureValue' 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(885,3): error MT5211: Native linking failed, undefined Objective-C class: MLMultiArray. The symbol '_OBJC_CLASS_$_MLMultiArray' 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(885,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(885,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(885,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(885,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(885,3): error MT5202: Native linking failed. Please review the build log.
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(885,3): error : linker command failed with exit code 1 (use -v to see invocation)
有人知道这是什么意思吗?当我将链接器行为设置为“不链接”时,项目构建没有问题。如果此信息有帮助,我没有使用 Firebase。