PackageCache folder error

Hi. I’ve building a project aimed to Android for the past two months. Now I switched from my old laptop where I was using Linux to my new Windows PC.
I had never tried to build before because I was lacking the Android SDK.
Now my problem is that I want to build the moved project on my Windows PC, it gives me these errors, which I totally don’t know what to do about:


Library\PackageCache\com.unity.analytics@3.2.2\DataPrivacy\DataPrivacyButton.cs(3,19): error CS0234: The type or namespace name ‘UI’ does not exist in the namespace ‘UnityEngine’ (are you missing an assembly reference?)


Library\PackageCache\com.unity.analytics@3.2.2\DataPrivacy\DataPrivacyButton.cs(7,38): error CS0246: The type or namespace name ‘Button’ could not be found (are you missing a using directive or an assembly reference?)


Error building Player because scripts had compiler errors


Build completed with a result of ‘Failed’ UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions >options) [0x00234] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:186
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, >UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in >C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:94
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


I’m using Unity Hub, with Unity 2019.2.0a4 in a Windows 10 computer with an Intel i7 processor.
This does not happen if I create a new project and build the sample scene.

for me clicking reset packages to defaults in advanced of the package manager window also worked

I am getting a similar issue when trying to build for WebGL in 2018.3.8f1. I am getting this immediately after starting the build process
Library/PackageCache/com.unity.analytics@3.2.2/DataPrivacy/DataPrivacyButton.cs(28,25): error CS0618: Warning as Error: 'UnityEngine.Application.ExternalEval(string)' is obsolete: 'Application.ExternalEval is deprecated. See https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html for alternatives.'

Another person was also having a issues with like this.