- Home /
Unity 2021.2 android project "classes.jar does not exist" error
Hi I have upgraded my project from unity 2019.3.14f1 to 2021.2.1f1. I have installed unity and android support with unityhub. So now unity runs ndk, sdk, jdk and graddle from recommended installs. After setting up the environment I have tried to make my first build but got the below errors. I have tried to build an empty project but the error has repeated. Here are the errors: 1- Building F:\UnityProjects\2021x\RT321x\Library\Android\Prj\IL2CPP\Gradle\unityLibrary\libs\unity-classes.jar failed with output: The source path C:\Program Files\Unity 2021.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\ıl2cpp\Release\Classes\classes.jar does not exist. UnityEditor.GenericMenu:CatchMenu (object,string[],int)
2- Building Library\Bee\artifacts\Android\ManagedStripped failed with output: Unknown arguments : --�nclude-link-xml=F:/UnityProjects/2021x/RT321x/Temp/StagingArea/Data/Managed\MethodsToPreserve.xml --�nclude-link-xml=F:/UnityProjects/2021x/RT321x/Temp/StagingArea/Data/Managed\TypesInScenes.xml --�nclude-link-xml=C:/Program Files/Unity 2021.2.1f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/AndroidNativeLink.xml --�nclude-directory=F:/UnityProjects/2021x/RT321x/Temp/StagingArea/Data/Managed --�nclude-unity-root-assembly=F:/UnityProjects/2021x/RT321x/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll --�nclude-unity-root-assembly=F:/UnityProjects/2021x/RT321x/Temp/StagingArea/Data/Managed/Unity.TextMeshPro.dll --�nclude-unity-root-assembly=F:/UnityProjects/2021x/RT321x/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll UnityEditor.GenericMenu:CatchMenu (object,string[],int)
3- BuildFailedException: Incremental Player build failed! UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at :0) UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :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 :0) UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)
4- Build completed with a result of 'Failed' in 40 seconds (40217 ms) UnityEditor.GenericMenu:CatchMenu (object,string[],int)
5- UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002d8] in :0 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in :0 UnityEditor.GenericMenu:CatchMenu (object,string[],int)
Notes: -I am running a pc with Windows 7 SP1 64bit English and all necessary updates were installed. -I have tried several installs of unity 2021.2.1f1 with or without unityhub. -I have tried running unity with external sdk, jdk and ndk with the right versions.
I am on an update for the project and now its pending because of this build error, so please HELP :)
Answer by said123sawn · Nov 22, 2021 at 08:08 PM
I don't know if you have solved this problem, but let me tell you anyway, I solved this problem by making "PlayerSettings>Managed Stripping" Level "Disabled".
Thank you for your reply. I have tried disabling managed stripping but it did not work. Same problem contiued. I have downgraded to unity 2019.3.14f1. Downgrading solved this problem :)
It was helps me but i must mention, not directly. In my case i must have set up IL2CPP, but to be able to see Disabled option i was need to have Mono. So i've set up mono and builded. Then i saw other issue, with external library (TriLib). I have fixed that issue and get back to IL2CPP and Managed Stripping Level Minimal. And everything works fine Unity 2021.3.1