After upgrading to Android Studio 3.1, I started to get following error during build. Project uses multidex and DX is enabled by default as you would notice in the error. I
Adding the below line in the build.gradle of the app level worked for me
implementation 'com.android.support:support-v4:28.0.0'