2015-06-23 123 views
1

在Android Studio中改变布局时,我得到的错误:找不到任何android.support.v4.widget Android Studio中

以下类找不到:

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

以下类找不到:

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

并且它不显示任何布局。我已经像这样设置了Gradle:

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支持库。在此项目从Eclipse项目导入之前。如果我使用导航抽屉活动创建了一个新项目(使用android.support.v4.widget.DrawerLayout),它看起来像是起作用并显示布局。

+0

转到SDK管理器和下载Android的支持库,看看 – Nabin

+0

@Nabin Android支持库已经安装了先生.. –

+0

您是否运行过“级别清洁”? –

回答

2

此问题的Android工作室的版本。要解决这个问题:

  1. 安装最新更新的Android工作室(目前Android工作室测试版1.3金丝雀香奈儿)

  2. 的Invalidate /重启

0

在android studio中检查android SDK的路径。因为我填写。在你的eclipse项目中android SDK的路径是不同于android studio。所以当你创建新项目时,它的工作非常完美。但是当你输入你的项目将其定位在那里支持LIB不在

enter image description here

我跳路径上的SDK,这将帮助你

+0

Android SDK路径与在eclipse中相同。我在一个目录路径设置:( –

相关问题