I have encountered this problem in my androidstudio application.I've checked my build.gradle and I don't have the maxSnapshotsForTestFailures added.I've searched the entire application and I haven't added what the compiler says I have.

1

There are 1 best solutions below

0
On

Please check into your build.gradle file, probably you are using moduleData.id instead of moduleData.getGradlePath().

in fact there is an issue reported to Google:

Instrumented tests fail with "Project 'X' not found in root project 'X'."

    private fun getTaskNames(androidModuleModel: GradleAndroidModel): List<String> {
        return listOf(
          //"${moduleData.id}:connected${androidModuleModel.selectedVariantName.usLocaleCapitalize()}AndroidTest"
"${moduleData.getGradlePath()}:connected${androidModuleModel.selectedVariantName.usLocaleCapita
lize()}AndroidTest"
        )
      }