Задать вопрос
@Pashtet221

Как исправить ошибку при билде?

Есть такая ошибка: CommandInvokationFailure: Gradle build failed.
/Applications/Unity/Hub/Editor/2022.2.2f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/Unity/Hub/Editor/2022.2.2f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Environment Variables:
XPC_SERVICE_NAME = application.com.unity3d.unityhub.13253110.13253116
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.A3vx9YwAsE/Listeners
HOME = /Users/paveldamut
PATH = /Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands

__CFBundleIdentifier = com.unity3d.unityhub
USER = paveldamut
__CF_USER_TEXT_ENCODING = 0x1F5:0x7:0x31
TMPDIR = /var/folders/qz/59ps1dv918l2tzc0tg6_5msr0000gn/T/
LOGNAME = paveldamut
JAVA_HOME = /Applications/Unity/Hub/Editor/2022.2.2f1/PlaybackEngines/AndroidPlayer/OpenJDK
COMMAND_MODE = unix2003

stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':unityLibrary:compileReleaseJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;30.0.3 Android SDK Build-Tools 30.0.3
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see d.android.com/r/studio-ui/export-licenses.html

Using Android SDK: /Applications/Unity/Hub/Editor/2022.2.2f1/PlaybackEngines/AndroidPlayer/SDK

* 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 23s
]
stdout[
Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details

> Configure project :unityLibrary
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'unityLibrary/build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'maven2' was added by build file 'unityLibrary/build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'MavenLocal' was added by build file 'unityLibrary/build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by build file 'unityLibrary/build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'unityLibrary/build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'maven2' was added by build file 'unityLibrary/build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'MavenLocal' was added by build file 'unityLibrary/build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by build file 'unityLibrary/build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'unityLibrary/build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'maven2' was added by build file 'unityLibrary/build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'MavenLocal' was added by build file 'unityLibrary/build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by build file 'unityLibrary/build.gradle'
WARNING:The specified Android SDK Build Tools version (27.0.0) is ignored, as it is below the minimum supported version (30.0.3) for Android Gradle Plugin 7.1.2.
Android SDK Build Tools 30.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.0'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING:The specified Android SDK Build Tools version (27.0.0) is ignored, as it is below the minimum supported version (30.0.3) for Android Gradle Plugin 7.1.2.
Android SDK Build Tools 30.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.0'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Checking the license for package Android SDK Build-Tools 30.0.3 in /Applications/Unity/Hub/Editor/2022.2.2f1/PlaybackEngines/AndroidPlayer/SDK/licenses
Warning: License for package Android SDK Build-Tools 30.0.3 not accepted.
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>: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 <78a7f7e9a87745b9a9f63bc62bfdda7d>: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 <78a7f7e9a87745b9a9f63bc62bfdda7d>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)

Подозреваю что связана с установкой плагина рекламного, ибо до него все работало хорошо. Искал решение на других форумах(Stack Overflow) со схожими ошибками, но так ничего не помогло. Помогите решить это проблему.
  • Вопрос задан
  • 938 просмотров
Подписаться 1 Средний Комментировать
Пригласить эксперта
Ответы на вопрос 2
freeExec
@freeExec
Участник OpenStreetMap
Открой андроид студию и подтверди лицензии на установленные пакеты.
Ответ написан
@GLeBaTi
1) Open CMD with Administrator
2) Navigate to C:\Program Files\Unity\Hub\Editor\2020.3.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin
3) Execute sdkmanager.bat --licenses
4) Accept licenses
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы