# Stuck on Building Android (ARDK 2.4.2)

**URL:** <https://community.nianticspatial.com/t/stuck-on-building-android-ardk-2-4-2/3348>\
**Category:** I'm Stuck\
**Created:** [March 9, 2023, 2:23am UTC](https://community.nianticspatial.com/t/stuck-on-building-android-ardk-2-4-2/3348 "2023-03-09T02:23:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antony\_Tran](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@Antony\_Tran](https://community.nianticspatial.com/u/Antony_Tran)\
**Post date:** [March 9, 2023, 2:23am UTC](https://community.nianticspatial.com/t/stuck-on-building-android-ardk-2-4-2/3348/1 "2023-03-09T02:23:22Z")

</div>

Hi everyone,

I am getting the following issues when building for Android:

Picked up JAVA\_TOOL\_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

- Where:  
Build file ‘/Users/foundrysix/Documents/Dev/Unity/MetaDice\_Files/MetaDice/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build.gradle’ line: 1

- What went wrong:  
A problem occurred evaluating project ‘:launcher’.

> Failed to apply plugin ‘com.android.internal.application’.  
> Could not create an instance of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.  
> Could not create an instance of type com.android.build.gradle.internal.dsl.TestOptions.  
> Could not create an instance of type com.android.build.gradle.internal.dsl.TestOptions$UnitTestOptions.  
> org.gradle.api.internal.DefaultDomainObjectSet.(Ljava/lang/Class;)V

- 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](https://help.gradle.org)

BUILD FAILED in 1s

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&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

**and also:**

CommandInvokationFailure: Gradle build failed.  
/Applications/Unity/Hub/Editor/2021.3.8f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath “/usr/local/Cellar/gradle/8.0.2/libexec/lib/gradle-launcher-8.0.2.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx4096m” “assembleRelease”

Environment Variables:  
XPC\_SERVICE\_NAME = application.com.unity3d.unityhub.79650954.79650960  
XPC\_FLAGS = 0x0  
JAVA\_TOOL\_OPTIONS = -Dfile.encoding=UTF-8  
MallocNanoZone = 0  
ORIGINAL\_XDG\_CURRENT\_DESKTOP = undefined  
SHELL = /bin/zsh  
SSH\_AUTH\_SOCK = /private/tmp/com.apple.launchd.lVKJQ8A9U6/Listeners  
HOME = /Users/foundrysix  
PATH = /usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands

\_\_CFBundleIdentifier = com.unity3d.unityhub  
USER = foundrysix  
\_\_CF\_USER\_TEXT\_ENCODING = 0x1F5:0x0:0x0  
TMPDIR = /var/folders/7d/cmkbvc453y3g55hqmjtn5vv40000gn/T/  
LOGNAME = foundrysix  
JAVA\_HOME = /Applications/Unity/Hub/Editor/2021.3.8f1/PlaybackEngines/AndroidPlayer/OpenJDK  
COMMAND\_MODE = unix2003

stderr[  
Picked up JAVA\_TOOL\_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

- Where:  
Build file ‘/Users/foundrysix/Documents/Dev/Unity/MetaDice\_Files/MetaDice/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build.gradle’ line: 1

- What went wrong:  
A problem occurred evaluating project ‘:launcher’.

> Failed to apply plugin ‘com.android.internal.application’.  
> Could not create an instance of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.  
> Could not create an instance of type com.android.build.gradle.internal.dsl.TestOptions.  
> Could not create an instance of type com.android.build.gradle.internal.dsl.TestOptions$UnitTestOptions.  
> org.gradle.api.internal.DefaultDomainObjectSet.(Ljava/lang/Class;)V

- 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](https://help.gradle.org)

BUILD FAILED in 1s  
]  
stdout[

> Configure project :launcher  
> WARNING: The option ‘android.enableR8’ is deprecated and should not be used anymore.  
> It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See [Command-Line Interface](https://docs.gradle.org/8.0.2/userguide/command_line_interface.html#sec:command_line_warnings)  
]  
exit code: 1  
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at \<4a8943a7ff7048deb64e0a5059f78d1d\>:0)  
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at \<4a8943a7ff7048deb64e0a5059f78d1d\>:0)  
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at \<4a8943a7ff7048deb64e0a5059f78d1d\>:0)  
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <4a8943a7ff7048deb64e0a5059f78d1d>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at \<4a8943a7ff7048deb64e0a5059f78d1d\>:0)  
Rethrow as GradleInvokationException: Gradle build failed  
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at \<4a8943a7ff7048deb64e0a5059f78d1d\>:0)  
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at \<4a8943a7ff7048deb64e0a5059f78d1d\>:0)  
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at \<4a8943a7ff7048deb64e0a5059f78d1d\>: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 \<4a8943a7ff7048deb64e0a5059f78d1d\>:0)  
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at \<4a8943a7ff7048deb64e0a5059f78d1d\>:0)  
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at \<4a8943a7ff7048deb64e0a5059f78d1d\>:0)  
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at \<4a8943a7ff7048deb64e0a5059f78d1d\>: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 /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:370)  
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&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

- **Host machine & OS version** : Macbook Pro M1 2020 (Ventura)
- **Issue Environment** : Unity Remote / Unity Mock / On Device / Dev Portal
- **ARDK version** : 2.4.2
- **Unity version** : 2021.3.8f1

---

<div class="post-metadata">

**Author:** ![Jesus\_Niantic](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jesus\_Niantic](https://community.nianticspatial.com/u/Jesus_Niantic)\
**Post date:** [March 9, 2023, 10:15pm UTC](https://community.nianticspatial.com/t/stuck-on-building-android-ardk-2-4-2/3348/2 "2023-03-09T22:15:41Z")

</div>

Hello Antony,

Can you verify that you’ve followed all the instructions for our [Android build guide](https://lightship.dev/docs/ardk/ardk_fundamentals/building_android.html)? This includes using an updated Gradle version 6.7.1 or higher and setting the plugin version to 4.2.0 in the Custom Base Gradle Template. Additionally, make sure you didn’t make any changes to the Android Manifest. All you have to do is check the box for Custom Main Manifest and Unity will fill in everything else automatically.

Before you took a look at the console errors, did you also get an error box that popped up with a message? If so, can you share a screenshot?

---

<div class="post-metadata">

**Author:** ![RidM](https://sea2.discourse-cdn.com/niantic/user_avatar/community.nianticspatial.com/ridm/32/2018_2.png) [@RidM](https://community.nianticspatial.com/u/RidM)\
**Post date:** [May 1, 2023, 5:38pm UTC](https://community.nianticspatial.com/t/stuck-on-building-android-ardk-2-4-2/3348/3 "2023-05-01T17:38:53Z")

</div>

OMG, thank you!!! I had my gradle build number 7.5.1 in there for plugin version. I think 4.2.0 made all the difference 😜. That said, I’d done a complete rebuild using 2020.3.2fl instead of 2021.3.14f1. Made sure there were permissions for the camera. Is it critical to have permissions and/or keystores to make the build work? Can you use newer versions of Unitiy?

---

<div class="post-metadata">

**Author:** ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)\
**Post date:** [March 5, 2026, 11:44pm UTC](https://community.nianticspatial.com/t/stuck-on-building-android-ardk-2-4-2/3348/4 "2026-03-05T23:44:49Z")

</div>

Age
