22

I've spent all afternoon getting absolutely nowhere with this. I've downloaded Eclipse, downloaded the SDK, installed the updates, but every new Android project I create something's wrong.

Firstly, it would not generate the R.java file, at all, now it does but there's a separate project it's created automatically called appcompat_v7. I don't know what this is, but it's causing problems with any other new project.

This is the error a normal project produces: The container 'Android Dependencies' references non existing library '/home/omar/workspace/appcompat_v7/bin/appcompat_v7.jar'

I have absolutely no idea how to fix this. What is causing this?

EDIT It appear this is only with KitKat, every other API platform doesn't produce ANY source files at all.... any idea how to combat this?

enter image description here

enter image description here

enter image description here

Omar.Ebrahim
  • 862
  • 1
  • 10
  • 30
  • right click on your project.. --> properties--> goto java build path--> Libraries and see if you ahve added something called as appcompat_v7 there. BTW have you changed your android sdk path in "preferences" ? – TheLostMind Mar 05 '14 at 17:21
  • Nope, not there. I've added screenshots – Omar.Ebrahim Mar 05 '14 at 17:28

2 Answers2

13

It's a support library which presumably your project refers to. You will need to build it as a library project in your workspace. This process is described here Support Library Setup under Adding libraries with resources.

You will find the project you need to copy in your SDK in the folder:

\yourSDKlocation\tools\android-sdk-windows4.4\extras\android\support\v7\appcompat

(It's no use just copying a jar, you must build it as a library project.)

Hamid Shatu
  • 9,664
  • 4
  • 30
  • 41
NickT
  • 23,844
  • 11
  • 78
  • 121
  • 3
    For some reason this didn't quite work, it still won't pick up the new appcompat jar file. Just creates a new appcompat project for any KitKat project I create. It seems that the older versions of Android create a new project okay now, just not KitKat. Never really had a problem with it before. Older projects on 4.4.2 (KitKat) open fine, but new ones refuse to – Omar.Ebrahim Mar 05 '14 at 17:49
  • Did you actually build the project in your workspace? – NickT Mar 05 '14 at 17:53
  • No problem, it's quite understandable if, like me, you had previously been used to just importing jars. I'm not a big fan of this requirement, but that's the way it is now. – NickT Mar 05 '14 at 18:04
  • It's odd... it worked, then it didn't, now it does again (doesn't generate a new appcompat project). For now, though, it worked. Thank you! :) – Omar.Ebrahim Mar 05 '14 at 18:16
  • Do we need to build every project as a library project? – Mohammad Areeb Siddiqui Jun 03 '14 at 17:10
  • How did you solve it?? I have the exact same problem since I updated the sdk... I read the Support Library Setup tutorial and followed each step. I have still the same error (jar missing in the bin folder of appcompat-v7). Help plz – Sebastian Breit Dec 29 '14 at 05:43
  • This is the least fun part of programming. :-( Done this twice and still no success. Read the the setups. Perroloco did you find a solution. – jannej Feb 27 '15 at 14:56
  • @Perroloco m having same problem..how to resolve this...can yu help pls – Sunishtha Singh May 09 '15 at 09:42
  • i am also planing for so.....but what is the way to import projects of eclipse to android studio, as earlier i faced a problem, that it didnt have top level gradel file when i import any project from eclipse – Sunishtha Singh May 11 '15 at 06:37
0

I had this problem when I moved a project to a different laptop. I solved it like this:

If appcompat_v7 is not available in Eclipse: From the File menu, choose New then Project. Next, choose Android and Android Project from existing Code, then click next Browse to find your appcompat_v7 project folder Make sure there’s a check mark next it in the ‘Projects to Import’ list If the appcompat_v7 project folder is not currently in your workspace, select ‘Copy projects into workspace’, then click Finish

Now that the library project is available in your workspace, it can be added to a project: Choose your project from the Project Explorer and open the project properties (on a mac it’s in the Project menu) Click on Android in the left list Next to the Library list, click the Add button Choose appcompat_v7 from the list

You should be good to go now.

JanB
  • 904
  • 9
  • 14