Unity3D and AAR

Malachi picture Malachi · May 7, 2014 · Viewed 8.8k times · Source

Has anyone found a good way to utilize Android .aar libraries within Unity3D, other than unzipping them?

Snippets from the Unity 4.2 Release Notes:

  • Android: Added support for Android Library Projects (no compilation support, so the libraries have to be pre-compiled).
  • Android: Remove Eclipse project support in favor of Android project support.
  • Android: Support for Android SDK rev22.

The Unity documentation clarifies

Pre-compiled means all .java files must have been compiled into jar files located in either the bin/ or the libs/ folder of the project.

I'm familiar with using the jar + res/ solution; but I am specifically trying to identify the best way of incorporating the precompiled aar. Is there something better than unzipping it?

Answer

Clay Fowler picture Clay Fowler · Sep 8, 2015

With Unity 5, just place .aar files in the project. (They don't even need to be in /Plugins/Android anymore, just check the inspector and make sure they are turned on for Android platform).