Include the following details (edit as applicable):
- Issue category: ARDK Documentation / Unity Example Package / Developer Tools
- Device type & OS version: Android
- Host machine & OS version: Windows
- Issue Environment : Unity
- Xcode version:
- ARDK version: 2.4.2
- Unity version: 2021.3.21f1
Description of the issue:
I am setting up a simple ARDK project, the ballDemo example to be precise. Run mode on Unity works perfectly, however, when i try to build the .apk i get build errors relating to the gradle, posted further below.
I have done the steps as described on:
https://lightship.dev/docs/ardk/ardk_fundamentals/building_android.html
Including updating the gradle, which i chose version 7.5.1, as it is the same as the example. I have also attempted version 8.0.2 and 6.7.1, which are the most recent and minimum gradle versions, which yielded the same errors.
I have succeeded in reproducing this problem on an empty project by following the steps as described on the step by step tutorial above without the lightship package, which leads me to believe this problem is solely related to the gradle.
If I use Unity’s default gradle (6.1.1) I get a different gradle error, which is to be expected since according to the notes on the tutorial above, current versions of ARDK require at least gradle 6.7.1.
To install the gradles, i downloaded the binary .zip from:
Unzipped it, and then pointed Unity to the \lib file inside (step 2):
C:\Users\andre\Desktop\LightShip resources\gradle\gradle-6.7.1\lib
Afterwards, I checked the box “Custom Base Gradle Template” (step 3)
And edited the created file:
From here, building failed and yieded the following errors:
Errors:
A)
Exception: Gradle install not valid
Unity.Android.Gradle.AndroidGradle…ctor (System.String gradleLauncherPath, System.Int32 jvmHeapSize) (at :0)
UnityEditor.Android.GradleWrapper.CreateGradleInstance () (at :0)
UnityEditor.Android.PostProcessAndroidPlayer.ExecuteWarmup (System.String stagingArea) (at :0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at :0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, 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 <57a8ad0d1492436d8cfee9ba8e6618f8>:0)
UnityEditor.DefaultBuildMethods:BuildPlayer(BuildPlayerOptions)
Niantic.ARDK.AR.WayspotAnchors.Editor._RemoteAuthoringPresenceManager:OnBuild(BuildPlayerOptions) (at Assets/ARDK/Editor/RemoteContent/_RemoteAuthoringPresenceManager.cs:170)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
B)
Build completed with a result of ‘Failed’ in 38 seconds (38020 ms)
UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
Niantic.ARDK.AR.WayspotAnchors.Editor._RemoteAuthoringPresenceManager:OnBuild (UnityEditor.BuildPlayerOptions) (at Assets/ARDK/Editor/RemoteContent/_RemoteAuthoringPresenceManager.cs:170)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
C)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <57a8ad0d1492436d8cfee9ba8e6618f8>:0
at Niantic.ARDK.AR.WayspotAnchors.Editor._RemoteAuthoringPresenceManager.OnBuild (UnityEditor.BuildPlayerOptions options) [0x00044] in C:\Users\andre\Documents\GitHub\Test\Assets\ARDK\Editor\RemoteContent_RemoteAuthoringPresenceManager.cs:170
at (wrapper delegate-invoke) System.Action`1[UnityEditor.BuildPlayerOptions].invoke_void_T(UnityEditor.BuildPlayerOptions)
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00072] in <57a8ad0d1492436d8cfee9ba8e6618f8>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Any help is greatly apreciatted, if any information is missing feel free to request it.