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. Dismiss Notice

Bug Android builds in Unity just randomly break with Gradle errors

Discussion in 'Android' started by zezba9000, Sep 28, 2023.

  1. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    983
    I've tried uninstalling, all Unity installs, Android Studio, custom android SDK, deleting all gradle folders before re-install every Android thing on my system, etc. Nothing works. For all I know Unity has some broken reg setting and only re-installing Windows is going to fix it at this point.

    Unity, seriously... I have had these kinds of issues with Unity + Android just rando breaking for about 5 years now at least.
    Its driving me up a wall at this point & something is clearly fundamentally broken in Unitys code here.

    Just gut your entire Android build system and replace it with something that actually works at this point.
    * Only support Android Studio builds like xCode for Apple
    * Don't actually invoke gradle from Unity, just produce what Android Studio needs for use to make builds with Google tools
    * Don't ship compiled .jar files with specific Java runtime version dependencies (just copy the .java files over to Android Studio proj to compile)
    * Require AndroidManifest.xml files to be maintained by us and stop auto managing permissions (focus on examples and good presets)
    * Keep it simple and get rid of the automation that is endlessly breaking Android build systems

    Does someone have a solution that doesn't involve me re-installing Windows to fix this?
    Unity 2021.3.18
    Windows 11


    upload_2023-9-28_3-56-59.png
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,659
    you're showing only an error title, thus it's not clear what's exactly wrong, could you attach Editor.log?
     
  3. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    983
    Here is the editors log

     
  4. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    983
    So this error makes no sense. I just tried again after a cold boot today.
    The only thing that could be locking that file is Unity itself. If I quit Unity I can delete the cashes folder (so Unity is the thing locking it). And I've been making builds with this version of Unity since Feb when it came out. Nothing in the project in terms of plugins, packages etc has changed. This is a maintenance build for an already published product.

    I've had similar rando Android stops building on just about every Unity version I've ever used with lots of different projects. Whatever is causing this needs to be fixed as its a long standing issue. Sometimes upgrading Unity version will fix the issue BUT I can't do that with this project.

    I'm also lead to believe after running into this for so many years that newer Unity installs are breaking older ones. For example my Android Studios install was broken after I installed Unity 2023.1.14. Are you guys running Android installer scripts that break system paths? If so thats very bad & not maintainable.

     
  5. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    I concur with your detailed explanation. You have gone farther than I have. I have stopped for the 3 years pushing to Android and headsets after solving a community gradle problem. It then proceeded to break again. Yes, I am out of the business. Your descriptions on how to untangle the systems would work instead of each system area in a trilateral death grip. Unity's buffoonery has also caused assets to fail thereby driving those devs to cliff diving.
     
    Last edited: Sep 29, 2023
  6. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    And let me add: Protect the stability of the assets, the devs, and the public created projects which over the last 5 years you, Unity have not done. So this thread simply points out you, Unity should be a script generator for what the devs want not what you want. I have kept a lot of error / gradle / failure emails that frankly One should see this many and they ever growing. Can you just put your big pants and tell the truth that you are collapsing Unity in a grave? If management has other plans to slowly strangle the whole thing what purpose does it serve? Its pure idiotic, evil intent. You had the 3d graphics world by the conejoes for good and yet your customers and community are now twisted in pain. Take a step back and do the right thing.
    You call yourself Unity but that is not whats happening.
    I stated 3 years ago that you, Unity better straighten up or your competition is going to eat your lunch.
    https://slashdot.org/story/419515
    Oh wait, the top dog just cash his checks and left the rest of the pack to rot it out.
    These sociopaths destroy lives for fun and profit.
     
  7. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,659
    Not to my knowledge, we don't run Android installer scripts, I don't think I know what that is even.

    In any case, the error says, there are two gradle daemon running. Unity is using gradle under the hood to build android application, so is Android Studio. Wondering maybe you have both Unity and Android Studio opened, and they're both building ?
     
  8. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    983
    No I don't have Android Studio running. And I can make Android builds with Unity 2023.1.14
    Something in Unity is breaking this. Its a long standing issue.

    I can try uninstalling Android Studio but even if that fixed it that in and of itself is an issue. Unity needs to be targeting Android Studio at this point for an array of reasons.
     
  9. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,659
    What do you mean? Unity is not using Android Studio in any way, but it's possible for both Unity and Android Studio to use the gradle daemon which might be the cause of conflict, though I haven't seen this myself.