Issue
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.
Solution
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.
Answered By - Hesam

0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.