I’m having a problem with Unity, I’m not able to create a build for android, (I had already managed to do it before), I don’t know what made this happen, if it was because I updated Unity, to a more recent version, or if it was something configuration I moved.
I’ve tried almost everything a little bit, I went back to the same project that I had managed to create the build for android, and trying to create it with the new version, I couldn’t, I tried to go back to the same version I had used, I couldn’t either, I uninstalled unity completely, and tried again, too, failed.
I followed several tutorials on the net, but without success.
I’ll pass the error message:
1-Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
Task :unityLibrary:preBuild UP-TO-DATE
Task :launcher:preBuild UP-TO-DATE
Task :unityLibrary:preReleaseBuild UP-TO-DATE
Task :launcher:preReleaseBuild UP-TO-DATE
Task :unityLibrary:compileReleaseAidl NO-SOURCE
Task :launcher:generateReleaseBuildConfig UP-TO-DATE
Task :launcher:compileReleaseAidl NO-SOURCE
Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
Task :launcher:javaPreCompileRelease UP-TO-DATE
Task :launcher:writeReleaseApplicationId UP-TO-DATE
Task :unityLibrary:mergeReleaseNativeLibs UP-TO-DATE
Task :launcher:analyticsRecordingRelease
Task :launcher:generateReleaseResValues UP-TO-DATE
Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
Task :launcher:extractDeepLinksRelease UP-TO-DATE
Task :launcher:extractProguardFiles UP-TO-DATE
Task :launcher:mergeReleaseJniLibFolders UP-TO-DATE
Task :unityLibrary:stripReleaseDebugSymbols UP-TO-DATE
Task :unityLibrary:copyReleaseJniLibsProjectAndLocalJars UP-TO-DATE
Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
Task :unityLibrary:generateReleaseResValues UP-TO-DATE
Task :unityLibrary:generateReleaseResources UP-TO-DATE
Task :unityLibrary:packageReleaseResources UP-TO-DATE
Task :unityLibrary:parseReleaseLocalResources UP-TO-DATE
Task :launcher:checkReleaseDuplicateClasses UP-TO-DATE
Task :launcher:desugarReleaseFileDependencies UP-TO-DATE
Task :unityLibrary:processReleaseManifest UP-TO-DATE
Task :launcher:mergeExtDexRelease UP-TO-DATE
Task :launcher:mergeReleaseShaders UP-TO-DATE
Task :launcher:compileReleaseShaders NO-SOURCE
Task :launcher:generateReleaseAssets UP-TO-DATE
Task :launcher:processReleaseJavaRes NO-SOURCE
Task :launcher:collectReleaseDependencies UP-TO-DATE
Task :launcher:sdkReleaseDependencyData UP-TO-DATE
Task :launcher:validateSigningRelease UP-TO-DATE
Task :launcher:writeReleaseAppMetadata UP-TO-DATE
Task :launcher:writeReleaseSigningConfigVersions UP-TO-DATE
Task :unityLibrary:generateReleaseRFile UP-TO-DATE
Task :unityLibrary:extractReleaseAnnotations UP-TO-DATE
Task :unityLibrary:javaPreCompileRelease UP-TO-DATE
Task :unityLibrary:compileReleaseJavaWithJavac
Task :unityLibrary:compileReleaseJavaWithJavac FAILED
31 actionable tasks: 2 executed, 29 up-to-date
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
2-Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
D:\Arquivos de Programas\GitHub\Exercicio-Modulo-24\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:164: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
^
symbol: variable TIRAMISU
location: class VERSION_CODES
D:\Arquivos de Programas\GitHub\Exercicio-Modulo-24\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:165: error: cannot find symbol
permissionGranted = mContext.checkCallingOrSelfPermission(Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED;
^
symbol: variable POST_NOTIFICATIONS
location: class permission
Note: D:\Arquivos de Programas\GitHub\Exercicio-Modulo-24\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:unityLibrary:compileReleaseJavaWithJavac’.
Compilation failed; see the compiler error output for details.
-
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 25s
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
3-CommandInvokationFailure: Gradle build failed.
D:\Arquivos de Programas\Unity\Hub\Editor\2022.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath “D:\Arquivos de Programas\Unity\Hub\Editor\2022.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.2.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx4096m” “assembleRelease”
Environment Variables:
USERDOMAIN = PC-CASA
ProgramFiles = C:\Program Files
TMP = C:\Users\Clemi\AppData\Local\Temp
PROCESSOR_ARCHITECTURE = AMD64
PROCESSOR_REVISION = 3f02
OS = Windows_NT
CHROME_CRASHPAD_PIPE_NAME = \.\pipe\crashpad_6864_NGXKPDKABFPOQWQN
PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 63 Stepping 2, GenuineIntel
AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa
USERPROFILE = C:\Users\Clemi
JAVA_HOME = D:\Arquivos de Programas\Unity\Hub\Editor\2022.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
JD2_HOME = D:\Arquivos de Programas\JDownloader 2.0
DriverData = C:\Windows\System32\Drivers\DriverData
ComSpec = C:\Windows\system32\cmd.exe
LAUNCH_DARKLY_CLIENT_TOKEN = 60a7e30fafc7e60e33446283
PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC = C:\Users\Public
SystemRoot = C:\Windows
HEAP_CLIENT_TOKEN = 1717415662
NUMBER_OF_PROCESSORS = 24
WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3
JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
DEBUG_ENV_VAR = UnityHub
ProgramW6432 = C:\Program Files
FPS_BROWSER_APP_PROFILE_STRING = Internet Explorer
TEMP = C:\Users\Clemi\AppData\Local\Temp
Path = C:\Program Files (x86)\Common Files\Oracle\Java\javapath;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;D:\Arquivos de Programas\Git LFS;C:\Users\Clemi\AppData\Local\Microsoft\WindowsApps;C:\Users\Clemi\AppData\Local\GitHubDesktop\bin;C:\Users\Clemi\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Clemi.dotnet\tools
USERNAME = Clemi
COMPUTERNAME = PC-CASA
USERDOMAIN_ROAMINGPROFILE = PC-CASA
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
FPS_BROWSER_USER_PROFILE_STRING = Default
windir = C:\Windows
AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21
CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
APPDATA = C:\Users\Clemi\AppData\Roaming
CommonProgramFiles = C:\Program Files\Common Files
PROCESSOR_LEVEL = 6
CommonProgramW6432 = C:\Program Files\Common Files
ProgramFiles(x86) = C:\Program Files (x86)
SESSIONNAME = Console
GIT_LFS_PATH = D:\Arquivos de Programas\Git LFS
LOGONSERVER = \PC-CASA
LOCALAPPDATA = C:\Users\Clemi\AppData\Local
HOMEPATH = \Users\Clemi
LAUNCH_DARKLY_CLIENT_TOKEN_STAGING = 60a7e30fafc7e60e33446282
HOMEDRIVE = C:
OneDrive = C:\Users\Clemi\OneDrive
ProgramData = C:\ProgramData
ORIGINAL_XDG_CURRENT_DESKTOP = undefined
stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
D:\Arquivos de Programas\GitHub\Exercicio-Modulo-24\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:164: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
^
symbol: variable TIRAMISU
location: class VERSION_CODES
D:\Arquivos de Programas\GitHub\Exercicio-Modulo-24\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:165: error: cannot find symbol
permissionGranted = mContext.checkCallingOrSelfPermission(Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED;
^
symbol: variable POST_NOTIFICATIONS
location: class permission
Note: D:\Arquivos de Programas\GitHub\Exercicio-Modulo-24\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:unityLibrary:compileReleaseJavaWithJavac’.
Compilation failed; see the compiler error output for details.
-
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 25s
]
stdout[
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
Task :unityLibrary:preBuild UP-TO-DATE
Task :launcher:preBuild UP-TO-DATE
Task :unityLibrary:preReleaseBuild UP-TO-DATE
Task :launcher:preReleaseBuild UP-TO-DATE
Task :unityLibrary:compileReleaseAidl NO-SOURCE
Task :launcher:generateReleaseBuildConfig UP-TO-DATE
Task :launcher:compileReleaseAidl NO-SOURCE
Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
Task :launcher:javaPreCompileRelease UP-TO-DATE
Task :launcher:writeReleaseApplicationId UP-TO-DATE
Task :unityLibrary:mergeReleaseNativeLibs UP-TO-DATE
Task :launcher:analyticsRecordingRelease
Task :launcher:generateReleaseResValues UP-TO-DATE
Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
Task :launcher:extractDeepLinksRelease UP-TO-DATE
Task :launcher:extractProguardFiles UP-TO-DATE
Task :launcher:mergeReleaseJniLibFolders UP-TO-DATE
Task :unityLibrary:stripReleaseDebugSymbols UP-TO-DATE
Task :unityLibrary:copyReleaseJniLibsProjectAndLocalJars UP-TO-DATE
Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
Task :unityLibrary:generateReleaseResValues UP-TO-DATE
Task :unityLibrary:generateReleaseResources UP-TO-DATE
Task :unityLibrary:packageReleaseResources UP-TO-DATE
Task :unityLibrary:parseReleaseLocalResources UP-TO-DATE
Task :launcher:checkReleaseDuplicateClasses UP-TO-DATE
Task :launcher:desugarReleaseFileDependencies UP-TO-DATE
Task :unityLibrary:processReleaseManifest UP-TO-DATE
Task :launcher:mergeExtDexRelease UP-TO-DATE
Task :launcher:mergeReleaseShaders UP-TO-DATE
Task :launcher:compileReleaseShaders NO-SOURCE
Task :launcher:generateReleaseAssets UP-TO-DATE
Task :launcher:processReleaseJavaRes NO-SOURCE
Task :launcher:collectReleaseDependencies UP-TO-DATE
Task :launcher:sdkReleaseDependencyData UP-TO-DATE
Task :launcher:validateSigningRelease UP-TO-DATE
Task :launcher:writeReleaseAppMetadata UP-TO-DATE
Task :launcher:writeReleaseSigningConfigVersions UP-TO-DATE
Task :unityLibrary:generateReleaseRFile UP-TO-DATE
Task :unityLibrary:extractReleaseAnnotations UP-TO-DATE
Task :unityLibrary:javaPreCompileRelease UP-TO-DATE
Task :unityLibrary:compileReleaseJavaWithJavac
Task :unityLibrary:compileReleaseJavaWithJavac FAILED
31 actionable tasks: 2 executed, 29 up-to-date
]
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) (at :0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[T] progress, System.String error) (at <b417242467964bd1aa8aad6e355fdf88>: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 :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 :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)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
4-Build completed with a result of ‘Failed’ in 185 seconds (185313 ms)
3 errors
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
cmd cd C:\Unity\2022.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin sdkmanager --licenses all y
– Fester