- Home /
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.
I'm having same issue. Using the Ads service, which also seem to suddenly be missing reference to library.
Posted in unityhttps://forum.unity.com/threads/ads-service-not-working-properly-since-collaborate-activated.642385/
In hope that someone know how to resolve. Will keep you updated if I figure anything out.
Answer by dkaloger · May 30, 2020 at 07:05 PM
for me clicking reset packages to defaults in advanced of the package manager window also worked
Answer by ChirsGeorge · Mar 21, 2019 at 12:22 PM
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.
I think I may have figured it out. The project I am working on has a rsp file that sets the warnings as errors flags. So when compiling for WebGL it is using a depreciated method for the DataPrivacyButton.cs that is located in the Library folder.
void OpenUrl(string url)
{
interactable = true;
urlOpened = true;
#if UNITY_WEBGL && !UNITY_EDITOR
Application.ExternalEval("window.open(\"" + url + "\",\"_blank\")");
#else
Application.OpenURL(url);
#endif
}
Your answer
Follow this Question
Related Questions
Which file contains information about current selected build platform? 0 Answers
Unity and Version Control 0 Answers
Unity Library/cache is 24 TB 2 Answers
How can I avoid re-importing assets? 3 Answers