Gradle Build Failed -- Tried every solution I could find
Hello,
I've recently been trying to get Unity to make an Android build of my game. After spending several unsuccessful attempts and long days downloading and manually installing JDK, SDK, NDK, then setting the correct directories in the project's preferences, I finally got Unity to accept those, but now the gradle build is continuously failing.
Since I've had problems with the gradle, I've tried every solution I could find: - Manually downloading the gradle, then setting the new directory (like I did for the other three) - Creating a keystore manager - Set scripting backend to IL2CPP - Set the target architecture to ARM 64
But no matter what I do, I keep getting the same result; the build will always fail when it comes to the gradle.
I've tried to narrow down the error messages displayed in the console, but some of them seem to self-duplicate when I select them. If it wasn't for "collapse", I might not have been able to get these messages at all (I separated each separate error with **):
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
FAILURE: Build failed with an exception.
What went wrong: Could not determine the dependencies of task ':launcher:bundleReleaseResources'.
Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 16s
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
**
Build completed with a result of 'Failed' in 182 seconds (181661 ms) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
**
UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in :0 > at > UnityEditor.BuildPlayerWindow.CallBuildMethods > (System.Boolean askForBuildLocation, > UnityEditor.BuildOptions > defaultBuildOptions) [0x00080] in > :0 > UnityEngine.GUIUtility:ProcessEvent > (int,intptr,bool&) > > ArgumentOutOfRangeException: Index and length must refer to a location > within the string. Parameter name: > length System.String.Substring > (System.Int32 startIndex, System.Int32 > length) (at > :0) > UnityEditor.ConsoleWindow.StacktraceWithHyperlinks > (System.String stacktraceText, > System.Int32 callstackTextStart) (at > :0) > UnityEditor.ConsoleWindow.OnGUI () (at > :0) > UnityEditor.HostView.InvokeOnGUI > (UnityEngine.Rect onGUIPosition, > UnityEngine.Rect viewRect) (at > :0) > UnityEditor.DockArea.DrawView > (UnityEngine.Rect viewRect, > UnityEngine.Rect dockAreaRect) (at > :0) > UnityEditor.DockArea.OldOnGUI () (at > :0) > UnityEngine.UIElements.IMGUIContainer.DoOnGUI > (UnityEngine.Event evt, > UnityEngine.Matrix4x4 parentTransform, > UnityEngine.Rect clippingRect, > System.Boolean isComputingLayout, > UnityEngine.Rect layoutSize, > System.Action onGUIHandler, > System.Boolean canAffectFocus) (at > :0) > UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent > (UnityEngine.Event e, > UnityEngine.Matrix4x4 worldTransform, > UnityEngine.Rect clippingRect, > System.Action onGUIHandler, > System.Boolean canAffectFocus) (at > :0) > UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent > (UnityEngine.Event e, System.Action > onGUIHandler, System.Boolean > canAffectFocus) (at > :0) > UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent > (UnityEngine.Event e, System.Boolean > canAffectFocus) (at > :0) > UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw > (UnityEngine.UIElements.EventBase evt, > System.Boolean canAffectFocus, > System.Boolean verifyBounds) (at > :0) > UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI > (UnityEngine.UIElements.EventBase evt, > System.Boolean canAffectFocus, > System.Boolean verifyBounds) (at > :0) > UnityEngine.UIElements.IMGUIContainer.HandleEvent > (UnityEngine.UIElements.EventBase evt) > (at > :0) > UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent > (UnityEngine.UIElements.EventBase evt) > (at > :0) > UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget > (UnityEngine.UIElements.EventBase evt, > UnityEngine.UIElements.BaseVisualElementPanel > panel) (at > :0) > UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget > (UnityEngine.UIElements.EventBase evt, > UnityEngine.UIElements.BaseVisualElementPanel > panel) (at > :0) > UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent > (UnityEngine.UIElements.EventBase evt, > UnityEngine.UIElements.IPanel iPanel) > (at > :0) > UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies > (UnityEngine.UIElements.EventBase evt, > UnityEngine.UIElements.IPanel panel, > System.Boolean > imguiEventIsInitiallyUsed) (at > :0) > UnityEngine.UIElements.EventDispatcher.ProcessEvent > (UnityEngine.UIElements.EventBase evt, > UnityEngine.UIElements.IPanel panel) > (at > :0) > UnityEngine.UIElements.EventDispatcher.ProcessEventQueue > () (at > :0) > UnityEngine.UIElements.EventDispatcher.OpenGate > () (at > :0) > UnityEngine.UIElements.EventDispatcherGate.Dispose > () (at > :0) > UnityEngine.UIElements.EventDispatcher.ProcessEvent > (UnityEngine.UIElements.EventBase evt, > UnityEngine.UIElements.IPanel panel) > (at > :0) > UnityEngine.UIElements.EventDispatcher.Dispatch > (UnityEngine.UIElements.EventBase evt, > UnityEngine.UIElements.IPanel panel, > UnityEngine.UIElements.DispatchMode > dispatchMode) (at > :0) > UnityEngine.UIElements.BaseVisualElementPanel.SendEvent > (UnityEngine.UIElements.EventBase e, > UnityEngine.UIElements.DispatchMode > dispatchMode) (at > :0) > UnityEngine.UIElements.UIElementsUtility.DoDispatch > (UnityEngine.UIElements.BaseVisualElementPanel > panel) (at > :0) > UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent > (System.Int32 instanceID, > System.IntPtr nativeEventPtr, > System.Boolean& eventHandled) (at > :0) > UnityEngine.UIElements.UIEventRegistration.ProcessEvent > (System.Int32 instanceID, > System.IntPtr nativeEventPtr) (at > :0) > UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 > (System.Int32 i, System.IntPtr ptr) > (at > :0) > UnityEngine.GUIUtility.ProcessEvent > (System.Int32 instanceID, > System.IntPtr nativeEventPtr, > System.Boolean& result) (at > :0) > > > > ArgumentOutOfRangeException: Index and > length must refer to a location within > the string. Parameter name: length > System.String.Substring (System.Int32 > startIndex, System.Int32 length) (at > :0) > UnityEditor.ConsoleWindow.StacktraceWithHyperlinks > (System.String stacktraceText, > System.Int32 callstackTextStart) (at > :0) > UnityEditor.ConsoleWindow.OnGUI () (at > :0) > UnityEditor.HostView.InvokeOnGUI > (UnityEngine.Rect onGUIPosition, > UnityEngine.Rect viewRect) (at > :0) > UnityEditor.DockArea.DrawView > (UnityEngine.Rect viewRect, > UnityEngine.Rect dockAreaRect) (at > :0) > UnityEditor.DockArea.OldOnGUI () (at > :0) > UnityEngine.UIElements.IMGUIContainer.DoOnGUI > (UnityEngine.Event evt, > UnityEngine.Matrix4x4 parentTransform, > UnityEngine.Rect clippingRect, > System.Boolean isComputingLayout, > UnityEngine.Rect layoutSize, > System.Action onGUIHandler, > System.Boolean canAffectFocus) (at > :0) > UnityEngine.GUIUtility:ProcessEvent(Int32, > IntPtr, Boolean&) > > > > GUI Error: You are pushing more > GUIClips than you are popping. Make > sure they are balanced. > UnityEngine.GUIUtility:ProcessEvent > (int,intptr,bool&) > >
I'm really hoping someone can help me make sense of this, because I've tried every suggestion I could find and none of it is changing anything. The game itself is complete, and I have no problem creating a PC/Standalone build, but it's just the Android build that's giving me so many problems.
Thanks in advance.
Your answer
Follow this Question
Related Questions
Android Build error 1 Answer
Android app not building after switching to il2cpp 0 Answers
Android Build Errors 0 Answers
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors 0 Answers