Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle build failed #528

Open
muhammadali514 opened this issue Feb 17, 2025 · 1 comment
Open

Gradle build failed #528

muhammadali514 opened this issue Feb 17, 2025 · 1 comment
Assignees
Labels

Comments

@muhammadali514
Copy link

I am trying to build my unity game with HMS plugin but it always fails showing the reasons below
"FAILURE: Build failed with an exception.

  • Where:
    Script 'E:\Projects\testingthis\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\hmsLauncherTemplate.gradle' line: 1

  • What went wrong:
    A problem occurred evaluating script.

Failed to apply plugin 'com.huawei.agconnect'.
API 'android.registerTransform' is removed.

 For more information, see https://developer.android.com/studio/releases/gradle-plugin-api-updates#transform-api.
 To determine what is calling android.registerTransform, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.

"
"CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\6000.0.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\6000.0.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-8.4.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Environment Variables:
USERDOMAIN = LEVANTESTUDIOS
asl.log = Destination=file
ProgramFiles = C:\Program Files
TMP = C:\Users\MUHAMM1\AppData\Local\Temp
PROCESSOR_ARCHITECTURE = AMD64
PROCESSOR_REVISION = 2100
OneDriveConsumer = C:\Users\Muhammad Ali\OneDrive
OS = Windows_NT
CHROME_CRASHPAD_PIPE_NAME = \.\pipe\crashpad_33248_DWLYLRWCLOHVJLDG
PROCESSOR_IDENTIFIER = AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD
ProgramW6432 = C:\Program Files
USERPROFILE = C:\Users\Muhammad Ali
JAVA_HOME = C:\Program Files\Unity\Hub\Editor\6000.0.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
CommonProgramFiles = C:\Program Files\Common Files
INTEL_DEV_REDIST = C:\Program Files (x86)\Common Files\Intel\Shared Libraries
ComSpec = C:\Windows\system32\cmd.exe
VBOX_MSI_INSTALL_PATH = E:\VMWare
MIC_LD_LIBRARY_PATH = C:\Program Files (x86)\Common Files\Intel\Shared Libraries\compiler\lib\mic
PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
ANDROID_NDK_ROOT = C:\Program Files\Unity\Hub\Editor\6000.0.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
SystemRoot = C:\Windows
NUMBER_OF_PROCESSORS = 12
EFC_21160 = 1
HOMEDRIVE = C:
TEMP = C:\Users\MUHAMM
1\AppData\Local\Temp
Path = C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet;C:\Program Files\OpenSSL-Win64\bin;C:\Program Files\Java\jdk-11\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Muhammad Ali\AppData\Local\Programs\Python\Python313\Scripts;C:\Users\Muhammad Ali\AppData\Local\Programs\Python\Python313;C:\Users\Muhammad Ali\AppData\Local\Microsoft\WindowsApps;C:\Users\Muhammad Ali.dotnet\tools;C:\Users\Muhammad Ali\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Muhammad Ali\AppData\Local\GitHubDesktop\bin;C:\Program Files\Java\jdk-11\bin;E:\FlutterDev\sdk\flutter\bin;C:\Users\Muhammad Ali\AppData\Roaming\npm
USERNAME = Muhammad Ali
COMPUTERNAME = LEVANTESTUDIOS
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
ALLUSERSPROFILE = C:\ProgramData
SystemDrive = C:
windir = C:\Windows
HOMEPATH = \Users\Muhammad Ali
PUBLIC = C:\Users\Public
CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
APPDATA = C:\Users\Muhammad Ali\AppData\Roaming
OneDrive = C:\Users\Muhammad Ali\OneDrive
DriverData = C:\Windows\System32\Drivers\DriverData
CommonProgramW6432 = C:\Program Files\Common Files
ProgramFiles(x86) = C:\Program Files (x86)
SESSIONNAME = Console
LOGONSERVER = \LEVANTESTUDIOS
LOCALAPPDATA = C:\Users\Muhammad Ali\AppData\Local
PROCESSOR_LEVEL = 25
__COMPAT_LAYER = DetectorsAppHealth
USERDOMAIN_ROAMINGPROFILE = LEVANTESTUDIOS
ProgramData = C:\ProgramData
ORIGINAL_XDG_CURRENT_DESKTOP = undefined

stderr[

FAILURE: Build failed with an exception.

  • Where:
    Script 'E:\Projects\testingthis\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\hmsLauncherTemplate.gradle' line: 1

  • What went wrong:
    A problem occurred evaluating script.

Failed to apply plugin 'com.huawei.agconnect'.
API 'android.registerTransform' is removed.

 For more information, see https://developer.android.com/studio/releases/gradle-plugin-api-updates#transform-api.
 To determine what is calling android.registerTransform, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
  • 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[

Configure project :unityLibrary
Variant 'debug', will keep symbols in binaries for:
'libunity.so'
'libil2cpp.so'
'libmain.so'
Variant 'release', symbols will be stripped from binaries.
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :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 :0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[T] progress, System.String error) (at <a425863720524a84b6422b03142891e1>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.String[] extraArguments, System.Action1[T] progress) (at :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 :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 :0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
"

Environment (please complete the following information):

  • Unity Version 6000.0.16f1 - 2021.3.45f1
  • HMS Unity Plugin Version 2.3.9
  • Gradle version "distributionUrl=https://services.gradle.org/distributions/gradle-8.4-bin.zip"
Copy link

Thank you for reporting this issue/advice.

We will get back to you as soon as possible.
Would you like to star our plugin to support us? ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants