How can i change the order of android lib . It should take my loca lib first then android libs

i build android app which is working fine with eclipse build also with maven build .

Now when i have tried the same code for gradle build through android studio I have issue.

When i am using the build type as gradle i am getting compilation error due to lib. The local lib in not including .

i am using " apply plugin: ‘android-library’ " plugin

apply plugin: ‘android-library’

dependencies { compile fileTree(dir: ‘libs’, include: ‘*.jar’) }

the problem is Android lib include first then Lib “A” (local)

it will fix if Lib A (local) include first then Android lib

the compiler should take missing function definition from Lib A (local) then android-library . I mean the local lib should overwrite the dependency of Android lib .

How can i overwrite android plugin changes with my local lib

can you guide how to change the order ? Where it should pick my local lib then it should pick android dependency libs .

Can you explain why exactly you need a particular order? At least in the non-Android Java world, it is generally recommended to avoid reliance on any particular order. Also, can you elaborate on how you achieved this in the Maven build?