Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Read aar file as a library

Discussion in 'Editor & General Support' started by Chongzey, Jun 24, 2015.

  1. Chongzey

    Chongzey

    Joined:
    Jan 29, 2013
    Posts:
    2
    I am trying to use a SDK which is a aar file, how could I use it in Unity 5, how to use the function inside the lib ?

    Thanks
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    In Unity 5 you can add an .aar file to your project and it will be treated as a library (added to the game, manifest merged, etc).

    Regarding on how to call specific methods inside the library, you can refer to this documentation page: http://docs.unity3d.com/Manual/PluginsForAndroid.html

    Specifically, check out the examples under "Using Your Java Plugin with helper classes"
     
  3. pweeks

    pweeks

    Joined:
    Mar 29, 2011
    Posts:
    104
    how do we get unity to add aar support to 4.x ? it would seem that it shouldnt be too much work if its already been done for 5.x
     
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    i dont think you can get it to work on 4.x
     
  5. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
    I am trying the same but not able to find the class is there. I think it is not able to find the classes.jar file
     
  6. habilal

    habilal

    Joined:
    Apr 22, 2016
    Posts:
    2
    Hi I am using unity 5.3.0f4 version. I create a AAR file of CustomLibrary project. In this project i also used resources + layouts. I placed aar file in different location for example root, Assest/plugin/Android and other combination.

    I faced an issue, when i build & run my project on device this error occurs
    the error is: error: No resource identifier found for attribute 'fabSize' in package
    Also i add the native dependencies libraries, like native android design , appcompact libary.


    Kindly help me out. Thanks in Advane