11

I have recently update my ADT to rev. 20, but now I find that newly created project always included the android support library. I don't want to use the FragmentActivity class, which is defined in the support library, I just want to use the pure Fragment class.

I tried to delete the support library via the SDK manager tool, but now I cannot create any projects since the ADT is reporting

This template depends on the Android Support library, which is either not installed, ......

Is there any method to by pass this except for create a project by shell command?

Adil Soomro
  • 37,609
  • 9
  • 103
  • 153
Robin
  • 10,052
  • 6
  • 31
  • 52
  • you can delete android dependencies from build path – rajpara Jul 11 '12 at 04:54
  • If I install the support library, the created project will be using FragmentActivity which I don't want. – Robin Jul 11 '12 at 05:05
  • My first thought was that your build or minimum SDK must have been below 11. I just tried creating an project with the build and minimum SDK both set to 15, and chose not to create an activity. The _android-support-v4 .jar_ was still included. My guess is that this is a bug and you should probably report it if it hasn't been already. – Chilledrat Jul 13 '12 at 15:08

6 Answers6

16

Go the SDK_Folder/extra/android and rename the folder compatibility to support. After that, restart the Eclipse.

Midson
  • 1,018
  • 3
  • 12
  • 23
1

Well, it's not ideal but until they fix ADT there at least appears to be a manual way to get there.

  1. Create the Android project with a min SDK of ICS. Skip adding an Activity when the wizard prompts to add one. Yes, annoyingly, it still adds the Support Library.

  2. After the project is created, open the project properties and go to Java Build Path.

  3. On the Libraries tab select Android Dependencies, click the Remove button, and click OK.

  4. In package explorer expand the "libs" folder and delete the support library jar.

I believe this gets you an ICS project without the unnecessary support library.

Robert Nekic
  • 3,087
  • 3
  • 24
  • 36
0

Since you deleted the support library from within the SDK Manager, click the "Install/Update" button on the screen that you're describing. This time it will let you move forward.

es0329
  • 1,366
  • 1
  • 18
  • 35
  • Thanks for your quick reply, but you might not get what I really want. I want to create a ICS application project without the support library. – Robin Jul 11 '12 at 05:03
0

EDIT Clarification. The projects you're creating require the Support Library because you have created the project using a Application Templates. Read on for my answer Space Cowboy.

ADT R.20 now has Application Templates which creates a bit of the boilerplate for you. If you don't need a template, all you need to do is uncheck "Create Activity" when you get to the Create Activity screen of the New Android Project wizard.

I have noticed that there is a bit of a bug in the wizard. If you click next in the wizard at Create Activity and then click back to come back to this screen, the Finish button will be disabled. Even if you check/uncheck Create Activity the button will still be disabled, so you won't be able to create an empty project at this point. At this point you can simply cancel the wizard and start again.

TJ Thind
  • 784
  • 5
  • 17
0

Don't just rename the compatibility directory to support. This is addressed in http://code.google.com/p/android/issues/detail?id=33859 items 31 and 34. Use the SDK manager to remove the support library then use it to add it back in. Otherwise you may have other problems down the road.

melston
  • 2,198
  • 22
  • 39
  • This is a confirmed bug therefore the problem is with the aliasing of the folder name, the contents remain unchanged and Midson's, http://stackoverflow.com/a/11463895/866333, answer is neater. – John Jul 21 '12 at 20:50
0

Make a new folder name compatibility copy items from support and pate it in compatibility folder will resolve the issue

Wajeeha
  • 51
  • 1
  • 4