Accepted answer

as stated in android's support library overview, it is considered good practice to include the support library by default because of the large diversity of devices and the fragmentation that exists between the different versions of android (and thus, of the provided apis).

this is the reason why android code templates tools included in eclipse through the android development tools (adt) integrate them by default.

i noted that you target api 15 in your sample, but the miminum required sdk for your package is api 10, for which the compatibility libraries can provide a tremendous amount of backward compatible apis. an example would be the ability of using the fragment api which appeard on api 11 (android 3.0 honeycomb) on a device that runs an older version of this system.

it is also to be noted that you can deactivate automatic inclusion of the support library by default.


i noticed creation of 'appcompat' library while creating new android project with adt 22.6.2 version, even when the minsdk was set to 11 and targetsdk was set 19

this was happening because, in the new project template android is using some attributes that are from the support library. for instance if a new project was created with actionbar then in the menu's main.xml one could find app:showasaction="never" which is from support library.

  • if the app is targeted at android version 11 and above then one can change this attribute to android:showasaction in menu's main.xml
  • also the default theme set could be "theme.appcompat.light.darkactionbar" as shown below (styles.xml)

    <style name="appbasetheme" parent="theme.appcompat.light.darkactionbar">
           <!-- api 14 theme customizations can go here. -->

    in this case the parent theme in style.xml has to be changed to "android:style/theme.holo.light.darkactionbar"

  • in addition to this if reference to fragment,fragments manager from support library was made in the code of, these have to appropriately changed to fragment, fragmentmanager of the sdk.


according to

the actionbar apis were first added in android 3.0 (api level 11) but they are also available in the support library for compatibility with android 2.1 (api level 7) and above.

in short, that auto-generated project you're seeing modularizes the process of adding the actionbar to apis 7-10.

example of actionbar on froyo

see for a simplified explanation and tutorial on the topic.


sorry with my english, when you create a new android project, you should choose api of high level, for example: from api 17 to api 21, it will not have appcompat and very easy to share project. if you did it with lower api, you just edit in android manifest to have upper api :), after that, you can delete appcompat v7.


if you are not targeting 2.x versions you can set your minimum sdk version of 4.x and then create project. appcompat v7 lib wont be created.


i'm new with android and the project appcompat_v7 always be created when i create new android application project makes me so uncomfortable.

this is just a walk around. choose project properties -> android then at library box just remove appcompat_v7_x and add appcompat_v7. now you can delete appcompat_v7_x.

uncheck create activity in create project wizard doesn't work, because when creating activity by wizard the appcompat_v7_x appear again. my adt's version is v22.6.2-1085508.
i'm sorry if my english is bad.


it's included because your minimum sdk version is set to 10. the actionbar was introduced in api 11. eclipse adds it automatically so your app can look more consistent throughout the spectrum of all android versions you are supporting.


eclipse automatically created the appcompat_v7.because of kitkat api launched itself it adds automatically appcompat_v7 and fragment_main.xml.

best ways to solve these:

  1. firstly in project,right click->properties->android.there you can see the red marked appcompat placed in reference. click that and remove it.then tick the right target name in project build target.

  2. delete fragment_main.xml and appcompat file created in your eclipse.

  3. edit and change your activity_main.xml like these:

    <?xml version="1.0" encoding="utf-8"?>
    <relativelayout xmlns:android=""
            android:text="@string/hello_world" />
  4. in res/values/styles.xml:

        <style name="appbasetheme" parent="android:theme.light">
        <!-- application theme. -->
        <style name="apptheme" parent="appbasetheme">
  5. in res/values-v11/styles.xml you have to change like these:

        <style name="appbasetheme" parent="android:theme.holo.light">
  6. in res/values-v14/styles.xml you have to change like these:

        <style name="appbasetheme" parent="android:theme.light">
        <style name="apptheme" parent="appbasetheme">
  7. change your menu/main.xml like these:

    <menu xmlns:android="" >
  8. finally change your like these:

    import android.os.bundle;
    public class mainactivity extends activity {
        protected void oncreate(bundle savedinstancestate) {

likewise you have to do it for creating a new project


why my eclipse automatically adds appcompat v7 library support whenever i create a new project

because your target sdk is set to 15, in which the action bar is on by default and your minimum supported sdk is set to 10. action bar come out in 11, so you need a support library, eclipse adds it for you. reference.

you can configure project libraries in the build path of project properties.


create a new android application project and uncheck create activity in step two (configure project).

Related Query

More Query from same tag