Setup Unity Android Build Tools - xrchisense/xrevent-broadcaster-unity GitHub Wiki

Abstract

This tutorial documents how to setup your Unity in a way to be able to code your java plugin directly in the Unity IDE. Unity can compile your .java classes directly from the Assets folder. Just drop your .java files in a subfolder e.g. Assets/Java and Unity will find them and hand them over to Gradle the Build Tool used to create the Android Unity Player (Anrdoid App) for Android phones, Quest, Quest 2.

Prerequisites

  • Unity 2020.3.22f1

Setting up Unity

  1. Create URP Project in Unity Hub.
  2. Switch Build Platform to Android.
  3. Change Player Settings:
  • Color Space: Linear
  • Remove all Graphics APIs except 'OpenGLES3'.
  • Set 'Minimum API Level' to 25
  • Set Scripting Backend to IL2CPP.
  1. Add 'Android Logcat' Package from the Unity Package Reristry using the Package Manager from Unity.
  2. Our Broadcaster Plugin is using the GeckoView Library Project. To make the binaries (.class) files in the Android archive (.aar) available, put them under 'Assets/Plugins/Android'.