Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Having a ton of issues setting up Android SDK and building an .apk file

Discussion in 'Editor & General Support' started by Tyrannastrasz, Mar 30, 2020.

  1. Tyrannastrasz

    Tyrannastrasz

    Joined:
    May 8, 2017
    Posts:
    8
    Hello my fellow Unity developers,

    I'm sure there were a ton of posts about this very issue, I ran into several myself in recent days when I googled the hell out of the problems I'm having but none of them proved to be of much help to me. I generally try not to hassle people on the forums before I try everything else, so this is pretty much a last resort. Following is a detailed rundown of what I did and the issues that I ran into:

    I've been trying to make a simple AR app for android, and for whatever reason I decided to update my Unity to the latest version. So I use UnityHub to download it, I also install support modules for Android, Windows and everything else I mean to use in the future. Now, the first problems started when I tried building the .apk file using the integrated sdk/jdk that came with the latest Unity release. Namely, there was a long error text that amounted to around 60-70+ error messages in the console. What it boiled down to was that Daemon-something wouldn't run or build or whatever (I'm sorry, I'm not a master at this and I was using Unity 2018.3 before the update - googling the issue I found out other people identified that Gradle was causing issues with 2019 version of Unity). I tried downloading separate SDK/JDK/Gradle packages, still to no avail. Couple of days later I decided to throw in the towel and just downgrade back to Unity 2018.4 (one build higher from what I was using before all this mind you). This was a circus in its own right. I tried downloading different SDKs over multiple attempts to build, removing ones that didn't work and replacing them with others. Initially I used Android Studio, downloaded multiple android platforms, downloaded NDK r16b manually (which Unity itself suggested being the only version it supports), and downloaded the tools which are marked as obsolete in the Studio's SDK manager. Trying to build my .apk file this way basically amounted to my windows throwing an error saying "adb.exe was unable to start correctly" whenever I entered build settings in Unity. The accompanying error in the console log said "CommandWithNoStdoutInvokationFailure: Unable to start ADB server. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details." I even tried manually downloading the SDK using console tools and even there something goes wrong and none of the commands work in the command prompt.

    I'm at my wit's end here, growing desperate because I'm on a tight timeline and fixing this is crucial. If there's anyone who can suggest the exact Android SDK/NDK tools that I need to download that Unity 2018.4 would support, and where I could find them, I would be immensely grateful to you!
     
  2. Tyrannastrasz

    Tyrannastrasz

    Joined:
    May 8, 2017
    Posts:
    8
    Thanks for the response.
    I might try to retrace your steps, if nothing else at least it will allow me to test whether or not the problem is with my PC specifically, because I've been toying around with the idea of reinstalling my OS because I don't think windows should be throwing errors when I try to build anything in Unity... not to mention sdkmanager command tools refusing to install (or pretty much do anything other than set the root folder for SDK - which is in itself pointless since I can't install it).
    For reference I have the latest jdk installed (1.8.241) which I don't think is what's causing issues even though my Unity is 2018.4 because Unity complains about the tiniest details when it comes to version mismatches, yet it doesn't complain about my current jdk at all.

    If anyone else has any pointers as to what I can try to fix these errors, please speak up.

    Also, not to be negative or throw shade on the issue or anything, just keeping it real - I doubt it will ever get any simpler. Google owns the Android platform, they're pushing their own IDE (Android Studio) really hard, and they don't seem to care about other IDEs such as Unity. They have no qualms over ditching support for older builds which they consider to be deprecated but might still be a necessity for some game engines.