I have been unable to build for Android on my PC since last week, after having done so successfully before. Before it stopped working my workplace changed my account from a domain to a workgroup, so I’m trying to look into if it’s related to that. But builds are working in 2021.3.16, and I’ve reinstalled 2022.3.12 after the account changed without any improvements.
On an empty project, when building to Android this is the error I get:
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Note: [path]\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':launcher:lintVitalAnalyzeRelease'.
> A failure occurred while executing com.android.build.gradle.internal.lint.AndroidLintWorkAction
> java.lang.reflect.InvocationTargetException (no error message)
This is using all the default Android installs shipped with 2022.3.12, which includes gradle version 7.1.2. I get the same issue whether I build with target SDK 32 or 33.
Do you have any gradle templates set in PlayerSettings, if so, maybe they’re invalid. Does the same happen with empty project, if no, you might need to regenerate your templates.
I’m having the same issue since updating to Unity 2022.3.12 LTS. Android builds would work fine in previous Unity (2021.3.16 LTS), but now I get about 50% rate on it failing with this error:
Currently my only workaround is to revert any changes to ProjectSettings.asset and GvhProjectSettings.xml, restart the Editor, close other applications that might be reading files (eg: Rider, Plastic), and then try again. Not always, but it can work after a few tries of this.
Attached is my External Tools settings for reference, which looks like it’s changed to whatever comes with Unity 2022.3.12 LTS.
Any help here greatly appreciated. I’m not good on Android specific stuff (I rely heavily on Unity doing this heavy lifting for me!), and Google shows only this page as a promising result…
I do get this error as well though, so I’ll try with a custom SDK install Exception while marshalling \AndroidPlayer\SDK\build-tools\32.0.0\package.xml. Probably the SDK is read-only
* What went wrong:
Execution failed for task ':launcher:lintVitalAnalyzeRelease'.
> A failure occurred while executing com.android.build.gradle.internal.lint.AndroidLintWorkAction
> java.lang.reflect.InvocationTargetException (no error message)
Sadly, I don’t know, why you’re getting this issue
Run Unity Editor as administrator and try building or
Delete AndroidPlayer\SDK\build-tools\32.0.0 and AndroidPlayer\SDK\platforms\android-33 and reinstall by setting target api as api 34/33 or those folders from Android studio installed android sdk.