2015年4月11日 星期六

The following classes could not be found: - android.support.v7.internal.widget.ActionBarOverlayLayout on android studio

Layout Rendering Problems on android studio


環境:android studio 1.1.0
編譯版本: API 22

當使用android studio 創建專案(create Project) 時,你的專案最小相容版本(minSdkVersion )  低於21時,經常在layout/activity_main.xml檔案 在顯示圖形化時經常會遇到以下錯誤,就算你照他的Fix Build Path, Edit XML, Create Class三個選項下去操作,還是不會有任何反應


The following classes could not be found: - android.support.v7.internal.widget.ActionBarOverlayLayout (Fix Build Path, Edit XML, Create Class) Tip: Try to build the project.



所以要去build.gradle 加入下面這行,就不會有錯誤拉。

compile 'com.android.support:gridlayout-v7:22.0.0'

或者

到file->Project->APP->Dependencies->right + ->Library Dependency -> lookup com.android.support:gridlayout-v7:22.0.0-> OK




沒有留言:

張貼留言