How to import AAR file as Native Function API for Android

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

When you import a 3rd party SDK the only choice is zip. I copied the AAR file to the customlibs android folder but do not see it when I try to Add. How do you import an SDK that is in the AAR format?

@Lvuwen Jvckson​

Answer is available here https://basecamp.kony.com/s/question/0D56A00000deXY9SAM/android-ffi-with-its-own-dependency

Whenever you would like to use AAR using NFI approach. You can just have the AAR in resources --> customlibs --> lib --> android folder. Access all it's classes and methods in JS module without any issues during runtime the mapping will take care of it.

Eg: MyAdapter.java // in AAR class

public class MyAdapter {

public static void showToast() {

//Toast.makeText(KonyMain.getActivityContext(),"Clicked meeee..........!",Toast.LENGTH_LONG).show();

}

JS code:

var myAdapter = java.import('yourpackage.MyAdapter');

myAdapter.showToast();

This will have no issues.

In case if you are looking out component. Do revert.

Thanks,

If your AAR is having third party dependencies. Do add them in below mentioned location:

project settings --> native --> android --> gradle Entries.(If you are Viz version is 7.3 and above).

Eg: dependencies.implementation'com.android.support.constraint:constraint-layout:1.1.2'

Thanks,

Don't miss @Felicity Bviley​'s August 28 webinar "FFI Code Level Walk-through Workshop". He will cover this topic. Click this link to register.

https://basecamp.kony.com/s/article-detail/a046A00000CgDzpQAF/webinar-ffi-code-level-walkthrough-workshop