There is some sort of gradle error happening when i am trying to build any arcore scene
These are the errors that i get.
Even though i installed unity 2019.4.11f1 using unity hub and created environment varible for java_home.
Do i need to build using a gradle or is it optional.
These errors come when i don't have any of the gradle options selected in build menu in player settings.
1.BuildFailedException: Main Gradle template is not used in this build. ARCore SDK for Unity requires gradle plugin version >= 3.6.0. Nevigate to 'Project Settings > Player > Android Tab > Publish Settings > Build', check 'Custom Gradle Template'. Then edit the generated file 'Assets/Plugins/Android/mainTemplate.gradle' by adding dependency 'com.android.tools.build:gradle:3.6.0.'. GoogleARCoreInternal.ARCoreAndroidSupportPreprocessBuild.CheckMainGradle () (at Assets/GoogleARCore/SDK/Scripts/Editor/ARCoreAndroidSupportPreprocessBuild.cs:135) GoogleARCoreInternal.ARCoreAndroidSupportPreprocessBuild.OnPreprocessBuild (UnityEditor.BuildTarget target, System.String path) (at Assets/GoogleARCore/SDK/Scripts/Editor/ARCoreAndroidSupportPreprocessBuild.cs:59) GoogleARCoreInternal.PreprocessBuildBase.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Assets/GoogleARCore/SDK/Scripts/Editor/PreprocessBuildBase.cs:52) UnityEditor.Build.BuildPipelineInterfaces+<>c_DisplayClass15_0.b_1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at :0) UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at :0) UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()
2.Error building Player: BuildFailedException: Main Gradle template is not used in this build. ARCore SDK for Unity requires gradle plugin version >= 3.6.0. Nevigate to 'Project Settings > Player > Android Tab > Publish Settings > Build', check 'Custom Gradle Template'. Then edit the generated file 'Assets/Plugins/Android/mainTemplate.gradle' by adding dependency 'com.android.tools.build:gradle:3.6.0.'.
3.Build completed with a result of 'Failed' in 0 seconds (111 ms) 0x00007FF61BAE837C (Unity) StackWalker::GetCurrentCallstack 0x00007FF61BAEC331 (Unity) StackWalker::ShowCallstack 0x00007FF61A1BAE95 (Unity) GetStacktrace 0x00007FF61C76BE7E (Unity) DebugStringToFile 0x00007FF61BB47735 (Unity) DebugLogHandler_CUSTOM_Internal_Log 0x0000012782FEB3AB (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object) 0x0000012782FEB24B (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) 0x0000012782FEA90E (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object) 0x0000012782FEA66A (Mono JIT Code) UnityEngine.Debug:LogError (object) 0x0000012782FB3B33 (Mono JIT Code) UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions) 0x0000012782FABDB3 (Mono JIT Code) UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions) 0x0000012782FAB44B (Mono JIT Code) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun (bool) 0x0000012782FA90D3 (Mono JIT Code) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () 0x000001273B895955 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) 0x00007FFD1900D6B0 (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke 0x00007FFD18F92912 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 0x00007FFD18F9B96F (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 0x00007FF61BA51276 (Unity) CallStaticMonoMethod 0x00007FF61BA50EB9 (Unity) CallStaticMonoMethod 0x00007FF61BA50C41 (Unity) CallStaticMonoMethod 0x00007FF6199C2A4F (Unity) BuildPlayerWithLastSettings 0x00007FF6195D6A6C (Unity) MenuController::ExecuteMenuItem 0x00007FF6195D651B (Unity) MenuController::ExecuteMainMenuItem 0x00007FF61A814C25 (Unity) EditorApplication_CUSTOM_ExecuteMenuItem 0x0000012782FA8BBE (Mono JIT Code) (wrapper managed-to-native) UnityEditor.EditorApplication:ExecuteMenuItem (string) 0x0000012782FA8A8B (Mono JIT Code) UnityEditor.ShortcutManagement.MenuItemEntryDiscoveryInfo:<.ctor>b_7_0 (UnityEditor.ShortcutManagement.ShortcutArguments) 0x0000012782FA1FF1 (Mono JIT Code) UnityEditor.ShortcutManagement.Trigger:HandleKeyEvent (UnityEngine.Event,UnityEditor.ShortcutManagement.IContextManager) 0x000001274069FAA3 (Mono JIT Code) UnityEditor.ShortcutManagement.ShortcutController:HandleKeyEvent (UnityEngine.Event) 0x000001274069F60B (Mono JIT Code) UnityEditor.ShortcutManagement.ShortcutIntegration:EventHandler () 0x000001274069F33B (Mono JIT Code) UnityEditor.EditorApplication:Internal_CallGlobalEventHandler () 0x000001273B895955 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) 0x00007FFD1900D6B0 (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke 0x00007FFD18F92912 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 0x00007FFD18F9B96F (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 0x00007FF61BA5AA2E (Unity) scripting_method_invoke 0x00007FF61BA5475D (Unity) ScriptingInvocation::Invoke 0x00007FF61BA4E745 (Unity) ScriptingInvocation::Invoke 0x00007FF618D73E4E (Unity) Scripting::UnityEditor::EditorApplicationProxy::Internal_CallGlobalEventHandler 0x00007FF6196B4E71 (Unity) CallGlobalInputEvent 0x00007FF61A1E35C0 (Unity) GUIView::ProcessEventMessages 0x00007FF61A1DB709 (Unity) GUIView::GUIViewWndProc 0x00007FFD5B175C7D (USER32) CallWindowProcW 0x00007FFD5B175672 (USER32) DispatchMessageW 0x00007FF61A1E0806 (Unity) MainMessageLoop 0x00007FF61A1EAAC8 (Unity) WinMain 0x00007FF61D209A32 (Unity) _scrt_common_main_seh 0x00007FFD5C597BD4 (KERNEL32) BaseThreadInitThunk 0x00007FFD5CA2CE51 (ntdll) RtlUserThreadStart
4.UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002bb] in :0 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in :0 0x00007FF61BAE837C (Unity) StackWalker::GetCurrentCallstack 0x00007FF61BAEC331 (Unity) StackWalker::ShowCallstack 0x00007FF61A1BAE95 (Unity) GetStacktrace 0x00007FF61C76BE7E (Unity) DebugStringToFile 0x00007FF61BB47735 (Unity) DebugLogHandler_CUSTOM_Internal_Log 0x0000012782FEB3AB (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object) 0x0000012782FEB24B (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) 0x0000012782FEA90E (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object) 0x0000012782FEA66A (Mono JIT Code) UnityEngine.Debug:LogError (object) 0x0000012782FABF1B (Mono JIT Code) UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions) 0x0000012782FAB44B (Mono JIT Code) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun (bool) 0x0000012782FA90D3 (Mono JIT Code) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () 0x000001273B895955 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) 0x00007FFD1900D6B0 (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke 0x00007FFD18F92912 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 0x00007FFD18F9B96F (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 0x00007FF61BA51276 (Unity) CallStaticMonoMethod 0x00007FF61BA50EB9 (Unity) CallStaticMonoMethod 0x00007FF61BA50C41 (Unity) CallStaticMonoMethod 0x00007FF6199C2A4F (Unity) BuildPlayerWithLastSettings 0x00007FF6195D6A6C (Unity) MenuController::ExecuteMenuItem 0x00007FF6195D651B (Unity) MenuController::ExecuteMainMenuItem 0x00007FF61A814C25 (Unity) EditorApplication_CUSTOM_ExecuteMenuItem 0x0000012782FA8BBE (Mono JIT Code) (wrapper managed-to-native) UnityEditor.EditorApplication:ExecuteMenuItem (string) 0x0000012782FA8A8B (Mono JIT Code) UnityEditor.ShortcutManagement.MenuItemEntryDiscoveryInfo:<.ctor>b_7_0 (UnityEditor.ShortcutManagement.ShortcutArguments) 0x0000012782FA1FF1 (Mono JIT Code) UnityEditor.ShortcutManagement.Trigger:HandleKeyEvent (UnityEngine.Event,UnityEditor.ShortcutManagement.IContextManager) 0x000001274069FAA3 (Mono JIT Code) UnityEditor.ShortcutManagement.ShortcutController:HandleKeyEvent (UnityEngine.Event) 0x000001274069F60B (Mono JIT Code) UnityEditor.ShortcutManagement.ShortcutIntegration:EventHandler () 0x000001274069F33B (Mono JIT Code) UnityEditor.EditorApplication:Internal_CallGlobalEventHandler () 0x000001273B895955 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) 0x00007FFD1900D6B0 (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke 0x00007FFD18F92912 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 0x00007FFD18F9B96F (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 0x00007FF61BA5AA2E (Unity) scripting_method_invoke 0x00007FF61BA5475D (Unity) ScriptingInvocation::Invoke 0x00007FF61BA4E745 (Unity) ScriptingInvocation::Invoke 0x00007FF618D73E4E (Unity) Scripting::UnityEditor::EditorApplicationProxy::Internal_CallGlobalEventHandler 0x00007FF6196B4E71 (Unity) CallGlobalInputEvent 0x00007FF61A1E35C0 (Unity) GUIView::ProcessEventMessages 0x00007FF61A1DB709 (Unity) GUIView::GUIViewWndProc 0x00007FFD5B175C7D (USER32) CallWindowProcW 0x00007FFD5B175672 (USER32) DispatchMessageW 0x00007FF61A1E0806 (Unity) MainMessageLoop 0x00007FF61A1EAAC8 (Unity) WinMain 0x00007FF61D209A32 (Unity) _scrt_common_main_seh 0x00007FFD5C597BD4 (KERNEL32) BaseThreadInitThunk 0x00007FFD5CA2CE51 (ntdll) RtlUserThreadStart
Your answer
Follow this Question
Related Questions
Android build installs without an icon in the app drawer 2 Answers
Plugin with id "com.android.application" not found. Gradle Build Failed 1 Answer
Compiling Android APK Errors 1 Answer
Animator not working on android (script generated animation clip) 0 Answers
Camera display when using it to build and run in android 0 Answers