Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

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.
  3. Kinggrass

    Kinggrass

    Joined:
    Jun 7, 2016
    Posts:
    75
    Hi @flimflamm,
    how did you managed to get it work.
    I have the same issue in 2023.1.0b1. Did you have done anything else?
    I freshly installed the Oculus Package and also renamed the file.
     
  4. JonBaldock

    JonBaldock

    Joined:
    May 26, 2020
    Posts:
    3
    This Unity Gradle issues go back 6 years, so how long before Unity fixes it or at least provides an answer that actually works? Unreal and other Game Design Platforms are raking in new customers because of this.
     
  5. JonBaldock

    JonBaldock

    Joined:
    May 26, 2020
    Posts:
    3
    Unity's Gradle issue is 6 years old now. This shouldn't even be an issue if Unity would actually do something to fix this after this time.
    Just giving business to Unreal, Godot, etc.
     
  6. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,956
    This is related to this breaking change https://unity.com/releases/editor/alpha/2023.1.0a21

    Code (CSharp):
    1. Android: Modified FrameLayout so you can call getFrameLayout function on UnityPlayer instance if you need access to frame layout. UnityPlayer/UnityPlayerForActivityOrService no longer derives from FrameLayout.
    I think Oculus newest package version should have fixed this issue.