Eclipse giving an error of android.support.v7.widget.GridLayout failed to instantiate

五迷三道 提交于 2019-11-29 10:00:06

Update your Compatibility Library to revision 8, then follow the instruction in README.txt file in "extras\android\compatibility\v7\gridlayout" folder.

Hope this help you.

Notes: You must use grid:columnCount="6" instead of android.support.v7.widget.columnCount="6" because you declare the prefix "grid" in xmlns:grid="http://schemas.android.com/apk/res-auto".

  1. update eclipse, adt (even to version 20 preview 2) , sdk manager and the support library .

  2. try to restart eclipse and see if that helps.

  3. try to create a totally new project (with low sdk being used for the min and target sdk , but not for the one specified on the project.properties file ) and drag the gridLayout in the visual editor. this will automatically add the needed library.

  4. if nothing helps , try this example : http://code.google.com/p/android-playground/source/checkout

I try a number of solution provided by different contributor (eg restart Eclipse, removing and adding libary etc)

After looking at this site, I did the following:

  1. Replace all the library android-support-v4.jar with the android-sdk (hoping that it will be the latest copy)
  2. I commented the Gridlayout in xml and use the layout editor just drag gridlayout.

After that everything works for me. I am not sure which step is the one that fix it but there is no harm trying.

It seems you are doing for Android L but anyway include this line inside your styles.xml.

<item name="windowActionBar">false</item> 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!