Use Android plugin with android support library dependency with gradle builds in Unity 5.5

I have an Android plugin which depends in certain android support libraries like
design-v7, appcompat-v7, support-v4 etc.

I am using “.aar” files for the dependent android support libraries and my Android plugin uses resources such as layouts, images, styles from these libraries.

When i build the app via gradle option in Unity 5.5, the build fails with errors like :
\Temp\StagingArea\gradleOut\design-23.4.0\build\intermediates\bundles\release\res\values\values.xml:65: AAPT: Error retrieving parent for item: No resource found that matches the given name ‘Animation.AppCompat.Dialog’.

Is there a way i can tell the gradle build system what my android plugin’s dependencies are?
Can i add my own build.gradle file for my android plugin specifying the dependencies i need?

Any help is really appreciated.
Thanks!

Starting with Unity 5.5.1p1, you can have a custom gradle build file in your project. This can be done by adding the gradle file under Assets/Plugins/Android/mainTemplate.gradle.

For earlier Unity versions, the only option is to override the default gradle build file that is shipped under the Unity installation folder (not recommended).