13

When I add appcompat project as a library I get these errors:

- found 2 versions of android-support-v4.jar in the dependency list appcompat in  android. 

- `aapt.exe` has stop working.

How to solve this?

Fernando Carvalhosa
  • 1,098
  • 1
  • 15
  • 23
John R
  • 2,078
  • 8
  • 35
  • 58

3 Answers3

25

Delete android-support-v4.jar from library and project. Then go in <sdk>/extras/android/support/samples/Support4Demos/ and copy android-support-v4.jar and paste in libs folder of both.

John R
  • 2,078
  • 8
  • 35
  • 58
  • there is no libs folder in Support4Demos, any help? – Wasif Khalil Aug 27 '14 at 08:21
  • @WasifKhalil Then create and see it works or not. I am not sure about this bcoz I have never faced any problem like this. – John R Sep 01 '14 at 09:21
  • I think you will end up with the same lib compiled twice this way. Wouldn't be better to use only appcompat's `android-support-v4.jar`? I mean, delete the support.jar from your project's libs folder and add appcompat project as a library. Works in NetBeans (tested). In my Project View, the support.jar shows up as a library, but the jar is placed fisically in appcompat libs folder – Fernando Carvalhosa Oct 30 '14 at 15:21
12

Generally you get this error when you add external library which already contains android-support-v4.jarfile.

Here you can delete this android-support-v4.jar file from your libs folder. This will solve your problem.

user3243163
  • 408
  • 2
  • 14
2

I too had same problem just few day's back and what i did is, just deleted the android-support-v4.jar from my project, and then i have added my library project jar by right clicking my project -> go to properties, select java Build Path and then select add external jar from the option and select android-support-v4.jar from your library project and then click on Order and export and check mark android-support-v4.jar that you have added from library project and then press Ok.

That's it. Enjoy Coding

InnocentKiller
  • 5,234
  • 7
  • 36
  • 84