无法解析Xamarin Android中的AndroidX.AppCompat.Graphics.Drawable.DrawableWrapper

wbgh16ku  于 2023-04-18  发布在  Android
关注(0)|答案(1)|浏览(155)

在我的Xamarin Android项目中更新Firebase.Messaging.Service nuget后,我面临构建错误。我有最新的VS 2022版本17.5.4。Android项目针对Android 13。
日志:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000: Mono.Linker.MarkException: Error processing method: 'System.Void Xamarin.Forms.Platform.Android.ShellSearchView/ClipDrawableWrapper::.ctor(Android.Graphics.Drawables.Drawable)' in assembly: 'Xamarin.Forms.Platform.Android.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve AndroidX.AppCompat.Graphics.Drawable.DrawableWrapper
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.HandleUnresolvedType(TypeReference reference)
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.ProcessQueue()
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    --- End of inner exception stack trace ---
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.ProcessQueue()
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.Process()
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Mono.Linker.Pipeline.Process(LinkContext context)
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Xamarin.Android.Tasks.LinkAssemblies.RunTask()
5>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(649,5): error XALNK7000:    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17
========== Rebuild All: 4 succeeded, 1 failed, 0 skipped ==========
sf6xfgos

sf6xfgos1#

您可以尝试删除binobj文件夹,然后重新启动Visual Studio并重试。
如果问题仍然存在,请尝试将应用中的所有nuget更新为最新版本。

相关问题