Why is it so complicated to create an APK for Android using Unity?
Hello. I'm new to development and have been having the dreaded "Gradle build failed" issue when trying to build an APK for Android (using Unity 2018.3.5f1 for mac). I have looked at various solutions which suggest everything from downgrading the JDK to version 8 to replacing the "tools" folder with the versions from 2009 or later. All of which seem to have varying degrees of success across all users. I have had no success at all and am still stuck with the gradle issue. I guess my question is: what actually is it that complicates this process when building for Android? If there is some way that it could be explained in lay man's terms why this causes difficulty that would be great. It doesn't seem right that using the Android Studio tools from a 10 year old build should work (or be necessary!). It also doesn't seem right that the latest JDK version isn't the one that would work with the latest Unity version. I find it hard to believe that Unity would deliberately create a product that would make all Android devs jump through these hoops. What am I missing here?
So it looks like this sort of thing has been addressed in the 2019.1 beta. I am yet to try it but this is the link to the features article https://blogs.unity3d.com/2019/01/31/unity-2019-1-beta-is-now-available/ Or you can read it below:
Android SD$$anonymous$$ and ND$$anonymous$$ installed with Unity Hub The Hub now provides the option to install all the required components for Android as part of the “Android Build Support” option, so you’re sure to get the correct dependencies and don’t have to gather and install anything else. If you’re an advanced Android user, you can still install and configure components manually and use Android Studio. Also, note that starting with 2018.3, “Android Build Support” comes with its own Java Runtime based on OpenJD$$anonymous$$.
Answer by nati8oy · Feb 16, 2019 at 08:28 AM
Thanks for responding. Not sure I understand what you mean regarding P2P..? Could you elaborate a little on that point? I'm not even clear on exactly what P2P means in this context. I am just kind of confused as to why Unity would allow people to use the latest version of their software when it isn't straight forward to publish an APK. Surely this would affect a large section of its user base.
@nati8oy will be removing my "answer" but here you go what i was talking about:
https://support.unity3d.com/hc/en-us/articles/360001252086-UNet-Deprecation-FAQ
Your answer
Follow this Question
Related Questions
Android app not compliant with google play 64 bit requirements despite following the instructions 1 Answer
Builds Apk Error/ Unity 2019.3.15 0 Answers
Building Android Project stuck on " Task generateReleaseResources" 1 Answer
CommandInvokationFailure: Failed to build apk. 0 Answers
Unable to generate 64 bit android apk for Unity project 0 Answers