Note that the AppCompat library has an implicit dependency on the support-v4 library. The support-v4 declaration however does not necessarily need to be declared. Since the release of the support-v4 version 24.2.0, the library has been divided into separate modules: support-compat, support-core-utils, support-core-ui, support-media-compat, and support-fragment. However, because the AppCompat library usually depends on support-fragment, which still contains a dependency to all the other modules, you currently cannot take advantage of this change to reduce the number of overall dependencies.

Also notice that once you upgrade to AppCompat v7 v24, you will also be forced to update your Build Tools and compileSDKVersion to API 24 too.

There is a current bug that precludes you from compiling to lower versions. Once you are using this API version 23 or higher, be aware that the Apache HTTP Client library has been removed. Workarounds are discussed in this guide.

Downgrading AppCompat libraries

If you need to wish to downgrade (i.e. API 23 to API 22), you need to follow more steps besides simply uninstalling the SDK as documented in this bug report:

Search and replacing changes

Older projects may not include this library, so migrating requires changing the theme references and many of the main imports described in this blog post. Because the support class declarations are not compatible with the standard Android ones, you need to make sure you are using the imports from the support library entirely. Otherwise your app is likely to crash.

The simplest is often to do a search-and-replace to start changing the following statements to start using the support libraries.

Theme XML Changes

If you were migrating from the Holo theme, your new theme would inherit from Theme.AppCompat instead of android:Theme.Holo.Light:

<stylename="AppTheme"parent="Theme.AppCompat.Light.DarkActionBar">

If you wish to have a style that disables the ActionBar in certain Activity screens but still wish to use many of the ones you custom defined, you can inherit from AppTheme and apply the same styles declared in Theme.AppCompat.NoActionBar:

If you see AppCompat does not support the current theme features, it's likely the windowNoTitle setting has not been set or is set to false. There is more strict enforcement on what this value must be set on newer AppCompat libraries. See this Stack Overflow article for more context.

Menu XML Changes

For your menu/ layout files, add an app: namespace . For menu items, the showAsAction must be from the app namespace instead of android namespace. It is considered a custom attribute of the support library and will no otherwise be processed correctly without making this change.

Preference xmls need to migrate to using android.support.v7.preference package counterparts, e.g. android.support.v7.preference.PreferenceCategory instead of PreferenceCategory and android.support.v7.preference.SwitchPreferenceCompat instead of SwitchPreference.

PreferenceManager used in APIs like PreferenceManager.getDefaultSharedPreferences(context) should now be android.support.v7.preference.PreferenceManager.

If you have a custom UI for your ListPreference dialog, it needs to break down into android.support.v7.preference.ListPreference and android.support.v7.preference.ListPreferenceDialogFragmentCompat. APIs like onPrepareDialogBuilder(AlertDialog.Builder builder) and onDialogClosed(boolean positiveResult) can now be found in the dialog fragment instead of the ListPreference itself.

The dialog can be instantiated from within the PreferenceFragmentCompat child using

Changing targetSDKVersion

In addition, setting the targetSdkVersion to the latest SDK version ensures that the AppCompat library will attempt to apply the Material Design assuming the device itself can support it. The support library will still check to see if the minimum SDK version is being used on the device.

android{targetSdkVersion24

Known issues

The AppCompat library has issues with Samsung v4.2.2 devices. See this issue for more details.