This is the full error-
Error:Execution failed for task ':app:preDebugAndroidTestBuild'.
> Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.
I know that there are a lot of solutions to this type of answers but I am an absolute beginner in android studio and I couldnt understand those solutions like the command line interface interacting with gradle and so on...
I was looking for a simple solution to this problem if there is. Thanks a lot!
Use
implementation 'com.android.support:appcompat-v7:27.1.1'
instead of
implementation 'com.android.support:appcompat-v7:26.1.1'
and change compileSdkVersion 26 to 27
This is the type of bug that really makes me resent Android Studio.
But anyway, the solution for me was quite simple: Edit the
app.iml
and change thecom.android.support:support-annotations
version. In this case it's easy to find, simplyctrl+F
and type "27.1.1" (it should be the only hit) and change to your version "26.1.0".In other words, change it from
to
Afterwards, rebuild the project. (simply rebuilding it wasn't working for me until i edited the
app.iml
)Use latest stable version of support library
Track here latest versions https://mvnrepository.com/artifact/com.android.support
As of 28-9-2018 latest version is
28.0.0
.