Eugen Martynov
Eugen Martynov

Reputation: 20140

Unresolved class references with Android Studio in tests

I have the annoying issue with Android Studio 2.0 beta 6.

I have multi-module project. And tests in one module (backend) are not compilable by Android Studio because it can not find references to classes from another module that it depends on:

screenshot

Everything is fine when I run gradle.

UPDATE

With Android Studio 1.5 I was able to run tests from all modules separately. I will investigate how to run all tests how it was before we were having flavours.

UPDATE 2

If I try to run unit tests from AS than I see classpath which includes:

**/core/build/intermediates/classes/test/debug

but doesn't include:

**/core/build/intermediates/classes/debug

Where are classes that missed right now

Upvotes: 3

Views: 4277

Answers (1)

Sam Edwards
Sam Edwards

Reputation: 894

We had this same issue for modules in our project that had unit tests. They all ran fine with the command line, but had this issue in Android Studio. We finally determined it's a bug with the newest version of Android Studio. The work around is to disable the "Experimental" test feature.

enter image description here

Hopefully they'll fix this in newer versions, but it's affecting us in Android Studio 2.0 beta 6.

Related Answer: Test Artifact selector missing/gone from Build Variants in Android Studio 2 Beta 5

Upvotes: 2

Related Questions