package android.support.v4.app does not exist ; in Android studio 0.8

user3381665 picture user3381665 · Jul 3, 2014 · Viewed 126.1k times · Source

I've recently updated the android studio IDE to 0.8 to work with the new android L SDK. To start I imported a finished android project that receives no errors in the older version of android studio. In version 0.8 i lines such as

import android.support.v4.app.Fragment;
get: Support cannot be resolved causing the rest of the code to have errors. The logcat returns 101 instances of

Error:(8, 30) error: package android.support.v4.app does not exist

1 for each time I call the support library in an import statement.

I've tried

  • reinstalling the IDE
  • deleting contents of idea folder
  • re installing all the SDK's - including the support libraries
  • syncing the gradle
  • copying the support library into the libs folder manually
  • rebuilding the project
  • as well as creating a new project to test the library

not entirely sure what's left to do.

Answer

Bernhardt Scherer picture Bernhardt Scherer · Oct 28, 2014

Ok, so I had the same problem and found a solution in a udacity forum:

In Android Studio:

  1. Right click on your projects "app" folder and click on -> module settings
  2. Click on the "dependencies" tab
  3. Click on the + sign to add a new dependency and select "Library Dependency"
  4. Look for the library you need and add it