I had this problem too, and it took me a while to resolve, but I finally understood. ROOM uses some support libraries-v4, so you get an error that there are duplicate entries in zip. In my situation, ROOM uses components from an earlier version than what I need. So, what worked for me ( found here ) adds the following to the root level of the Gradle file:
configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
What I found is that it forbids libraries to include any support components-v4, but then you need to manually enable the necessary components for ROOM and all that you may need. If you need to determine exactly which libraries are duplicated, you can follow these instructions to view each library and its dependencies.
A bit unrelated note: Starting with Gradle 3.0 using the compile configuration is deprecated and needs to be replaced with implementation or api , you can find a nice explanation here .
source share