android studio was getting build error while build execution with following:
Error:Execution failed for task \':app:transformDexArchiveWithExternalLi
For me, the problem was the use of Java 1.8 in a module, but not in the app module. I added this to the app build gradle and worked:
android{ compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }