Issue
When I run my Android instrument test, Espresso class initialization fails with the following stacktrace:
java.lang.NoSuchMethodError: No interface method get()Ljava/lang/Object; in class Ljavax/inject/Provider; or its super classes (declaration of 'javax.inject.Provider' appears in /data/app/com.myapp.mock.debug-2/base.apk)
at android.support.test.espresso.DaggerBaseLayerComponent.idlingResourceRegistry(DaggerBaseLayerComponent.java:101)
at android.support.test.espresso.Espresso.<clinit>(Espresso.java:52)
...
I don't know if it is relevant, but my project uses Kotlin.
Any idea?
Solution
The solution is to add the following in the proguard file of the application:
-keep class javax.inject.* { *; }
Otherwise the get()
method is removed by Proguard.
Answered By - clemp6r
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.