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,824
  • 17
  • 99
  • 186
Hesam
  • 52,260
  • 74
  • 224
  • 365

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
  • 52,260
  • 74
  • 224
  • 365