Issue
I'm trying to test some code that part of it comes from another module. All the test pass except these which are referencing classes from java module. I've this configuration but it doesn't work:
androidTestCompile(project(':common'))
compile project(':common')
Exception during runtime:
java.lang.RuntimeException: java.lang.ClassNotFoundException: Class...
...
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
How to add another module's classes to test apk?
Solution
Solved with one additional line in settings.gradle. Something was messed up in this file.
include ':common'
In your build.gradle you just need:
compile project(':common')
Answered By - tomrozb
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.