java.lang.IllegalStateException: The scope with name au.com.app.android.app.Application@89995e9 has been already closed. It is not possible to use it to create new instances.

GitHub | markchristopherng | 3 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael and Rafael Fischer Viola . Or join the community to write better ones.
  1. 0

    GitHub comment 197#277111250

    GitHub | 3 months ago | markchristopherng
    java.lang.IllegalStateException: The scope with name au.com.app.android.app.Application@89995e9 has been already closed. It is not possible to use it to create new instances.
  2. 0
    samebug tip
    As of SDK 23, you have to call this method with ContextCompat.getColor(context, R.color.my_color) so it works with previous API as well. Also, you have to add the support V4 library to your dependencies: "compile 'com.android.support:support-v4:23.0.1'"
  3. 0
    samebug tip
    If you're using nested fragments, you have to use childFragmentManager instead of fragmentManager.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    samebug tip
    When you use findViewById inside an activity it is going to look for a View inside your main_activity.xml. If it's not there, it throws this exception, try to use the right view to call findviewById.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      The scope with name au.com.app.android.app.Application@89995e9 has been already closed. It is not possible to use it to create new instances.

      at toothpick.ScopeImpl.crashIfClosed()
    2. toothpick
      ScopeImpl.getInstance
      1. toothpick.ScopeImpl.crashIfClosed(ScopeImpl.java:509)
      2. toothpick.ScopeImpl.getInstance(ScopeImpl.java:53)
      3. toothpick.ScopeImpl.getInstance(ScopeImpl.java:48)
      3 frames
    3. au.com.app
      ExampleMainFragment$$MemberInjector.inject
      1. au.com.app.android.activity.main.ExampleMainFragment$$MemberInjector.inject(ExampleMainFragment$$MemberInjector.java:12)
      2. au.com.app.android.activity.main.ExampleMainFragment$$MemberInjector.inject(ExampleMainFragment$$MemberInjector.java:9)
      2 frames
    4. toothpick
      Toothpick.inject
      1. toothpick.InjectorImpl.inject(InjectorImpl.java:25)
      2. toothpick.Toothpick.inject(Toothpick.java:140)
      2 frames
    5. au.com.app
      ExampleMainFragment.onCreate
      1. au.com.app.android.activity.main.ExampleMainFragment.onCreate(ExampleMainFragment.java:35)
      1 frame
    6. Android Platform
      ActivityThread.handleLaunchActivity
      1. android.app.Fragment.performCreate(Fragment.java:2198)
      2. android.app.FragmentManagerImpl.moveToState(FragmentManager.java:942)
      3. android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148)
      4. android.app.BackStackRecord.run(BackStackRecord.java:793)
      5. android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1535)
      6. android.app.FragmentController.execPendingActions(FragmentController.java:325)
      7. android.app.Activity.performStart(Activity.java:6252)
      8. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
      9. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
      9 frames