0

I have included this in my module level build.gradle: compile 'com.android.support:support-v4:22'. (My targetSdkVersion is 23 and compileSdkVersion is also 23.)

However, I can see that my app is still using [support v4-23.0.0] android.support.v4.app.Fragment when the cursor hovers over the import statement at the top of a file. I want my app to use the version 22 Fragment. Can anyone help?

Jonas
  • 534
  • 8
  • 16
  • 3
    Probably some other dependency is looking for the newer `support-v4`. I would focus on fixing whatever problem you have with `support-v4:23.0.1`, as you will not be able to stay on v22 forever. Beyond that, run a Gradle dependency report to see what else has transitive dependencies on `support-v4` and use `exclude` directives to tell Gradle to ignore their preferred `support-v4` versions. – CommonsWare Sep 19 '15 at 17:14
  • My problem with the new version of `android.support.v4.app.Fragment` is that `Loader`s are not reused on orientation change (which I ask about [here](http://stackoverflow.com/questions/32614189/loader-not-retained-and-always-created-on-orientation-change)). Do you have any suggestion? Should I try to work around the Loaders or use an older support library? – Jonas Sep 19 '15 at 17:20
  • "Do you have any suggestion?" -- pray for a bug fix. :-) "Should I try to work around the Loaders or use an older support library?" -- well, I don't use loaders, unless if I am querying a system-supplied `ContentProvider`. And I don't use the fragments backport. So for me, this bug wouldn't be a big problem. Note that the bug cited 23.0.0 for the version, so you might want to update your libraries to 23.0.1 and see if it got fixed independently of the issue. Otherwise, I'd go with v22 across the board, rather than try to mix and match v23 and v22 support library bits. – CommonsWare Sep 19 '15 at 17:33

0 Answers0