Search code examples
androidandroid-studiounity-game-enginebuild

An alternative way for building a Unity project for Android


For the last few days, I have been trying to build a testing project for android using the default build method but I just keep recieving errors and not knowing how to fix them.
Short Error and Full Error Decscription. Also I am using Unity 5.6.7f1 with Admob plugins (And yes because my pc is shit so I use this version)

So I want to ask is there an alternative way for building an android app with Unity. I have heard about exporting the project to gradle and building it using Android Studio. But I don't know how.
If you know an alternative way or how to build the project with Android Studio or how to fix the error PLEASE ANSWER. I am having a nightmare with building this stupid test project to Android


Solution

  • The problem is your jdk(1.8.0_311) is too new to support legacy build command from Unity (5.6.7f1).

    Two method to solve:

    • Install older jdk

      if you don't know which version you should use. You may use the default jdk with Unity installer in preferences. (I'm not sure 5.6.7f1 is supported).

    default JDK

    • Export android project

      You can export android project by check the "Export Project". Then use android studio to build apk.

    enter image description here