2015-06-23 116 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中相同。我在一個目錄路徑設置:( –

相關問題