Unable to create Android build on Macbook
Hi, I am trying to build android build but I am getting Gradle related error -
My unity3D version is 2019.4.28f - I have tried a lot of tricks shared on internet please suggest the correct way.
My guess is that there is something wrong with the gradle but how to fix this as i have installed the OpenJDK and android SDK that comes with the modules in the hub
Here is my SDK configuration - [2]: /storage/temp/189153-screenshot-2021-11-25-at-85724-pm.png
Console
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':launcher'.
> Could not resolve all artifacts for configuration ':launcher:classpath'.
> Could not find com.android.tools.build:gradle:5.6.4.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.jar
Required by:
project :launcher
> Could not find com.android.tools.build:gradle:5.6.4.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.jar
Required by:
project :launcher
* 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 10s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
0x00007FF7D318371C (Unity) StackWalker::GetCurrentCallstack
0x00007FF7D31876D1 (Unity) StackWalker::ShowCallstack
0x00007FF7D180E4D5 (Unity) GetStacktrace
0x00007FF7D3E1939E (Unity) DebugStringToFile
0x00007FF7D31E2D21 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x000002BCCB7DBA9B (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x000002BCCB7DB93B (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x000002BCCB7DAE5E (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000002BD8B88AAAA (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x000002BD8B88A3A3 (Mono JIT Code) UnityEditor.Android.GradleInvokationException:ParseAndShowException ()
0x000002BDB8690B8B (Mono JIT Code) UnityEditor.Android.PostProcessor.PostProcessRunner:RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext)
0x000002BD8B567BBB (Mono JIT Code) UnityEditor.Android.PostProcessAndroidPlayer:PostProcess (UnityEditor.BuildTarget,string,string,string,string,string,string,UnityEditor.BuildOptions,UnityEditor.RuntimeClassRegistry,UnityEditor.Build.Reporting.BuildReport)
0x000002BD8B56564B (Mono JIT Code) UnityEditor.Android.AndroidBuildPostprocessor:PostProcess (UnityEditor.Modules.BuildPostProcessArgs,UnityEditor.BuildProperties&)
0x000002BD8B5647D2 (Mono JIT Code) UnityEditor.PostprocessBuildPlayer:Postprocess (UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,string,string,string,int,int,UnityEditor.BuildOptions,UnityEditor.RuntimeClassRegistry,UnityEditor.Build.Reporting.BuildReport)
0x000002BD8B564DE0 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_int_object_object_object_int_int_int_object_object (object,intptr,intptr,intptr)
0x00007FFC9488E270 (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke
0x00007FFC94812AE2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke
0x00007FFC9481BB3F (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke
0x00007FF7D30F589E (Unity) scripting_method_invoke
0x00007FF7D30EF75D (Unity) ScriptingInvocation::Invoke
0x00007FF7D10392B5 (Unity) CallMono
0x00007FF7D10569DD (Unity) PostprocessPlayer
0x00007FF7D1041C5D (Unity) DoBuildPlayer_PostBuild
0x00007FF7D103029B (Unity) BuildPlayer
0x00007FF7D1E5FFC8 (Unity) BuildPipeline::BuildPlayerInternalNoCheck
0x00007FF7D1E5DCCE (Unity) BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck
0x000002BDB85F03D3 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,bool)
0x000002BDB85EF2F3 (Mono JIT Code) UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
0x000002BDB85308F3 (Mono JIT Code) UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
0x000002BDB8525053 (Mono JIT Code) UnityEditor.BuildPlayerWindow:GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension,bool,bool,bool,UnityEditor.Build.BuildPlatform)
0x000002BDB8505D6B (Mono JIT Code) UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings ()
0x000002BDB84EE693 (Mono JIT Code) UnityEditor.BuildPlayerWindow:OnGUI ()
0x000002BCFD45B050 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007FFC9488E270 (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke
0x00007FFC94812AE2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke
0x00007FFC9481BD12 (mono-2.0-bdwgc) [object.c:3073] mono_runtime_invoke_checked
0x00007FFC9481C4A9 (mono-2.0-bdwgc) [object.c:5264] mono_runtime_try_invoke_array
0x00007FFC9481BCA6 (mono-2.0-bdwgc) [object.c:5142] mono_runtime_invoke_array_checked
0x00007FFC947C0494 (mono-2.0-bdwgc) [icall.c:3358] ves_icall_InternalInvoke
0x000002BB64976B56 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
0x000002BB64975D9B (Mono JIT Code) System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
0x000002BB65A6849F (Mono JIT Code) System.Reflection.MethodBase:Invoke (object,object[])
0x000002BB67959F9B (Mono JIT Code) UnityEditor.HostView:Invoke (string,object)
0x000002BB67959DEB (Mono JIT Code) UnityEditor.HostView:Invoke (string)
0x000002BDB84ECEFB (Mono JIT Code) UnityEditor.HostView:OldOnGUI ()
0x000002BB67B6169A (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:DoOnGUI (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,bool,UnityEngine.Rect,System.Action,bool)
0x000002BB67B4F173 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,System.Action,bool)
0x000002BDB8391C5B (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,System.Action,bool)
0x000002BDB8391943 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,bool)
0x000002BDB8391503 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUI (UnityEngine.UIElements.EventBase,bool)
0x000002BB67951153 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleEvent (UnityEngine.UIElements.EventBase)
0x000002BB678C69B6 (Mono JIT Code) UnityEngine.UIElements.CallbackEventHandler:HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase)
0x000002BDB838BB63 (Mono JIT Code) UnityEngine.UIElements.MouseCaptureDispatchingStrategy:DispatchEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x000002BB678C0816 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,bool)
0x000002BB678BF593 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x000002BB678BE7B3 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEventQueue ()
0x000002BB678BE42B (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:OpenGate ()
0x000002BB678BE1AB (Mono JIT Code) UnityEngine.UIElements.EventDispatcherGate:Dispose ()
0x000002BB678BFE9B (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x000002BB678B8BB3 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:Dispatch (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,UnityEngine.UIElements.DispatchMode)
0x000002BB678B86FB (Mono JIT Code) UnityEngine.UIElements.BaseVisualElementPanel:SendEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.DispatchMode)
0x000002BB67A96CD3 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
0x000002BB67A9607B (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:ProcessEvent (int,intptr)
0x000002BB67A958E3 (Mono JIT Code) UnityEngine.GUIUtility:ProcessEvent (int,intptr)
0x000002BB67A95B63 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_bool_int_intptr (object,intptr,intptr,intptr)
0x00007FFC9488E270 (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke
0x00007FFC94812AE2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke
0x00007FFC9481BB3F (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke
0x00007FF7D30F589E (Unity) scripting_method_invoke
0x00007FF7D30EF75D (Unity) ScriptingInvocation::Invoke
0x00007FF7D30E950A (Unity) ScriptingInvocation::Invoke<bool>
0x00007FF7D03B2DA5 (Unity) Scripting::UnityEngine::GUIUtilityProxy::ProcessEvent
0x00007FF7D0DCBCD4 (Unity) GUIView::ProcessRetainedMode
0x00007FF7D1835161 (Unity) GUIView::OnInputEvent
0x00007FF7D0DCBBCC (Unity) GUIView::ProcessInputEvent
0x00007FF7D1836B85 (Unity) GUIView::ProcessEventMessages
0x00007FF7D182ED59 (Unity) GUIView::GUIViewWndProc
0x00007FFD15A0E7E8 (USER32) CallWindowProcW
0x00007FFD15A0E229 (USER32) DispatchMessageW
0x00007FF7D1833DFB (Unity) MainMessageLoop
0x00007FF7D183E0C8 (Unity) WinMain
0x00007FF7D48DF262 (Unity) __scrt_common_main_seh
0x00007FFD15957034 (KERNEL32) BaseThreadInitThunk
0x00007FFD15C42651 (ntdll) RtlUserThreadStart
![CommandInvokationFailure: Gradle build failed.
C:/Program Files/Unity/Hub/Editor/2019.4.28f1/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Users\nipundavid\Downloads\gradle-5.6.4-bin\gradle-5.6.4\lib\gradle-launcher-5.6.4.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':launcher'.
> Could not resolve all artifacts for configuration ':launcher:classpath'.
> Could not find com.android.tools.build:gradle:5.6.4.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.jar
Required by:
project :launcher
> Could not find com.android.tools.build:gradle:5.6.4.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/5.6.4/gradle-5.6.4.jar
Required by:
project :launcher
* 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 15s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]
stdout[
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <d76da2c9a45b4b02b93f56ae560b1d44>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, 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 <bd70c40e01f641bdb7d836e1e97755bc>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)][2]
you need to share the errors, its imposible to know what went wrong without them, that last error is only saying "something went wrong", we need to see the first 3
Hi @xxmariofer , apologies for not sharing te entire log... I have updated the question..Please check now if you can help me resolve this
regards, Nipun $$anonymous$$
It says is unable to find the gradle version, did you specified one specific gradle version? Or maybe are you using a plug in that set the gradle version?
Your answer
Follow this Question
Related Questions
Installing android SDK issue 20.3.20f1 version 0 Answers
Can't build android application 1 Answer
Can't build apk getting error 0 Answers
build android problem 1 Answer
I am having trouble building the project for android 0 Answers