android.support.v7.widget.GridLayout cannot get it to work

╄→尐↘猪︶ㄣ 提交于 2019-11-29 02:59:41

Try using Gradle, and in your build.gradle file add the following section at the end:

dependencies {
  implementation 'com.android.support:gridlayout-v7:28.0.0'
  implementation 'com.android.support:appcompat-v7:28.0.0'
}

Then execute assembleDebug gradle task.

nsvir

With Android Studio:

  • Go in the build.gradle and add:

    compile 'com.android.support:appcompat-v7:18.0.+'
    

    in your dependencies.

  • Sync your project by clicking the icon on the left of AVD manager. It will implement the library

  • And try again

With Eclipse try this: Gridview v7 support for older api android.support.v7.widget.Gridlayout failed to instaniate

Refer from http://developer.android.com/tools/support-library/features.html#v7-gridlayout, you should import gridlayout as a eclipse project, then add it as an library project into your project, make sure the build path has included the jar.

In my case I fixed it setting:

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" />

in the gridlayout_v7 project manifest file.

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