1

My project contains two modules. Main App module and SDK module. I have following lines of code in Build.gradle file of App module.

dependencies {
    releaseCompile project(path : ':Sdk', configuration : 'prodRelease')
    debugCompile project(path : ':Sdk', configuration : 'prodDebug')
    testCompile project(path : ':Sdk', configuration : 'mockDebug')
...    
}

Therefore, the Sdk must be visible to the whole of my App module. I have no problem in my project which is under main folder. However, I'm trying to write Espresso test cases in order to test my activity and I need to create a model. The model resides somewhere in Sdk module. I thought this module must be visible to androidTest class too but seems does not. Even I wrote import address manually but it still does not recognizable.

enter image description here

halfer
  • 19,471
  • 17
  • 87
  • 173
Hesam
  • 49,622
  • 70
  • 212
  • 354

1 Answers1

1

Ok, I just found what was my problem. By adding following line, SDK module got visibility to my androidTest classes.

androidTestCompile project(path : ':Sdk', configuration : 'prodDebug')

More explanation at here.

Community
  • 1
  • 1
Hesam
  • 49,622
  • 70
  • 212
  • 354