Question

I'm trying to make my app backwards compatible to Android 2.2.

I've got Fragments, ListFragments, a FragmentPagerAdapter, and ActionBarSherlock all happening.

I've got the android support library included, and the build works perfectly on my android 4.1 device, but on the 2.2 device, I get the following:

09-21 00:10:32.867: I/dalvikvm(1229): Failed resolving Lanother/music/player/AlbumListFragment; interface 521 'Landroid/widget/SearchView$OnQueryTextListener;'
09-21 00:10:32.877: W/dalvikvm(1229): Link of class 'Lanother/music/player/AlbumListFragment;' failed
09-21 00:10:32.877: E/dalvikvm(1229): Could not find class 'another.music.player.AlbumListFragment', referenced from method another.music.player.MainActivity.<init>
09-21 00:10:32.877: W/dalvikvm(1229): VFY: unable to resolve new-instance 531 (Lanother/music/player/AlbumListFragment;) in Lanother/music/player/MainActivity;
09-21 00:10:32.877: I/dalvikvm(1229): Could not find method another.music.player.MainActivity.getActionBar, referenced from method another.music.player.MainActivity.onCreate
09-21 00:10:32.887: W/dalvikvm(1229): VFY: unable to resolve virtual method 3906: Lanother/music/player/MainActivity;.getActionBar ()Landroid/app/ActionBar;
09-21 00:10:32.887: I/dalvikvm(1229): Failed resolving Lanother/music/player/AlbumListFragment; interface 521 'Landroid/widget/SearchView$OnQueryTextListener;'
09-21 00:10:32.887: W/dalvikvm(1229): Link of class 'Lanother/music/player/AlbumListFragment;' failed
09-21 00:10:32.887: E/dalvikvm(1229): Could not find class 'another.music.player.AlbumListFragment', referenced from method another.music.player.MainActivity.onListItemClicked
09-21 00:10:32.887: W/dalvikvm(1229): VFY: unable to resolve new-instance 531 (Lanother/music/player/AlbumListFragment;) in Lanother/music/player/MainActivity;
09-21 00:10:32.887: I/dalvikvm(1229): Failed resolving Lanother/music/player/SongListFragment; interface 521 'Landroid/widget/SearchView$OnQueryTextListener;'
09-21 00:10:32.887: W/dalvikvm(1229): Link of class 'Lanother/music/player/SongListFragment;' failed
09-21 00:10:32.887: E/dalvikvm(1229): Could not find class 'another.music.player.SongListFragment', referenced from method another.music.player.MainActivity.onListItemClicked
09-21 00:10:32.887: W/dalvikvm(1229): VFY: unable to resolve new-instance 576 (Lanother/music/player/SongListFragment;) in Lanother/music/player/MainActivity;
09-21 00:10:32.887: I/dalvikvm(1229): Could not find method another.music.player.MainActivity.getActionBar, referenced from method another.music.player.MainActivity.onOptionsItemSelected
09-21 00:10:32.887: W/dalvikvm(1229): VFY: unable to resolve virtual method 3906: Lanother/music/player/MainActivity;.getActionBar ()Landroid/app/ActionBar;
09-21 00:10:32.887: I/dalvikvm(1229): Failed resolving Lanother/music/player/AlbumListFragment; interface 521 'Landroid/widget/SearchView$OnQueryTextListener;'
09-21 00:10:32.887: W/dalvikvm(1229): Link of class 'Lanother/music/player/AlbumListFragment;' failed
09-21 00:10:32.887: E/dalvikvm(1229): Could not find class 'another.music.player.AlbumListFragment', referenced from method another.music.player.MainActivity.onOptionsItemSelected
09-21 00:10:32.887: W/dalvikvm(1229): VFY: unable to resolve new-instance 531 (Lanother/music/player/AlbumListFragment;) in Lanother/music/player/MainActivity;
09-21 00:10:32.897: I/dalvikvm(1229): Could not find method android.support.v4.app.FragmentActivity.getActionBar, referenced from method another.music.player.ArtistListFragment.onListItemClick
09-21 00:10:32.897: W/dalvikvm(1229): VFY: unable to resolve virtual method 810: Landroid/support/v4/app/FragmentActivity;.getActionBar ()Landroid/app/ActionBar;

I've been playing around with this for hours, but I just don't know what to try. Any suggestions are appreciated. If you need to see some code, just let me know.

Thanks.

Was it helpful?

Solution

I realised after reading my own SO question, that I wasn't interpreting the following corrsctly:

09-21 00:10:32.867: I/dalvikvm(1229): Failed resolving Lanother/music/player/AlbumListFragment; interface 521 'Landroid/widget/SearchView$OnQueryTextListener;

It seems that ActionBarSherlock doesn't support the onQueryTextListener, and some other elements. I didn't need these methods anyway, so I removed them from the ativity, and the problem was solved.

I imagine that onQueryTextChange is supported natively in the 4.1 device, but on the 2.2 device (where the actionBar is supported by ActionBarsherlock), these methods are not supported.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top