错误:(25)在'com.myapp.test'包中找不到属性'el_header_text'的资源标识符

时间:2015-09-09 08:01:18

标签: android android-layout android-listview

我的build.gradle文件看起来像这样

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    defaultConfig {
        applicationId "com.myapp.test"
        minSdkVersion 23
        targetSdkVersion 23
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_6
        targetCompatibility JavaVersion.VERSION_1_6
    }
    productFlavors {
    }
}

dependencies {
    compile 'com.android.support:support-v4:23.0.1'
    compile 'com.google.code.gson:gson:2.3.1'
    compile files('libs/androidasync-2.1.6.jar')
    compile files('libs/androidsvg-1.2.0.jar')
    compile files('libs/ion-2.1.6.jar')
    compile files('libs/itextpdf-5.4.5.jar')
    compile files('libs/picasso-2.5.2.jar')
    // Google Play Services
    compile 'com.google.android.gms:play-services:7.8.0'
    // Support Libraries
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.android.support:gridlayout-v7:23.0.1'
    //    compile 'com.android.support:leanback-v17:23.0.0'
    compile 'com.android.support:mediarouter-v7:23.0.1'
    compile 'com.android.support:palette-v7:23.0.1'
    compile 'com.android.support:recyclerview-v7:23.0.1'
    //compile 'com.android.support:support-annotations:23.0.0'
    //compile 'com.android.support:support-v13:23.0.0'
    compile 'com.github.traex.expandablelayout:library:1.3'
}

当我尝试进行构建时,我得到的错误是一系列“没有资源标识符和没有资源匹配”。我尝试了更改sdk版本,目标sdk版本的所有组合,但仍然最终收到此错误如下所示。

/Users/demo/Documents/Work/test/android/playwith/app/src/main/res/layout/original_settings.xml
Error:(25) No resource identifier found for attribute 'el_header_text' in package 'com.myapp.test'
Error:(37) No resource identifier found for attribute 'el_header_text' in package 'com.myapp.test'

Error:(6, 29) No resource found that matches the given name (at 'drawable' with value '@drawable/down').

我一直试图解决这个问题但过去24小时没有成功。请帮忙

我的original_settings.xml文件看起来像这样

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:expandable="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    android:orientation="vertical" >

    <com.ids.compliance.views.HeaderView
        android:id="@+id/header_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="@dimen/space_ten" >

        <LinearLayout
            android:id="@+id/ll_expandbl_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <com.andexert.expandablelayout.library.ExpandableLayout
                android:id="@+id/expndbl_inline"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                expandable:el_contentLayout="@layout/frag_inline_process"
                expandable:el_header_text="@string/inline_process" />

            <View
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="@color/black" />

            <com.andexert.expandablelayout.library.ExpandableLayout
                android:id="@+id/expndbl_inspection"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                expandable:el_contentLayout="@layout/frag_inspec_mode"
                expandable:el_header_text="@string/inspection_mode" />

            <View
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="@color/black" />

            <com.andexert.expandablelayout.library.ExpandableLayout
                android:id="@+id/expndbl_view_mode"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                expandable:el_contentLayout="@layout/frag_view_options"
                expandable:el_header_text="@string/view_options" />

            <View
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="@color/black" />

            <com.andexert.expandablelayout.library.ExpandableLayout
                android:id="@+id/expndbl_build"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                expandable:el_contentLayout="@layout/frag_build_selection"
                expandable:el_header_text="@string/build_sel_mode" />

            <View
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="@color/black" />

            <com.andexert.expandablelayout.library.ExpandableLayout
                android:id="@+id/expndbl_status"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                expandable:el_contentLayout="@layout/fragment_status_bar"
                expandable:el_header_text="@string/device_status_bar" />

            <View
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="@color/black" />

            <com.andexert.expandablelayout.library.ExpandableLayout
                android:id="@+id/expndbl_work_order"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                expandable:el_contentLayout="@layout/fragment_workorder"
                expandable:el_header_text="@string/auto_create" />

            <View
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="@color/black" />

            <!-- TextView Setting -->

            <LinearLayout
                android:id="@+id/ll_text_setting"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/expand_view_color"
                android:gravity="center_vertical"
                android:padding="10dp" >

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/text_setting"
                    android:textColor="@color/black"
                    android:textSize="18sp" />

                <RelativeLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1" >

                    <ImageView
                        android:layout_width="20dp"
                        android:layout_height="20dp"
                        android:layout_alignParentRight="true"
                        android:scaleType="fitXY"
                        android:src="@drawable/down" />
                </RelativeLayout>
            </LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="@color/black" />

            <!-- Polygon Setting -->

            <LinearLayout
                android:id="@+id/ll_polygon_setting"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/expand_view_color"
                android:gravity="center_vertical"
                android:padding="10dp" >

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/poly_setting"
                    android:textColor="@color/black"
                    android:textSize="18sp" />

                <RelativeLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1" >

                    <ImageView
                        android:layout_width="20dp"
                        android:layout_height="20dp"
                        android:layout_alignParentRight="true"
                        android:scaleType="fitXY"
                        android:src="@drawable/down" />
                </RelativeLayout>
            </LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="@color/black" />

            <LinearLayout
                android:id="@+id/ll_admin"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/expand_view_color"
                android:gravity="center_vertical"
                android:padding="10dp" >

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/admin_panel"
                    android:textColor="@color/black"
                    android:textSize="18sp" />
            </LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="2dp"
                android:background="@color/black" />
        </LinearLayout>
    </ScrollView>

</LinearLayout>

2 个答案:

答案 0 :(得分:0)

可扩展布局库中没有el_header_text属性。您可以在the source code中查看所有可用属性。

你可能没有down抽签。

答案 1 :(得分:0)

此库中没有“el_header_text”属性,请在此处查看源代码:https://github.com/traex/ExpandableLayout/blob/master/library/src/main/res/values/attrs.xml

你在哪里看到这个attr?