How to Fix Android Studio Error Conflict with dependency

Fix Error:Execution failed for task ‘:app:preDebugAndroidTestBuild’.
> Conflict with dependency ‘’ in project ‘:app’. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See for details.


This error appeared when i was trying to build a new app project in the android studio in a fresh start, i mean the app is a new project, no codes were written, no libraries were added, still this error appeared and it was easy to fix by removing some test libraries in the build.gradle ( i am not sure if this will cause any new error when building and deploying the project in future, but for now, after removing the 2 libraries, the gradle build was successful.


The libraries i removed were these:

androidTestImplementation ''
androidTestImplementation ''

build error android version conflict
The build error screenshot

The successful build after removing these 2 libraries

build success android studio screenshot
removed the 2, so build is successful

Leave a Reply

Your email address will not be published.