java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.app.debug/com.myapp.app.conversation.ConversationActivity}: java.lang.ClassCastException: com.myapp.app.conversation.data.SqlMessageStore cannot be cast to com.myapp.app.auth.UserScopedAccountStore

Stack Overflow | loeschg | 5 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    ClassCastException in Espresso test with Dagger 2 after upgrading to Android Gradle 2.2.0 plugin

    Stack Overflow | 5 months ago | loeschg
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.app.debug/com.myapp.app.conversation.ConversationActivity}: java.lang.ClassCastException: com.myapp.app.conversation.data.SqlMessageStore cannot be cast to com.myapp.app.auth.UserScopedAccountStore

    Root Cause Analysis

    1. java.lang.ClassCastException

      com.myapp.app.conversation.data.SqlMessageStore cannot be cast to com.myapp.app.auth.UserScopedAccountStore

      at com.myapp.app.di.module.UserModule_UserScopedAccountStoreFactory.get()
    2. com.myapp.app
      UserModule_UserScopedAccountStoreFactory.get
      1. com.myapp.app.di.module.UserModule_UserScopedAccountStoreFactory.get(UserModule_UserScopedAccountStoreFactory.java:30)
      2. com.myapp.app.di.module.UserModule_UserScopedAccountStoreFactory.get(UserModule_UserScopedAccountStoreFactory.java:10)
      2 frames
    3. Dagger
      DoubleCheck.get
      1. dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
      1 frame
    4. com.myapp.app
      UserModule_TokenInterceptorFactory.get
      1. com.myapp.app.di.module.UserModule_TokenInterceptorFactory.get(UserModule_TokenInterceptorFactory.java:30)
      2. com.myapp.app.di.module.UserModule_TokenInterceptorFactory.get(UserModule_TokenInterceptorFactory.java:10)
      2 frames
    5. Dagger
      DoubleCheck.get
      1. dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
      1 frame
    6. com.myapp.app
      UserModule_AuthedOkHttpClientFactory.get
      1. com.myapp.app.di.module.UserModule_AuthedOkHttpClientFactory.get(UserModule_AuthedOkHttpClientFactory.java:30)
      2. com.myapp.app.di.module.UserModule_AuthedOkHttpClientFactory.get(UserModule_AuthedOkHttpClientFactory.java:10)
      2 frames
    7. Dagger
      DoubleCheck.get
      1. dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
      1 frame
    8. com.myapp.app
      UserModule_HipChatClientFactory.get
      1. com.myapp.app.di.module.UserModule_HipChatClientFactory.get(UserModule_HipChatClientFactory.java:81)
      2. com.myapp.app.di.module.UserModule_HipChatClientFactory.get(UserModule_HipChatClientFactory.java:17)
      2 frames
    9. Dagger
      DoubleCheck.get
      1. dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
      1 frame
    10. com.myapp.app
      UserModule_LogoutFactory.get
      1. com.myapp.app.di.module.UserModule_LogoutFactory.get(UserModule_LogoutFactory.java:29)
      2. com.myapp.app.di.module.UserModule_LogoutFactory.get(UserModule_LogoutFactory.java:10)
      2 frames
    11. Dagger
      DoubleCheck.get
      1. dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
      1 frame
    12. com.myapp.app
      ConversationActivity.onCreate
      1. com.myapp.app.di.module.UserModule_SignedInPresenterFactory.get(UserModule_SignedInPresenterFactory.java:69)
      2. com.myapp.app.di.module.UserModule_SignedInPresenterFactory.get(UserModule_SignedInPresenterFactory.java:16)
      3. com.myapp.app.BaseSignedInActivity_MembersInjector.injectPresenter(BaseSignedInActivity_MembersInjector.java:44)
      4. com.myapp.app.conversation.ConversationActivity_MembersInjector.injectMembers(ConversationActivity_MembersInjector.java:40)
      5. com.myapp.app.conversation.ConversationActivity_MembersInjector.injectMembers(ConversationActivity_MembersInjector.java:9)
      6. com.myapp.app.di.DaggerUserComponent.inject(DaggerUserComponent.java:993)
      7. com.myapp.app.conversation.ConversationActivity.inject(ConversationActivity.java:149)
      8. com.myapp.app.BaseSignedInActivity.onCreate(BaseSignedInActivity.java:59)
      9. com.myapp.app.conversation.ConversationActivity.onCreate(ConversationActivity.java:57)
      9 frames
    13. Android Platform
      Instrumentation.callActivityOnCreate
      1. android.app.Activity.performCreate(Activity.java:5990)
      2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
      2 frames
    14. android.support.test
      MonitoringInstrumentation.callActivityOnCreate
      1. android.support.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:532)
      1 frame
    15. Android Platform
      ActivityThread.main
      1. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
      2. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
      3. android.app.ActivityThread.access$800(ActivityThread.java:151)
      4. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
      5. android.os.Handler.dispatchMessage(Handler.java:102)
      6. android.os.Looper.loop(Looper.java:135)
      7. android.app.ActivityThread.main(ActivityThread.java:5254)
      7 frames
    16. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames
    17. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
      2 frames