android - Robolectric and Library modules with resource files -


i using following project structure:

main |_ project    |_ build.gradle |_ library    |_ build.gradle |_ settings.gradle 

i have included robolectric 2.3 in project , i've created basic unit test. problem every test fails (nullpointerexception) because have resources inside library cannot loaded unit tests. i've read robolectric should correctly work resource files inside library projects since 2.0.

i cannot make run. in intellij idea project configuration, under test configuration, working directory set project module (i have resource files under project module also).

thank you, hope robolectric confirm me if libraries resource files supported.

solution: added project.properties file @ root of project following:

target=android-18 android.library.reference.1=../mylibrary 

now robolectric finds resource files inside library , project.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -