IL2CPP build problem

I got this error, i cant seem to be able to build for some reason

Building C:\Users\Chenr\Documents\Unity Projects\NewMada\MDAProject\Library\Bee\artifacts\unitylinker_dwek.traceevents failed with output:
C:\Program Files\Unity\Hub\Editor\2021.3.23f1\Editor\Data\il2cpp\build\deploy\UnityLinker.exe --search-directory=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed --out=Library/Bee/artifacts/WinPlayerBuildProgram/ManagedStripped --include-link-xml=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed\MethodsToPreserve.xml --include-link-xml=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed\TypesInScenes.xml --include-link-xml=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed\SerializedTypes.xml --include-link-xml=C:\Users\Chenr\Documents\Unity Projects\NewMada\MDAProject\Temp\burst.link.xml --include-link-xml=C:\Users\Chenr\Documents\Unity Projects\NewMada\MDAProject\Assets\Photon\PhotonUnityNetworking\link.xml --include-directory=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed --profiler-report --profiler-output-file=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Library/Bee/artifacts/unitylinker_dwek.traceevents --dotnetprofile=unityaot-win32 --dotnetruntime=Il2Cpp --platform=WindowsDesktop --use-editor-options --editor-settings-flag=None,Development --engine-modules-asset-file=C:/Program Files/Unity/Hub/Editor/2021.3.23f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/modules.asset --editor-data-file=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/EditorToUnityLinkerData.json --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/PhotonChat.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.Universal.Runtime.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/Unity.TextMeshPro.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/PhotonRealtime.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/PhotonUnityNetworking.Utilities.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/PhotonUnityNetworking.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.Core.Runtime.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/SimpleFileBrowser.Runtime.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/Elringus.UnityGoogleDrive.Runtime.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/RTLTMPro.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/PhotonUnityNetworking.Demos.dll --include-unity-root-assembly=C:/Users/Chenr/Documents/Unity Projects/NewMada/MDAProject/Temp/StagingArea/Data/Managed/DOTween.dll --print-command-line --enable-analytics
ILLink: error IL1999: ERROR: Failed to resolve base type Newtonsoft.Json.JsonConverter for type Google.Apis.Json.RFC3339DateTimeConverter in assembly Google.Apis.Core.dll when linking against the UnityAot-Win32 profile
Fatal error in Unity CIL Linker
Unity.Linker.StrippingResolutionBaseTypeException: ERROR: Failed to resolve base type Newtonsoft.Json.JsonConverter for type Google.Apis.Json.RFC3339DateTimeConverter in assembly Google.Apis.Core.dll when linking against the UnityAot-Win32 profile
at Unity.Linker.MonoBehaviorUtilities.DerivesFrom(UnityLinkContext context, TypeDefinition type, String[ ] possibleBaseNames)
at Unity.Linker.MonoBehaviorUtilities.IsMonoBehaviourOrScriptableObject(UnityLinkContext context, TypeDefinition type)
at Unity.Linker.Steps.Rooting.ResolveFromMonoBehaviours.b__6_0(TypeDefinition t)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Unity.Linker.Steps.Rooting.ResolveFromMonoBehaviours.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()
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()

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: