Amay Diam
Amay Diam

Reputation: 2591

Could not be found any android.support.v4.widget in Android Studio

In Android Studio I get errors when changing the layout:

The following classes could not be found:

- android.support.v4.widget.DrawerLayout (Fix Build Path, Create Class)

or

The following classes could not be found:

- android.support.v4.widget.SwipeRefreshLayout (Fix Build Path, Create Class)

and it does not display any layout. I have set Gradle like this:

dependencies {
    compile project(':libraryfab')
    compile 'com.google.android.gms:play-services:+'
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile files('libs/apache-mime4j-0.6.jar')
    compile files('libs/httpmime-4.1.3.jar')
    compile files('libs/jetbrains-annotations.jar')
    compile files('libs/nineoldandroids-2.4.0.jar')
    compile files('libs/picasso-2.4.0.jar')
    compile files('libs/pinchzoom.jar')
    compile files('libs/universal-image-loader-1.9.3-with-sources.jar')
    compile files('libs/volley.jar')
    compile files('libs/YouTubeAndroidPlayerApi.jar')
}

Android Support Library is installed. Before this project is importing from Eclipse Project. If I create a new project with Navigation Drawer Activity (use android.support.v4.widget.DrawerLayout), it looks like it works and displays the layout.

Upvotes: 1

Views: 2361

Answers (2)

Amay Diam
Amay Diam

Reputation: 2591

This Issue From Version of ANdroid Studio. To fix it :

  1. Install Last Update Android Studio (current Android STudio Beta 1.3 Canary Chanel)

  2. Invalidate/Restart

Upvotes: 2

sourabh devpura
sourabh devpura

Reputation: 625

Check the path of android SDK in android studio . cos as i fill . in your eclipse project android SDK path is Different then android studio . so when you create new project it work perfect . but when you import your project it target the SDK on the path where support lib not located

enter image description here

I hop this will help you

Upvotes: 0

Related Questions