简体   繁体   English

GridLayout兼容性 - ClassNotFoundException:未找到类“android.support.v7.widget.GridLayout”

[英]GridLayout compatibility - ClassNotFoundException: Didn't find class “android.support.v7.widget.GridLayout”

I'm trying to use GridLayout in my Android 2.2 project, and after having installed the gridlayout_v7 project in my workspace, adding it to my projects Android Dependencies, adding a custom xmlns for its custom attributes, and embedding it in my xml layout as such: 我正在尝试在Android 2.2项目中使用GridLayout,并在我的工作区中安装了gridlayout_v7项目后,将其添加到我的项目Android Dependencies中,为其自定义属性添加自定义xmlns,并将其嵌入到我的xml布局中:

<android.support.v7.widget.GridLayout
    android:layout_width="match_parent"
    android:layout_height="300dp"
    grid:columnCount="2"
    grid:rowCount="3" >

    <include
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        layout="@layout/quick_contact" />
    <include
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        layout="@layout/quick_contact" />
    <include
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        layout="@layout/quick_contact" />
    <include
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        layout="@layout/quick_contact" />
    <include
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        layout="@layout/quick_contact" />
    <include
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        layout="@layout/quick_contact" />
</android.support.v7.widget.GridLayout>

I started getting the following exception at runtime: 我在运行时开始收到以下异常:

java.lang.ClassNotFoundException: Didn't find class 
"android.support.v7.widget.GridLayout" on path: DexPathList[[zip file 
"system/framework/android.test.runner.jar", zip file "data/app/<app package>.apk"], 
nativeLibraryDirectories=[data/app-lib/<app package>, /vendor/lib, /system/lib]]

I have tried cleaning and rebuilding, removing the library and adding it again but to no avail. 我已经尝试过清理和重建,删除库并再次添加它但无济于事。 Any ideas as to what may be causing this? 关于可能导致这种情况的任何想法?

I saw this error. 我看到了这个错误。 For me, I had to include grid layout specifically in my dependencies like so: 对我来说,我必须在我的依赖项中特别包含网格布局,如下所示:

dependencies {
   ...
   compile 'com.android.support:gridlayout-v7:18.0.+'
}

See more here about how to include support libraries: https://developer.android.com/tools/support-library/features.html 有关如何包含支持库的详细信息,请参阅此处: https//developer.android.com/tools/support-library/features.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “ ClassNotFoundException:android.support.v7.widget.GridLayout”,即使实际上已导入 - “ClassNotFoundException: android.support.v7.widget.GridLayout” even if it is actually imported IntelliJ和android.support.v7.widget.GridLayout - IntelliJ and android.support.v7.widget.GridLayout 支持lib android.support.v7.widget.GridLayout导致InflateException / ClassNotFoundException与应用程序小部件 - support lib android.support.v7.widget.GridLayout causes InflateException / ClassNotFoundException with app widgets Android - Gridlayout android.support.v7.widget.GridLayout 不能转换为 android.widget.GridLayout - Android - Gridlayout android.support.v7.widget.GridLayout cannot be cast to android.widget.GridLayout android.support.v7.widget.GridLayout无法实例化 - android.support.v7.widget.GridLayout can not instantiate android.support.v7.widget.GridLayout无法实例化 - android.support.v7.widget.GridLayout failed to instantiate 混淆android.support.v7.widget.GridLayout问题 - Obfuscate android.support.v7.widget.GridLayout issue android.support.v7.widget.GridLayout 无法让它工作 - android.support.v7.widget.GridLayout cannot get it to work 无法在android.support.v7.widget.GridLayout中使用columnCount属性 - Unable to use columnCount attribute in android.support.v7.widget.GridLayout 运用 <include> 在android.support.v7.widget.GridLayout中无法正确显示 - Using <include> in android.support.v7.widget.GridLayout not displaying correctly
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM