0

I am getting below error only when I try to merge my branch with the main branch in my project.

The SourceSet 'instrumentTest' is not recognized by the Android Gradle Plugin.

And when I reset my branch to the last commit, it works.

This was happening in Android Studio Version 3.1.2 and it's still there in current version 3.2 also.

This issue has already taken a lot of my time.

I tried to fix it by replacing instrumentTest with androidTest answered here but it's not working for me.

enter image description here

This error leads to the above Unable to resolve dependency errors

Thanks in advance.

shashi2459
  • 581
  • 1
  • 6
  • 15
  • Please provide a [mcve]. This would be the lines from your `build.gradle` file that are failing, plus the complete Gradle output. If these lines are in your `dependencies` closure, and they represent dependencies for instrumented tests, use `androidTestImplementation` to pull them in. – CommonsWare Oct 12 '18 at 11:13

1 Answers1

0

Somehow, I found the answer to this problem.

After reading the errors carefully, I came to know that the problem is there in my lib module. And the error was not actually the one mentioned in Title.

Then I did below changes in the code.

I tried upgrating gradle version from 3.2.0 to 3.3.0-alpha13 and gradle distribution version from 4.6 to 4.10.1 in gradle-wrapper.properties.

Earlier my lib/build.gradle containing only release buildType. So I added same buildTypes which were in app/build.gradle.

Now my lib/build.gradle and app/build.gradle have same buildTypes

lib/build.gradle enter image description here

app/build.gradle enter image description here

And after syncing & building the project, I got rid of these errors(errors from image; Unable to resolve dependency).

Hope this will help someone. Thanks.

shashi2459
  • 581
  • 1
  • 6
  • 15