Things to consider when upgrading gradle in legacy android projects

Hi Devs,

I am stuck in some serious issue of upgrading gradle system of a legacy android application when I tried to upgrade to Firebase from Google Analytics.
Earlier gradle version was 2.0.1 and Android studio version was 3.0.1
Now I have upgraded to gradle 3.4.1 and Android Studio to 3.4.1

I am able to run application on my device wheb running from android studio.
However when I am trying to build application from terminal using ./gradlew clean build , I am Application is getting stuck while executing lint command .
Copying resources from program jar [/home/project_name/build/intermediates/transforms/mergeJavaRes/unmanaged/release/0.jar] (filtered)

This was the last log entered in terminal.

Any help will be much appritiated.