question

80240195 avatar image
0 Votes"
80240195 asked KyleWang-MSFT edited

builld error with release, but can pass building with debug

my project can pass building with debug, but error with release.
my project is xamarin.forms project, developed by vs2022.
How should I do.
when building with release, the error is

严重性 代码 说明 项目 文件 行 禁止显示状态
错误 Mono.Linker.MarkException: Error processing method: 'System.Void AndroidX.RecyclerView.Widget.RecyclerView/LayoutManager::n_OnInitializeAccessibilityNodeInfo_Landroidx_recyclerview_widget_RecyclerView_Recycler_Landroidx_recyclerview_widget_RecyclerView_State_Landroidx_core_view_accessibility_AccessibilityNodeInfoCompat_(System.IntPtr,System.IntPtr,System.IntPtr,System.IntPtr,System.IntPtr)' in assembly: 'Xamarin.AndroidX.RecyclerView.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve AndroidX.Core.View.Accessibiity.AccessibilityNodeInfoCompat
在 Mono.Linker.Steps.MarkStep.HandleUnresolvedType(TypeReference reference)
在 Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
在 MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
在 Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
在 Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
在 Mono.Linker.Steps.MarkStep.ProcessQueue()
--- 内部异常堆栈跟踪的结尾 ---
在 Mono.Linker.Steps.MarkStep.ProcessQueue()
在 Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
在 Mono.Linker.Steps.MarkStep.Process()
在 Mono.Linker.Steps.MarkStep.Process(LinkContext context)
在 MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
在 Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
在 Mono.Linker.Pipeline.Process(LinkContext context)
在 MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
在 Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
在 Xamarin.Android.Tasks.LinkAssemblies.RunTask()
在 Microsoft.Android.Build.Tasks.AndroidTask.Execute() 位置 /Users/builder/azdo/_work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:行号 17 quPlayer.Android

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KyleWang-MSFT avatar image
1 Vote"
KyleWang-MSFT answered KyleWang-MSFT edited

Hi 80240195,

Welcome to our Microsoft Q&A platform!

One of the causes for this problem is the lack of references to the relevant packages.

Make sure you have installed the "Xamarin.AndroidX.RecyclerView" Nuget package. If installed, update it to the latest and clean&rebuild the project.

Regards,
Kyle


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you very much.

0 Votes 0 ·

KyleWang-MSFT :
You are right.
Thank you.
But I don't find accept answer button.

0 Votes 0 ·

@80240195 Only an answer can be accepted. Now I have converted the comment to the answer.

0 Votes 0 ·