Unity Gradle在构建到Android时出现的问题

exdqitrt  于 2023-06-23  发布在  Android
关注(0)|答案(1)|浏览(445)

我总是面对这个问题,我是新来的这个领域的任何一个请帮助。。所有的帮助都欢迎我也附上了错误日志

\CommandInvokationFailure: Gradle build failed.
C:\\Program Files\\Unity 2021.1.13f1\\2022.3.0f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\OpenJDK\\bin\\java.exe -classpath "D:\\Working\\UNITY-GAMES-PENDING\\gradle-6.1.1-all\\gradle-6.1.1\\lib\\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Environment Variables:
USERDOMAIN = DESKTOP-DP1N61U
ProgramFiles = C:\\Program Files
LAUNCH_DARKLY_CLIENT_TOKEN = 60a7e30fafc7e60e33446283
TMP = C:\\Users\\Raja\\AppData\\Local\\Temp
PROCESSOR_ARCHITECTURE = AMD64
PROCESSOR_REVISION = 7000

OS = Windows_NT
CHROME_CRASHPAD_PIPE_NAME = \\.\\pipe\\crashpad_5896_FPTZGOCNUDXGBLMU
PROCESSOR_IDENTIFIER = AMD64 Family 21 Model 112 Stepping 0, AuthenticAMD
ProgramW6432 = C:\\Program Files
USERPROFILE = C:\\Users\\Raja
JAVA_HOME = C:\\Program Files\\Unity 2021.1.13f1\\2022.3.0f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\OpenJDK
JD2_HOME = C:\\Users\\Raja\\AppData\\Local\\JDownloader 2.0
CommonProgramFiles = C:\\Program Files\\Common Files
ComSpec = C:\\Windows\\system32\\cmd.exe
AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa
PSModulePath = C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules
ANDROID_NDK_ROOT = C:\\Program Files\\Unity 2021.1.13f1\\2022.3.0f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\NDK
SystemRoot = C:\\Windows
HEAP_CLIENT_TOKEN = 1717415662
NUMBER_OF_PROCESSORS = 2
WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3
JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
DEBUG_ENV_VAR = UnityHub`your text`
BURST_ANDROID_MIN_API_LEVEL = 22
TEMP = C:\\Users\\Raja\\AppData\\Local\\Temp
Path = C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\PC Connectivity Solution;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Program Files\\dotnet;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn;C:\\Program Files (x86)\\Samsung\\Samsung PC Studio 3;C:\\Users\\Raja\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Raja.dotnet\\tools;C:\\MinGW\\bin;;C:\\Users\\Raja\\AppData\\Local\\Programs\\Microsoft VS Code\\bin
USERNAME = Raja
COMPUTERNAME = DESKTOP-DP1N61U
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
SystemDrive = C:
ALLUSERSPROFILE = C:\\ProgramData
SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017
HEAP_CLIENT_TOKEN_STAGING = 3786794399
windir = C:\\Windows
AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21
PUBLIC = C:\\Users\\Public
CommonProgramFiles(x86) = C:\\Program Files (x86)\\Common Files
APPDATA = C:\\Users\\Raja\\AppData\\Roaming
OneDrive = C:\\Users\\Raja\\OneDrive
PROCESSOR_LEVEL = 21
CommonProgramW6432 = C:\\Program Files\\Common Files
ProgramFiles(x86) = C:\\Program Files (x86)
SESSIONNAME = Console
LOGONSERVER = \\DESKTOP-DP1N61U
LOCALAPPDATA = C:\\Users\\Raja\\AppData\\Local
HOMEPATH = \\Users\\Raja
LAUNCH_DARKLY_CLIENT_TOKEN_STAGING = 60a7e30fafc7e60e33446282
HOMEDRIVE = C:
USERDOMAIN_ROAMINGPROFILE = DESKTOP-DP1N61U
ProgramData = C:\\ProgramData
ORIGINAL_XDG_CURRENT_DESKTOP = undefined

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

FAILURE: Build failed with an exception.

* Where:
  Settings file 'D:\\Working\\UNITY-GAMES-PENDING\\Cube Colors\\Library\\Bee\\Android\\Prj\\Mono2x\\Gradle\\settings.gradle' line: 13

* What went wrong:
  A problem occurred evaluating settings 'Gradle'.

> Could not find method dependencyResolutionManagement() for arguments \[settings_7avd7dgsimbg7ismqeevsf8pi$\_run_closure1@375d4054\] on settings 'Gradle' of type org.gradle.initialization.DefaultSettings.

* 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 7s
\]
stdout\[

\]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at \<edae9acfb32b434e9f1e104d7ab2dc78\>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at \<edae9acfb32b434e9f1e104d7ab2dc78\>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at \<edae9acfb32b434e9f1e104d7ab2dc78\>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <edae9acfb32b434e9f1e104d7ab2dc78>: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 \<edae9acfb32b434e9f1e104d7ab2dc78\>: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 \<edae9acfb32b434e9f1e104d7ab2dc78\>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at \<edae9acfb32b434e9f1e104d7ab2dc78\>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at \<edae9acfb32b434e9f1e104d7ab2dc78\>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

任何一个有一个想法来解决它给予instrustions解决,等待帮助感谢所有的答案在unity bulid为android API大是31所有的东西都更新unity sdk是25

6jjcrrmo

6jjcrrmo1#

您的代码片段显示您正在使用Gradle 6.1:
gradle-launcher-6.1.1.jar
dependencyResolutionManagement { }仅从Gradle 6.8及以上版本开始可用:https://docs.gradle.org/6.8/release-notes.html#central-declaration-of-repositories
您必须升级正在使用的Gradle版本。优选地,Gradle Package 器用于:https://docs.gradle.org/current/userguide/gradle_wrapper.html

相关问题