I have implemented project by using third party library(zxing) after implementation project is working fine then after I have written one test project to unit test my projec
If you do not specifically need a device with low API version (<=19), you can leave transitive dependencies and create an emulator with higher API version.
This happens only on devices which API is lower than Lollipop (API 21). Running tests on emulators higher/equal to API 21 runs normally, without issues.