Wednesday, March 1, 2023

Create AAR by command line




How To Pack Resources Into Single AAR file

Overview

If you use Gradle build system to assemble your Unity Android application, you can not simply put the Android resources to Assets/Plugins/res/... You have to put all your resources into a single .aar file and link it to your project.

Tutorial

  1. Create an empty directory and go inside it.
  2. Create file AndroidManifest.xml inside directory with following content:

    <manifest package="im.getsocial.sdk.resources">
    </manifest>
    
  3. Create directory res. Inside it create directory drawable.

  4. Put all the image resources to the res/drawable.
  5. Go back to the directory where AndroidManifest.xml is placed. Example structure of your directory:

    ├─── AndroidManifest.xml
    └─── res
        └─── drawable
            ├─── my_drawable.png
            └─── my_drawable1.png
    
  6. Run the jar cvf getsocial_resources.aar -C . . inside directory.


 https://docs.getsocial.im/knowledge-base/pack-resources-to-aar/

No comments:

Post a Comment