Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. The 2023.1 beta is now available for testing. To find out what's new, have a look at our 2023.1 feature highlights.
    Dismiss Notice

Bug 2023.1.0a20 Gradle Fail (Android/IL2CCP)

Discussion in '2023.1 Beta' started by flimflamm, Nov 26, 2022.

  1. flimflamm

    flimflamm

    Joined:
    Jan 6, 2020
    Posts:
    43
    I am unable to compile builds for android in Unity 2023.1.0a20. The build fails during compilation and gives me the following errors.
    upload_2022-11-25_23-1-46.png
    upload_2022-11-25_23-2-32.png

    Code (CSharp):
    1. 2023\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity\oculus\OculusUnity.java:32: error: incompatible types: View cannot be converted to UnityPlayer
    2.                     player = (UnityPlayer) vg.getChildAt(i);
    3.                                                         ^
    4. Note: C:\Users\John Smith\Documents\test builds\POTV 2023\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
    5. Note: Recompile with -Xlint:deprecation for details.
    6. 2 errors
    7.  
    8. FAILURE: Build failed with an exception.
    9.  
    10. * What went wrong:
    11. Execution failed for task ':unityLibrary:compileDebugJavaWithJavac'.
    12. > Compilation failed; see the compiler error output for details.
    13.  
    Code (CSharp):
    1. CommandInvokationFailure: Gradle build failed.
    2. C:\Unity Editors\2023.1.0a20\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Unity Editors\2023.1.0a20\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.3.3.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"
    3.  
    4. Environment Variables:
    5. OculusBase = C:\Program Files\Oculus\
    6. USERDOMAIN = DESKTOP-PHES5BL
    7. ProgramFiles = C:\Program Files
    8. TMP = C:\Users\JOHNSM~1\AppData\Local\Temp
    9. PROCESSOR_ARCHITECTURE = AMD64
    10. NVCUDASAMPLES_ROOT = C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.1
    11. PROCESSOR_REVISION = 7100
    12. ALLUSERSPROFILE = C:\ProgramData
    13. OS = Windows_NT
    14. CHROME_CRASHPAD_PIPE_NAME = \\.\pipe\crashpad_6232_XMLLWQSSGBOHQDGR
    15. PROCESSOR_IDENTIFIER = AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD
    16. CUDA_PATH = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vx.x
    17. ProgramW6432 = C:\Program Files
    18. CUDA_PATH_V10_1 = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
    19. USERPROFILE = C:\Users\John Smith
    20. JAVA_HOME = C:\Unity Editors\2023.1.0a20\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
    21. CommonProgramFiles = C:\Program Files\Common Files
    22. DriverData = C:\Windows\System32\Drivers\DriverData
    23. ComSpec = C:\WINDOWS\system32\cmd.exe
    24. PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
    25. ANDROID_NDK_ROOT = C:\Unity Editors\2023.1.0a20\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
    26. SystemRoot = C:\WINDOWS
    27. NUMBER_OF_PROCESSORS = 24
    28. JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
    29. NVCUDASAMPLES10_1_ROOT = C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.1
    30. BURST_ANDROID_MIN_API_LEVEL = 22
    31. FPS_BROWSER_APP_PROFILE_STRING = Internet Explorer
    32. TEMP = C:\Users\JOHNSM~1\AppData\Local\Temp
    33. Path = C:\Program Files\Python37\Scripts\;C:\Program Files\Python37\;C:\Program Files\Oculus\Support\oculus-runtime;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;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:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.4.0\;C:\Program Files\Git LFS;C:\Users\John Smith\AppData\Local\Microsoft\WindowsApps;C:\Users\John Smith\AppData\Local\GitHubDesktop\bin
    34. USERNAME = John Smith
    35. COMPUTERNAME = DESKTOP-PHES5BL
    36. PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW
    37. NVTOOLSEXT_PATH = C:\Program Files\NVIDIA Corporation\NvToolsExt\
    38. SystemDrive = C:
    39. windir = C:\WINDOWS
    40. AMDRMPATH = C:\Program Files\AMD\RyzenMaster\
    41. FPS_BROWSER_USER_PROFILE_STRING = Default
    42. HOMEPATH = \Users\John Smith
    43. PUBLIC = C:\Users\Public
    44. CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
    45. APPDATA = C:\Users\John Smith\AppData\Roaming
    46. OneDrive = C:\Users\John Smith\OneDrive
    47. PROCESSOR_LEVEL = 23
    48. CommonProgramW6432 = C:\Program Files\Common Files
    49. ProgramFiles(x86) = C:\Program Files (x86)
    50. SESSIONNAME = Console
    51. GIT_LFS_PATH = C:\Program Files\Git LFS
    52. LOGONSERVER = \\DESKTOP-PHES5BL
    53. LOCALAPPDATA = C:\Users\John Smith\AppData\Local
    54. HOMEDRIVE = C:
    55. USERDOMAIN_ROAMINGPROFILE = DESKTOP-PHES5BL
    56. ProgramData = C:\ProgramData
    57. ORIGINAL_XDG_CURRENT_DESKTOP = undefined
    58.  
    59.  
    60. stderr[
    61. Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    62. C:\Users\John Smith\Documents\test builds\POTV 2023\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity\oculus\OculusUnity.java:31: error: incompatible types: View cannot be converted to UnityPlayer
    63.                 if (vg.getChildAt(i) instanceof UnityPlayer) {
    64.                                  ^
    65. C:\Users\John Smith\Documents\test builds\POTV 2023\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity\oculus\OculusUnity.java:32: error: incompatible types: View cannot be converted to UnityPlayer
    66.                     player = (UnityPlayer) vg.getChildAt(i);
    67.                                                         ^
    68. Note: C:\Users\John Smith\Documents\test builds\POTV 2023\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
    69. Note: Recompile with -Xlint:deprecation for details.
    70. 2 errors
    71.  
    72. FAILURE: Build failed with an exception.
    73.  
    74. * What went wrong:
    75. Execution failed for task ':unityLibrary:compileDebugJavaWithJavac'.
    76. > Compilation failed; see the compiler error output for details.
     

    Attached Files:

  2. flimflamm

    flimflamm

    Joined:
    Jan 6, 2020
    Posts:
    43
    Looks like updating my Oculus package managed to fix the issue. It's also possible that renaming a specific file helped, just in case anyone encounters the same issue:

    C:\Unity Editors\2023.1.0a20\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\32.0.0\lib\d8.jar renamed to "dx.jar"...
     
    assertor likes this.