2

对于我的 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。

4

1 回答 1

0

在将几个 NuGet 包更新到最新版本后,我遇到了这个问题。花了一些时间才弄清楚哪个是罪魁祸首,但就我而言,它是 Scandit.BarcodePicker.Xamarin; 使用 5.17.0.10 版本时,我会遇到与您相同的错误,但使用 5.16.0.10 版本时,一切正常。

在你的情况下,它可能是一个不同的包。如果您的项目处于版本控制之下,您可以尝试恢复到较旧的提交,并查看它是否可以从那里构建和工作。您可能还需要清洁您的解决方案。

于 2020-10-15T12:29:46.193 回答