CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\2022.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\2022.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
FAILURE: Build failed with an exception.
* Where:
Build file 'F:\\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'.
> ANDROID_SDK_HOME is set to the root of your SDK: C:\Users\media\AppData\Local\Android\Sdk
ANDROID_SDK_HOME was meant to be the parent path of the preference folder expected by the Android tools.
It is now deprecated.
To set a custom preference folder location, use ANDROID_USER_HOME.
It should NOT be set to the same directory as the root of your SDK.
To set a custom SDK location, use ANDROID_HOME.
* 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 1s
]
stdout[
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <d6ef319e15d14c43ba81bc70e508c266>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <d6ef319e15d14c43ba81bc70e508c266>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <d6ef319e15d14c43ba81bc70e508c266>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <d6ef319e15d14c43ba81bc70e508c266>: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 <d6ef319e15d14c43ba81bc70e508c266>: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 <d6ef319e15d14c43ba81bc70e508c266>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <d6ef319e15d14c43ba81bc70e508c266>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <d6ef319e15d14c43ba81bc70e508c266>: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 <d6ef319e15d14c43ba81bc70e508c266>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <d6ef319e15d14c43ba81bc70e508c266>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <d6ef319e15d14c43ba81bc70e508c266>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <d6ef319e15d14c43ba81bc70e508c266>: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 <a62328349c154758b537cb55981f61df>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Welcome to the Magic Leap Developer forum. Could you please provide more information about the issue you are running into and how we can reproduce it?
Have you followed the setup instruction steps as they are outlined in the Unity Getting Started Guide?
I see that you are using Unity Engine 2022.2.x which is not compatible with the SDK.
So by fixing my Setup problem by updating it I solved some issues from there. And now I'm getting
Unable to detect SDK in the selected directory. C:\Program Files\Unity\2022.3.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\cmdline-tools\latest\bin\sdkmanager.bat does not exist. Android SDK command-line tools component is not found. Make sure "Command-line Tools (latest)" is installed in the SDK manager.
If command-line tools are installed, but this message is still shown, please restart the Unity editor.
But Command-line Tools (latest) is installed, and Unity has been restarted.
After downgrading to 2022.3.20 the issue with Command-line Tools (latest) is resolved.
Now I'm back at
Failed to apply plugin 'com.android.internal.application'.
> ANDROID_SDK_HOME is set to the root of your SDK: C:\Users\media\AppData\Local\Android\Sdk
ANDROID_SDK_HOME was meant to be the parent path of the preference folder expected by the Android tools.
It is now deprecated.
My 2022.1. version builds fine. And that is the version used for the Android project with ARFoundatoin integration for mobile devices, that is being transferred for ML2.
We do not support using 2022.1 to build Magic Leap 2 applications. Regarding the issue that you are having, are you using the Android tools that came with Unity?
This issue is a general Unity build issue and you may also want to reach out on their forums to see what could be causing the build error as they might have more trouble shooting resources.
Please make sure that the input actions on the controller are set properly. I think the component is called XR controller in unity. The reference for the position and rotation might be null.
If the input actions are set but the controller still does not work properly, make sure that that input action manager component is enabling the correct input actions.
We do not have a guide but I will submit your feedback to the voice of customer team.
Additionally, in the image you posted, it appears that the input actions are not added to the action based controller component.
I recommend you create another topic if you run into any other issues so that we can make sure the topic question is marked with the relevant solution.
Additionally, in the image you posted, it appears that the input actions are not added to the action-based controller component.
That is right but it works once I removed Interaction profiles except ML2 Inter... Controller Profile. Input is driven by Input Action References from Input Action Asset from ML.