lundi 3 août 2015

Android Studio unit test library project ClassNotFoundException

I am using the VM unit testing of the Android gradle plugin and all my unit tests run fine from within Android Studio and via gradle command line invocation.

But when I run a test in Android Studio on a class that has a dependency to a library project included with compile project (":library:myLib") I get a ClassNotFoundException on the class from the library project. However the test runs fine when running gradle from the command line.

I am using junit 4 and powermock with mockito. No Robolectric or other frameworks. I have set the test artifact to Unit Tests. As said, unit tests for classes that have no dependency to a library project work fine in my setup.

Any ideas?

Aucun commentaire:

Enregistrer un commentaire