11

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?

Malachi
  • 161
  • 1
  • 7

1 Answers1

4

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).

Clay Fowler
  • 2,059
  • 13
  • 15
  • 1
    Hey @Clay Fowler, Any idea why an `*.aar` file would show up with a blank inspector window? See screenshot: http://i.imgur.com/vp65iZx.png. (This is a custom AAR file I made, so maybe it's not the proper format / SDK or correctly compiled to be usable in Unity?) – chamberlainpi Nov 30 '16 at 21:01
  • 1
    I would suspect so. Try some other popular AAR, like one of the standard ones from the SDK, and put in the same place in your /Assets folder and see if IT shows up in the inspector like it should. If so, then the name or structure of yours is bad. If not, you have more of a global problem with this particular version of the editor or your project. You can then go from there. – Clay Fowler Dec 01 '16 at 18:47
  • @bigp I had this issue due to symlinking a path to the AAR files, once I made it a real path I could add them as a target for android. – Pellet Feb 13 '17 at 06:51
  • Please tell where did you make a real path. Any pointer referenced will be helpful. – Siddharth-Verma Jun 17 '17 at 07:35