fxam
fxam

Reputation: 3982

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?

enter image description here

Upvotes: 4

Views: 888

Answers (2)

fxam
fxam

Reputation: 3982

I asked in JetBrains forum and got this reply:

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.

Upvotes: 2

kukido
kukido

Reputation: 10601

"Tested module" is where your library supposed to be.

IntelliJ documentation: Testing Android Applications

Upvotes: 0

Related Questions