对于我的Xamarin Forms iOS项目,我总是将链接器行为设置为"Link Framework SDK Only“,这在过去是有效的,但突然我不能再使用它了。当我尝试编译时,我得到了以下错误。
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,如果这个信息有帮助的话。
发布于 2020-10-15 20:29:46
在将几个NuGet包更新到最新版本后,我遇到了这个问题。我花了一段时间才弄清楚哪一个是罪魁祸首,但在我的例子中是Scandit.BarcodePicker.Xamarin;在5.17.0.10版本中,我得到了与您相同的错误,但在5.16.0.10版本中,一切正常。
在您的情况下,它可能是一个不同的包。如果您的项目处于版本控制之下,您可以尝试恢复到较旧的提交,并查看它是否从那里构建和工作。您可能还需要清理您的解决方案。
https://stackoverflow.com/questions/64281943
复制相似问题