My project builds for Android on previous versions and has been for a few years.
Onm Unity 6 preview - it fails and it looks like the key line is this (full trace below)
android.ndkVersion is [25.1.8937393] but android.ndkPath C:\Program Files\Unity\Hub\Editor\6000.0.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK refers to a different version [23.1.7779620].
this is not something that I have set up - I expect Unity to configure the correct NDK since that is part of the Editor config.
What is happening???
Full trace
++++++++++++++++++++++++++++++++++++++++++++
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\6000.0.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath “C:\Program Files\Unity\Hub\Editor\6000.0.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-8.4.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx4096m” “assembleDebug”
stderr[
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-
Where:
Script ‘C:\Users\runes\Documents\GitHub\ViRGiS_Client_Desktop\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\setupSymbols.gradle’ line: 6 -
What went wrong:
A problem occurred evaluating script.
A problem occurred configuring project ‘:unityLibrary’.
com.android.builder.errors.EvalIssueException: [CXX1100] android.ndkVersion is [25.1.8937393] but android.ndkPath C:\Program Files\Unity\Hub\Editor\6000.0.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK refers to a different version [23.1.7779620].
- 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.
==============================================================================
2: Task failed with an exception.
- What went wrong:
A problem occurred configuring project ‘:launcher’.
com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
- 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 4s
]
stdout[
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <6a6e16a4e72b45baa341eb325aa21f2c>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <6a6e16a4e72b45baa341eb325aa21f2c>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg, System.Text.Encoding inputEncoding) (at <6a6e16a4e72b45baa341eb325aa21f2c>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[T] progress, System.String error) (at <6a6e16a4e72b45baa341eb325aa21f2c>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.String[ ] extraArguments, System.Action
1[T] progress) (at <6a6e16a4e72b45baa341eb325aa21f2c>: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.String[ ] extraArguments, System.Action`1[T] progress) (at <6a6e16a4e72b45baa341eb325aa21f2c>:0)
UnityEditor.Android.PostProcessor.Tasks.TasksCommon.RunLauncherGradleTask (UnityEditor.Android.PostProcessor.PostProcessorContext context, System.String taskName, System.String[ ] extraArguments, UnityEditor.Android.PostProcessor.IPostProcessorTask owner, UnityEditor.Android.PostProcessor.ProgressHandler progress) (at <6a6e16a4e72b45baa341eb325aa21f2c>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <6a6e16a4e72b45baa341eb325aa21f2c>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <6a6e16a4e72b45baa341eb325aa21f2c>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)