Ошибка, вызванная org.xmlpull.v1.XmlPullParserException

#java #android #xml #textview

#java #Android #xml #textview

Вопрос:

Вызвано org.xmlpull.v1.XmlPullParserException (Android 4.4.4 и 4.4.2) Строка двоичного XML-файла # 1: недопустимый вектор для рисования тегов mobile.push.PushAdapter.onCreateViewHolder (PushAdapter.java:68)

Это мой держатель

     private class UserViewHolder extends RecyclerView.ViewHolder {
    TextView title;
    TextView time;
    TextView short_text;
    TextView body;
    View view1;
    ExpandableLayout expand;

    public UserViewHolder(View view) {
        super(view);
        view1 = view.findViewById(R.id.container);
        title = view.findViewById(R.id.title);
        time = view.findViewById(R.id.time);
        short_text = view.findViewById(R.id.short_text);
        body = view.findViewById(R.id.body);
        expand = view.findViewById(R.id.expand);
    }
}
  

строка : 68 ->

 //onCreateViewHolder
        View view = LayoutInflater.from(activity).inflate(R.layout.item_push, parent, false);
        return new UserViewHolder(view);
  

XML item_push.xml

     <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TextView
            android:id="@ id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>

        <TextView
            android:id="@ id/short_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>

        <TextView
            android:id="@ id/time"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="2018-02-01 04:54" />

        <net.cachapa.expandablelayout.ExpandableLayout
            android:id="@ id/expand"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:el_duration="1000"
            app:el_expanded="false"
            app:el_parallax="0.5">

            <TextView
                android:id="@ id/body"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
        </net.cachapa.expandablelayout.ExpandableLayout>
  

Что мне делать? Не удается протестировать на Android 4.4.2

Ответ №1:

Добавьте инструкцию в файл build.gradle модуля приложения:

 android {
      defaultConfig {
        vectorDrawables.useSupportLibrary = true
      }
    }
  

Проверьте это

Комментарии:

1. Используется, не помогает