How to create a test module to test an Android library in IntelliJ IDEA?

I created an Android Library, but when I try to create an Android Test Module, the Tested module combobox has only a red [none], I cannot select the library itself.

Do I need to purposely create an Android application just to test the library?

2 comments

Hello,

Sorry about the delay. Currently there is no way to create test module for library module automatically. You can, for example, create application module that depends on the library module, and then create test module for it. Another way is to put the instrumentation into the application module itself, so additional "test" module is not needed.

0

Has there been any changes in the intervening two years?

Is this an Android restriction, an unimplemented IntelliJ feature?

0

Please sign in to leave a comment.