Can't build android project because ActionBarActivity cannot be resolved to a type

10,142

Solution 1

The library project should be placed on the same drive with your workspace. the referencing project was in the same eclipse workspace as the library project.

Solution 2

You should make a copy of appcompat-v7 and put it in your workspace, then have all the projects just reference it.

Share:
10,142
Mitulát báti
Author by

Mitulát báti

When I work I use Microsoft technologies (C#, .Net, Sql Server, WinForms, Vs, Tfs, Wpf, Wcf, Www, Wasd, Fgh and of course Jkl). Currently I'm learning web-related technologies: Asp.Net, Mvc, Web Api, Angular (7), JavaScript. I also have a little experience (but big interest) in Android development. So a minimal knowledge of Java is also present in my skill set.

Updated on June 30, 2022

Comments

  • Mitulát báti
    Mitulát báti almost 2 years

    I'm following the training on the developer.android.com site and when I arrived at the Building your first app / Starting another activity section I failed:

    I've added the android-support-v7-appcompat library according to this site describes: http://developer.android.com/tools/support-library/setup.html#libs-with-res

    Where I select the libraries for an android project (Properties of the project / Android / Library) I clicked the add button, selected the project library (first picture), and after I pressed ok the project didn't build.

    Before (everything is ok) Before click ok

    After Somehow it failed when I ok'd the window.

    Before all this... I was somehow able to build the project, press the Play, but it unfortunately stopped (crashed) on my device immediately after starting. And the console said:

    [2014-07-23 15:06:45 - android-support-v7-appcompat] Could not find android-support-v7-appcompat.apk!
    

    and that was the point when I started investigating the problem... yet unsuccessfully.

    My question is, why "deactivating" the library after I check again?

  • Mitulát báti
    Mitulát báti almost 10 years
    Yeah, that can be a problem since I have my proj. and lib. on two different drives. Now I'm moving eclipse...
  • SeanLabs
    SeanLabs over 9 years
    +1000. Wasted a day on this, problem was that the lib. was on a different drive. Android development seems to kludgy, why can't someone the size of Google be on top of this?