35

Exception is:

"Unable to resolve superclass of L android/support/v4/app/FragmentTransitionCompat21$1;"

I am trying to Pop the last Fragment Transition from the Fragment Manager's Fragment Back Stack, using the following function:

getSupportFragmentManager().popBackStack(); ,

When I did this, function call throwing following Error. This is only happening when I used New Android API Version 21 as Build target.

Same Code work fine with Older API Version 20.

Error: Could not find superclass of 'android.support.v4.app.FragmentTransitionCompat21$1'

It seems an Inner Class in the Base class of 'FragmentTransitionCompat21'.

Error:

W/dalvikvm(1356): Unable to resolve superclass of Landroid/support/v4/app/FragmentTransitionCompat21$1; (1082)

W/dalvikvm(1356): Link of class 'Landroid/support/v4/app/FragmentTransitionCompat21$1;' failed

E/dalvikvm(1356): Could not find class 'android.support.v4.app.FragmentTransitionCompat21$1', referenced from method android.support.v4.app.FragmentTransitionCompat21.setEpicenter

W/dalvikvm(1356): VFY: unable to resolve new-instance 358 (Landroid/support/v4/app/FragmentTransitionCompat21$1;) in Landroid/support/v4/app/FragmentTransitionCompat21;

Does anybody find similar Error? please help how to solve this, thank you.

Ahmad MOUSSA
  • 2,729
  • 19
  • 31
skstar
  • 415
  • 4
  • 12

3 Answers3

1

It definitely referencing API 21 Version 4 Support Library, if you have any animations set on the transaction that has ObjectAnimator change it, also reference your animations from R.anim, or it will through and error.

Kevin Crain
  • 1,905
  • 1
  • 19
  • 28
  • I am not in a position to work on this code, if any one tried this and it is working please tell me , I can choose the answer. – skstar Mar 14 '15 at 09:02
1

in few previous days i have also face this kind of err, then i try v7 appcompat with API 22 instead of android.support.v4.app.FragmentTransition.

have you try this one,

import android.app.FragmentTransaction;

there is code snip.

FragmentManager fm = getFragmentManager();
FragmentTransaction fragmentTransaction = fm.beginTransaction();
fragmentTransaction.addToBackStack("");
fragmentTransaction.replace(R.id.content_frame, Fr);
fragmentTransaction.commit();
Opal
  • 81,889
  • 28
  • 189
  • 210
  • I am not in a position to work on this code, if any one tried this solution and it is working please tell me , I can choose the answer. – skstar Mar 14 '15 at 09:02
1

if you are trying to pop up fragment from stack inside the fragment you should use getChildFragmentManager instead of getfragmentManager.

[https://stackoverflow.com/questions/6847460/fragments-within-fragments][1]