Getting the below error at the time of running java program in android studio.
Error:Execution failed for task \':app:preDebugAndroidTestBuild\'.
<
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.
This is due to there is no dependency added to your App build.gradle or might be its an old version. So, add a dependency for annotation support.
implementation 'com.android.support:support-annotations:27.1.1'
Here I have added annotation version 27.1.1 to solve your error if this is mismatched with different version then change it to the required version.