#Hii all can anyone help me to solve this
1 messages · Page 1 of 1 (latest)
I guess you already googled and chatGPTied. https://forum.unity.com/threads/commandinvokationfailure-gradle-build-failed.479460/
yes i alr try from Google and chatGPT
Clearly there is an issue with your android SDK, NDK. Maybe try creating a new project or better uninstall this editor from hub and reinstall properly.
i alr upgrade my unity editor from 2021.3.21f LTS to 2021.3.22f LTS at last Saturday
if I redo this project I might not be able to meet the deadline for my schoolwork
Then try the other option of uninstalling the editor and reinstalling.
alr tried it too but doesnt work
If you click on where it says 4 errors, you'll see the specific reason why it failed
java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
CommandInvokationFailure: Failed to update Android SDK package list.
C:\Sekolah\Project\sdk\cmdline-tools\latest\bin\sdkmanager.bat --list
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <964670f15c6b47f9b8f9340732720473>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <964670f15c6b47f9b8f9340732720473>:0
0x00007ff76ebad4fd (Unity) StackWalker::GetCurrentCallstack
0x00007ff76ebb40b9 (Unity) StackWalker::ShowCallstack
0x00007ff76fb4ae23 (Unity) GetStacktrace
That error line will have more specifics inside it
this will happend when i using outside JDK/SDK and other
Ah yeah, reinstalling unity won't fix that. Are you using any plugins ?
but from internal will being like this
It's likely caused by the JDK installed, or the Android SDK version
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\2021.3.22f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2021.3.22f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <964670f15c6b47f9b8f9340732720473>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <964670f15c6b47f9b8f9340732720473>:0
0x00007ff6fcacd4fd (Unity) StackWalker::GetCurrentCallstack
0x00007ff6fcad40b9 (Unity) StackWalker::ShowCallstack
0x00007ff6fda6ae23 (Unity) GetStacktrace
0x00007ff6fe119b5d (Unity) DebugStringToFile
0x00007ff6fbc2ef92 (Unity) DebugLogHandler_CUSTOM_Internal_Log
That error isn't the important one, it just says it didn't compile
i didnt understand
This one is the real error.
This just means the build failed
This just means unity noticed the build failed, and something told it there were 3 reasons
ooh
The real error is the java error. It says the location thing is compiled using the wrong android SDK or the wrong java - I think anyway
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <964670f15c6b47f9b8f9340732720473>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <964670f15c6b47f9b8f9340732720473>:0
0x00007ff6fcacd4fd (Unity) StackWalker::GetCurrentCallstack
0x00007ff6fcad40b9 (Unity) StackWalker::ShowCallstack
0x00007ff6fda6ae23 (Unity) GetStacktrace
0x00007ff6fe119b5d (Unity) DebugStringToFile
0x00007ff6fbc2ef92 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x000001df4c6324d3 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x000001df4c6323eb (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x000001de947f09b0 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000001de9498aa05 (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x000001de614e235b (Mono JIT Code)UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
0x000001df2b5d0ef3 (Mono JIT Code) UnityEditor.BuildPlayerWindow:GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension,bool,bool,bool,UnityEditor.Build.BuildPlatform,UnityEditor.Modules.IBuildPostprocessor)
ooh
Yeah that one isnt the one either, keep going through them, one will give you the specific erorrs.. but from the above that was the java error already shown above
okok
There is also a warning that something is not configured in your first screenshot. not sure if you handled that already
Well did you get to the solution?