Search Unity

Bug Unity LTS: Error message when creating .apk file

Discussion in 'Editor & General Support' started by Unity-Student0, Jul 24, 2022.

  1. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,930
    You've posted a tiny potion of what is probably one of a few build errors you're getting. Post all the errors and in their full form.
     
  3. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    See screenshot.
     

    Attached Files:

  4. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,930
    So the real error is that your gradle file is missing. Perhaps you should investigate solutions for that.
     
  5. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    I've checked the internet. Apparently, you did not make a proper investigation before you replied. See these. It's not solved yet.

    https://answers.unity.com/questions/1910877/you-are-missing-the-recommended-gradle-install-the.html
    https://forum.unity.com/threads/you...ommended-version-using-the-unity-hub.1150499/

    I have reinstalled everything and nothing works. I have also erased all system unity files from my computer and nothing works. Give me the solution or check with the unity team if you can.
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Android build not building:

    Recently (circa July 2022) there have been reports of Unity's installer failing to install the Android Tools.

    https://forum.unity.com/threads/cant-build-for-android.1306098/

    If it's not that, then here's how to troubleshoot:

    First, make a blank project with a single blank scene and prove that it builds successfully.

    If it does NOT build, then go fix your Unity installation, or your other tools, such as Android SDK, NDK, JDK, etc.

    Until you can build a blank project to the target platform, don't fiddle with anything else.

    Once you can build a blank project, now bisect the problem by bringing over parts of your current project and building it one subsystem at a time, perhaps stubbing things out that might trigger compiler errors.

    Most often things that prevent building are third-party libraries such as Firebase.

    Once you identify the subsystem, go to the documentation for it and make sure you are doing it correctly.

    It may also be helpful to work through a tutorial or two for that subsystem.
     
  7. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,930
    If you want people to help you, you should can this attitude, mate. I was just making a suggestion that might've lead you into the right direction, as I've never built for android.
     
    dgoyette and Kurt-Dekker like this.
  8. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    After playing around with the removal and installations, I found that nothing works. I decided to install an older version to check. To my surprise, it did work. For everyone else's information the silly "repositories.cfg could not be loaded." will remain but the next status will say that build is successful. Perhaps the solutions given earlier did work at an earlier time for others, but in my case, nothing did. This should be feedback to others that this specific Unity LTS has a problem. I managed to not only repair my current and previous projects, but build the apk and managed to get it working on my phone. Now I'm wondering what the Unity team has found and why this kind of problem suddenly exist. Whatever it is, i can continue with my projects in peace. Apologies to @spiney199 as I thought you know Android. However, you should still try to check the internet whenever possible so you know this problem is not as easy as you think. And if you don't know, just put a note that you don't use android. You don't know that people like me sometimes depend on your solutions to seriously save time.

    While I felt I spent too much time solving this one problem (doesn't matter big or small), this should help others realize that internet solutions don't always work despite the version being recent. I'm shocked about this.

    Note: I actually thought that my problem was caused by change of drive / device during installation and I was ultimately proven wrong in all aspects.
     
  9. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    First time on the internet?

    Did you see the note I posted about the Android Tools not being installed on certain versions?
     
  10. Unity-Student0

    Unity-Student0

    Joined:
    Aug 10, 2020
    Posts:
    263
    Your reply is very insulting. I saw the note AND thought that internet solutions can work. Anything wrong with that?