How to generate aar file from Ionic Project?

I want to build a UI components using Ionic framework and that will be bundled as a aar file and used it to Android native project.

How can i add a Ionic project as a dependencies in a build.gradle?

Use cordova to convert your ionic project to aar first :
cordova build platform android

then add as the module as a dependency in build.gradle.
Finally change from CordovaActvity to class Activity using code here:

You will be able to invoke Ionic pages.
Hope that helps…