android.support.v4.app.Fragment: undefined method getChildFragmentManager()

12,714

i had some similar issues with the support library because of diffrent versions in ABS and in my project (but not using VPI)

try to download the latest android-support-v4.jar with the Android SDK Manager and then copy the jar from <sdkdir>/extras/android/support/v4/android-support-v4.jar to your project and also to ABS and VPI (afaik both have a older copy of android-support-v4.jar in thier download)

Share:
12,714
blub
Author by

blub

Nothing here.

Updated on August 21, 2022

Comments

  • blub
    blub over 1 year

    I'm using ActionBarSherlock and ViewPageIndicator and I tried to implement nested fragments, but the method getChildFragmentManager() is undefined in myandroid.support.v4.app.Fragments.

    There are no other errors and ABS and VPI work as expected.

    I'm not using the Support Library v13, I'm on the latest versions and I've cleaned my projects. A normal android.app.Fragment does not complain about getChildFragmentManager().

    I also tried rearranging the support library dependencies (android-support-v4.jar in ABS, VPI and main project referencing it, or android-support-v4.jar in as external jar), but getChildFragmentManager() remains undefined.

    If I remove the VPI though, getChildFragmentManager() works, but of course VPI stops working. So, there must be something wrong with the dependencies, but I'm running out of ideas to try.

    Any help would be much appreciated!

    • etienne
      etienne about 11 years
      Can you get rid of android-support-v4 everywhere, and use only v13?
    • Dodge
      Dodge about 11 years
      try to download the latest android-support-v4.jar with the Android SDK Manager and then copy the jar from <sdkdir>/extras/android/support/v4/android-support-v4.jar to your project and also to ABS and VPI (afaik both have a older copy of android-support-v4.jar in thier download) i had some similar issues with the support library because of diffrent versions in ABS and in my project (but not using VPI)
    • blub
      blub about 11 years
      @Dodge I had downloaded the latest version for my main project (or at least I thought I had!) and was using that as external jar for ABS and VPI, but I tried downloading it again anyways and voilá, problem solved (or rather, one problem replaced with others, but progress!). If you add your solution as answer I'll accept it!
  • yahya
    yahya about 11 years
    Getting the latest version of android-support-v4.jar worked. I just downloaded VPI source once more, and copied its support library. But i guess it was an old version. Thanks!
  • Do Re
    Do Re over 8 years
    What is ABS and VPI`?
  • Dodge
    Dodge over 8 years
    ABS: ActionBarSherlock / VPI: ViewPageIndicator