How to reproduce:
1. Open the attached “IN-53906” project
2. In the “Edit” → “Project Settings” → “Publishing Settings” disable “Custom Keystore”
3. In the “File” → “Build Settings” click “Build”
Expected result: The build is successful
Actual result: The build fails with “CommandInvokationFailure: Gradle build failed.”
Reproducible with: 2021.3.29f1, 2022.3.10f1, 2023.1.13f1
Not reproducible with: 2021.3.30f1
Fixed in: 2021.3.30f1
Could not test with: 2023.2.0b8, 2023.3.0a6 - Build cannot be initialized due to errors with packages
Testing environment: macOS 13.4.1 (Intel)
Part of the error:
CommandInvokationFailure: Gradle build failed.
/Applications/Unity/Hub/Editor/2023.1.4f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/Unity/Hub/Editor/2023.1.4f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-7.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
……
FAILURE: Build failed with an exception.
- What went wrong:
A problem occurred configuring project ':unityLibrary'.
> com.android.builder.sdk.LicenceNotAcceptedException: Failed to install the following Android SDK packages as some licences have not been accepted.
patcher;v4 SDK Patch Applier v4
ndk;23.1.7779620 NDK (Side by side) 23.1.7779620
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
All licenses can be accepted using the sdkmanager command line tool:
sdkmanager.bat --licenses
Or, to transfer the license agreements from one workstation to another, see https://developer.android.com/studio/intro/update.html#download-with-gradle
Using Android SDK: /Applications/Unity/Hub/Editor/2023.1.4f1/PlaybackEngines/AndroidPlayer/SDK