3

Every time i create a new project with compatibility under API14, a new project with name appcompat_v7_* is created.

Is it possible to avoid the multiple creations of this appcompat_v7_* and use a single project appcompat_v7 in other projects ?

*-> Number that increments with each new android project.

user3141985
  • 1,395
  • 4
  • 17
  • 36
  • possible duplicate of [Remove v7 appcompat folder](http://stackoverflow.com/questions/22542978/remove-v7-appcompat-folder) – donfuxx Apr 21 '14 at 19:48

1 Answers1

2

This is a duplicate-

I have answered this here Remove v7 appcompat folder but will include it here as well

This is part of the ADT/SDK update and it is not a bad thing to happen. It ensures that your app has full support of the ActionBarActivity that was implemented in API 14+. It will get created each time by default, but with a little work you can keep your files down. I simply have a single appcompat_v7, whenever I create a project, let's call it SampleApplication, appcompat_v7_2 is created.

- How to re-reference your library - Right click on "SampleApplication" Go to "Properties" Click "Android" Scroll to the bottom's "Library" section Click "..\appcompat_v7" Click "Remove" Click "Add" Click on "appcompat_v7" Click "Apply"

Now you have referenced your preexisting library. You now need to delete your old "extra" duplicate appcompat_v7_2 library. I do this as follows:

- Deleting duplicated copy - Right click on "appcompat_v7_2" in the Package Explorer of your workspace Click "Delete" Go to your physical workspace (In Windows, something like C:\...\...\workspace) Find "appcompat_v7_2" Right click on "appcompat_v7_2" in your physical workspace Click "Delete" Restart Eclipse

It is not ideal as it requires a bit of setup for each application. But it works. You can also uncheck "Create Activity" when you are creating your application project and it won't add the library (but also, obviously, won't include your main activity).

As another note, apparently for some people it doesn't include the library if your minimum sdk version for your application is 11+. For me, however, it always includes it, so this is my way around it.

Community
  • 1
  • 1
zgc7009
  • 3,371
  • 5
  • 21
  • 33
  • I am asking about any config to avoid multiple creations, I have seen post that refers to include the first one. But if the compatibility project is created once, then why there is a need to create another. Is the new one in any way different than the existing one ? – user3141985 Apr 21 '14 at 19:50
  • There isn't one. They make sure that you create a clean copy every time so that they can make sure your application supports the ActionBar. Eclipse could likely do something to make it more efficient on their end, but they don't want to :) – zgc7009 Apr 21 '14 at 19:52
  • It isn't a bug, it is just an inconvenience – zgc7009 Apr 21 '14 at 19:54