Programming | Android | Tips N Tricks

Post Page Advertisement [Top]

"Error:Execution failed for task ':app:preDebugAndroidTestBuild'"

Hey there!
When you are using Android Studio 3.0.1 or previous version of Android Studio with already downloaded SDK. I don't know the exact reason but i observed that this type of error comes from SDK Conflict with dependency problem.

Full Error Details :
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.
Solution 1:
Step 1: Open Gradle Scripts -> build.gradle(Module: app)  file
Step 2: Comment those two lines and Rebuild project
androidTestImplementation 'com.android.support.test:runner:1.0.2' 
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Error Solve!.




Solution 2:
Step 1: Open Gradle Scripts -> build.gradle(Module: app)  file
Step 2: Add This Line and Rebuild the project.
implementation 'com.android.support:support-annotations:27.1.1'
Error Solved!


If you just rebuild the project this dependency conflict error will resolve but when you create new activity again it will fail to build the project and you have to rebuild the project again. Because of this problem you have to build your project manually every time you create new project. If your system is slow as mine then your time will be consumed in rebuilding project again and again instead of developing new things for your app.

So there is simple solution for this kind of error. i am using Android Studio 3.0.1 and i have full updated sdk from my developer friend. I face same error every time i create new project. I have used and tested this two solution and they worked well for me and i hope it will work for you also and you will increase your app development speed. You have to solve this error only one time in the beginning of your project and then this error will never encounter again.

Thanks for reading i hope this trick will solve your error
> Conflict with dependency 'com.android.support:support-annotations' in project ':app'. 
If you have any query regarding any topic android development and web application you can ask me in the comment.

Have a great day and enjoy Coding.😃


No comments:

Post a Comment

Comments

Bottom Ad [Post Page]

| Designed by Colorlib