Hello,
I am trying to build my game in Unity. I switched the Build Settings from Windows to Android to generate an APK file, but the build consistently fails.
I receive the following error message:
CommandInvokationFailure: Gradle build failed.
D:\Unity\UnityEditorData\2021.3.45f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "D:\Unity\UnityEditorData\2021.3.45f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.5.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
Followed by :
Gradle could not start your build.
> Could not initialize native services.
> Failed to load native library 'native-platform.dll' for Windows 11 amd64.
I have searched extensively online, consulted various AI tools, and watched numerous tutorials, but I still cannot resolve the issue.
I do not have Android Studio installed.
I checked this stackoverflow topic, but i dont have .gradle folder (not in the C:/Users/MY_NAME/.gradle.
Same here in unity discussion. Dont have .gradle
I even reinstalled Unity and tried different versions for my project. In Edit > Preferences, I can see that Unity includes all the necessary components (JDK, SDK, NDK, Gradle) as part of the installation.
What am I missing?
Thank you very much for your help!