cannot build game to andorid unity2021.3.29f1

I has 2 errors, pls tell me.
I had removed the Temp and Library folder then the porgram create these folder again this way cannot solve problem.
I reinstall the programe unit or clone(by git) project again. these way cannot solve problem.
I can build blank project to android.
frist error
Building Folder\Library\Bee\artifacts\unitylinker_xy1a.traceevents failed with output:
C:\Program Files\Unity\Hub\Editor\2021.3.29f1\Editor\Data\il2cpp\build\deploy\UnityLinker.exe --search-directory=Folder/Temp/StagingArea/Data/Managed --out=Library/Bee/artifacts/Android/ManagedStripped --include-link-xml=Folder/Temp/StagingArea/Data/Managed\MethodsToPreserve.xml --include-link-xml=Folder/Temp/StagingArea/Data/Managed\TypesInScenes.xml --include-link-xml=Folder/Temp/StagingArea/Data/Managed\SerializedTypes.xml --include-link-xml=C:/Program Files/Unity/Hub/Editor/2021.3.29f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/AndroidNativeLink.xml --include-directory=Folder/Temp/StagingArea/Data/Managed --rule-set=Conservative --profiler-report --profiler-output-file=Folder/Library/Bee/artifacts/unitylinker_xy1a.traceevents --dotnetprofile=unityaot-linux --dotnetruntime=Il2Cpp --platform=Android --use-editor-options --enable-engine-module-stripping --engine-modules-asset-file=C:/Program Files/Unity/Hub/Editor/2021.3.29f1/Editor/Data/PlaybackEngines/AndroidPlayer/modules.asset --editor-data-file=Folder/Temp/StagingArea/Data/Managed/EditorToUnityLinkerData.json --include-unity-root-assembly=Folder/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll --include-unity-root-assembly=Folder/Temp/StagingArea/Data/Managed/Unity.TextMeshPro.dll --include-unity-root-assembly=Folder/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll --include-unity-root-assembly=Folder/StagingArea/Data/Managed/GUIAnimator.dll --print-command-line --enable-analytics
Fatal error in Unity CIL Linker
Mono.Linker.LinkerFatalErrorException: ILLink: error IL1005: System.Xml.XmlDownloadManager.GetNonFileStream(Uri,ICredentials,IWebProxy,RequestCachePolicy): Error processing method ‘System.Xml.XmlDownloadManager.GetNonFileStream(Uri,ICredentials,IWebProxy,RequestCachePolicy)’ in assembly ‘System.Xml.dll’
—> System.ArgumentException: Malformed name
at Mono.Cecil.AssemblyNameReference.Parse(String fullName)
at Mono.Linker.LinkContext.GetType(String fullName)
at System.Linq.Enumerable.SelectArrayIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()
at Unity.Linker.Steps.Marking.ClassLibraryMarking.DoAdditionalTypeProcessingForWebRequest(TypeDefinition type)
at Unity.Linker.Steps.UnityMarkStep.DoAdditionalTypeProcessing(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, IMemberDefinition sourceLocationMember)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Unity.Linker.Steps.UnityMarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
at Unity.Linker.Steps.UnityMarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
— End of inner exception stack trace —
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context)
at Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at Unity.Linker.UnityDriver.UnityRun(Boolean noProfilerAllowed, ILogger customLogger)
at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling(ILogger customLogger, Boolean noProfilerAllowed)
at Unity.Linker.UnityDriver.RunDriver()

second error
BuildFailedException: Incremental Player build failed!
UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <1e8c82ffe64a4e1d8e997fa7e5933f70>:0)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <1e8c82ffe64a4e1d8e997fa7e5933f70>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <1e8c82ffe64a4e1d8e997fa7e5933f70>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

How to troubleshoot build failures:

First, make a blank project with a single blank scene and prove that it builds successfully.

If the blank project does NOT build, go fix your Unity installation or your other tools, such as Android SDK, NDK, JDK, etc. It may even be necessary to change to a different version of Unity3D. It is generally best to stay with LTS versions of Unity3D.

Until you can build a blank project to the target platform, don’t fiddle with anything else.

Once you can build a blank project, now bisect the problem by bringing over parts of your current project and building it one subsystem at a time, perhaps stubbing things out that might trigger compiler errors.

Most often things that prevent building are third-party libraries such as Firebase.

Once you identify the subsystem, go to the documentation for it and make sure you are doing it correctly.

It may also be helpful to work through a tutorial or two for whatever subsystem is making the build fail.

Android build not building:

Recently (circa July 2022) there have been reports of Unity’s installer failing to install the Android Tools.

Here was how I brought up Unity2020.3.41 and the Android SDK 31 on October 30, 2022 (edited on August 23, 2023 to include Android SDK 33…):

Android Gradle errors and other related stuff: