Search Unity

Build suddenly started failing

Discussion in 'Android' started by fluks, Aug 20, 2021.

  1. fluks

    fluks

    Joined:
    Aug 10, 2021
    Posts:
    7
    I'm sorry, I couldn't come up with a better title. I have no idea why build started to fail because I didn't change anything, at least I didn't notice. Maybe I could have accidentally changed Player settings. Here are the errors. Sorry about the wall of text.

    If you don't know from the errors which might be the case, can I easily backup Player or build settings by copying a file or directory?

     
  2. fluks

    fluks

    Joined:
    Aug 10, 2021
    Posts:
    7
    Compiling a Linux binary is successful btw.
     
  3. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    Do you use a custom Android SDK (specified in editor's preferences -> external tools). The error that you get seems to be an incompatibility between openjdk-1.8 (used in Unity by default) and some of Android SDK components. Using the Android SDK version installed by the Unity Hub should solve this particular issue.
     
    Jihaysse likes this.
  4. fluks

    fluks

    Joined:
    Aug 10, 2021
    Posts:
    7
    I ended up upgrading Unity and after it, I was able to compile an Android binary.
     
  5. fluks

    fluks

    Joined:
    Aug 10, 2021
    Posts:
    7
    I already upgraded Unity version but I think I used the version that came with Unity.
     
  6. Virilic

    Virilic

    Joined:
    May 3, 2021
    Posts:
    4
    I'm running into the same issue. I've upgraded from 2019.4.17f to 2020.3.18f. I haven't been able to build since I started to target Android API 31.
     
  7. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
  8. Virilic

    Virilic

    Joined:
    May 3, 2021
    Posts:
    4
    Hi @JuliusM, it does not appear to be the same issue. I currently use the Gradle version installed with Unity, which is 6.1.1.
     
  9. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    Yes, that issue discussed in the linked thread is about Android SDK component versions, not about the custom Gradle version. To rephrase that thread, if you have updated your Android SDK build-tools to version 31, then the build will fail with default Gradle versions included in Unity 2020LTS and newer versions.
    If that is not your issue, please post the specific error messages you get when the build fails.