>

Fatal Exception: android.view.InflateException: Binary XML file line #33: Error inflating class TextView at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:714) at android.view.LayoutInflater.rInflate(LayoutInflater.java:756) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at wscconnect.android.adapters.AppAdapter.onCreateViewHolder(SourceFile:70) at wscconnect.android.adapters.AppAdapter.onBindViewHolder(SourceFile:56) at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(SourceFile:6487) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(SourceFile:5674) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(SourceFile:5557) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(SourceFile:5553) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(SourceFile:2229) at android.support.v7.widget.GridLayoutManager.layoutChunk(SourceFile:556) at android.support.v7.widget.LinearLayoutManager.fill(SourceFile:1516) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(SourceFile:608) at android.support.v7.widget.GridLayoutManager.onLayoutChildren(SourceFile:170) at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(SourceFile:3693) at android.support.v7.widget.RecyclerView.dispatchLayout(SourceFile:3410) at android.support.v7.widget.RecyclerView.onLayout(SourceFile:3962) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.support.v4.widget.SwipeRefreshLayout.onLayout(SourceFile:610) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525) at android.widget.LinearLayout.onLayout(LinearLayout.java:1434) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.support.v7.widget.ActionBarOverlayLayout.onLayout(SourceFile:443) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525) at android.widget.LinearLayout.onLayout(LinearLayout.java:1434) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1987) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1744) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) at android.view.Choreographer.doCallbacks(Choreographer.java:574) at android.view.Choreographer.doFrame(Choreographer.java:544) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5021) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(NativeStart.java) Caused by android.content.res.Resources$NotFoundException: File res/drawable/ic_notifications_white_12dp.xml from drawable resource ID #0x7f020064 at android.content.res.Resources.loadDrawable(Resources.java:2101) at android.content.res.TypedArray.getDrawable(TypedArray.java:602) at android.widget.TextView.(TextView.java) at android.support.v7.widget.AppCompatTextView.(SourceFile) at android.support.v7.widget.AppCompatTextView.(SourceFile) at android.support.v7.app.AppCompatViewInflater.createView(SourceFile:103) at android.support.v7.app.AppCompatDelegateImplV9.createView(SourceFile:1024) at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(SourceFile:1081) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685) at android.view.LayoutInflater.rInflate(LayoutInflater.java:756) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at wscconnect.android.adapters.AppAdapter.onCreateViewHolder(SourceFile:70) at wscconnect.android.adapters.AppAdapter.onBindViewHolder(SourceFile:56) at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(SourceFile:6487) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(SourceFile:5674) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(SourceFile:5557) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(SourceFile:5553) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(SourceFile:2229) at android.support.v7.widget.GridLayoutManager.layoutChunk(SourceFile:556) at android.support.v7.widget.LinearLayoutManager.fill(SourceFile:1516) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(SourceFile:608) at android.support.v7.widget.GridLayoutManager.onLayoutChildren(SourceFile:170) at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(SourceFile:3693) at android.support.v7.widget.RecyclerView.dispatchLayout(SourceFile:3410) at android.support.v7.widget.RecyclerView.onLayout(SourceFile:3962) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.support.v4.widget.SwipeRefreshLayout.onLayout(SourceFile:610) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525) at android.widget.LinearLayout.onLayout(LinearLayout.java:1434) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.support.v7.widget.ActionBarOverlayLayout.onLayout(SourceFile:443) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525) at android.widget.LinearLayout.onLayout(LinearLayout.java:1434) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1987) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1744) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) at android.view.Choreographer.doCallbacks(Choreographer.java:574) at android.view.Choreographer.doFrame(Choreographer.java:544) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5021) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(NativeStart.java) Caused by org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933) at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877) at android.content.res.Resources.loadDrawable(Resources.java:2097) at android.content.res.TypedArray.getDrawable(TypedArray.java:602) at android.widget.TextView.(TextView.java) at android.support.v7.widget.AppCompatTextView.(SourceFile) at android.support.v7.widget.AppCompatTextView.(SourceFile) at android.support.v7.app.AppCompatViewInflater.createView(SourceFile:103) at android.support.v7.app.AppCompatDelegateImplV9.createView(SourceFile:1024) at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(SourceFile:1081) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685) at android.view.LayoutInflater.rInflate(LayoutInflater.java:756) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at wscconnect.android.adapters.AppAdapter.onCreateViewHolder(SourceFile:70) at wscconnect.android.adapters.AppAdapter.onBindViewHolder(SourceFile:56) at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(SourceFile:6487) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(SourceFile:5674) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(SourceFile:5557) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(SourceFile:5553) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(SourceFile:2229) at android.support.v7.widget.GridLayoutManager.layoutChunk(SourceFile:556) at android.support.v7.widget.LinearLayoutManager.fill(SourceFile:1516) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(SourceFile:608) at android.support.v7.widget.GridLayoutManager.onLayoutChildren(SourceFile:170) at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(SourceFile:3693) at android.support.v7.widget.RecyclerView.dispatchLayout(SourceFile:3410) at android.support.v7.widget.RecyclerView.onLayout(SourceFile:3962) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.support.v4.widget.SwipeRefreshLayout.onLayout(SourceFile:610) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525) at android.widget.LinearLayout.onLayout(LinearLayout.java:1434) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.support.v7.widget.ActionBarOverlayLayout.onLayout(SourceFile:443) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525) at android.widget.LinearLayout.onLayout(LinearLayout.java:1434) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) at android.widget.FrameLayout.onLayout(FrameLayout.java:388) at android.view.View.layout(View.java:14817) at android.view.ViewGroup.layout(ViewGroup.java:4631) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1987) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1744) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) at android.view.Choreographer.doCallbacks(Choreographer.java:574) at android.view.Choreographer.doFrame(Choreographer.java:544) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5021) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(NativeStart.java)

Android 4.4.2에서는이 줄에서 발생합니다. 다른 여러 버전에서는 제대로 작동합니다.

View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_app, parent, false);

내 레이아웃은 다음과 같습니다 :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="5dp">
    <android.support.v7.widget.CardView
        android:id="@+id/card_challenge_card_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        card_view:cardElevation="0dp"
        card_view:cardMaxElevation="0dp"
        card_view:cardUseCompatPadding="true">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#f6f6f6">
            <FrameLayout
                android:id="@+id/card_challenge_cover_container"
                android:layout_width="match_parent"
                android:layout_height="70dp">
                <ImageView
                    android:id="@+id/list_app_logo"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="?attr/selectableItemBackgroundBorderless"
                    android:scaleType="centerCrop" />
                <TextView
                    android:id="@+id/list_app_unread_notifications"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/badge"
                    android:textColor="#ffffff"
                    android:textSize="10sp"
                    android:drawablePadding="2dp"
                    android:drawableStart="@drawable/ic_notifications_white_12dp"
                    android:layout_gravity="bottom|start"
                    android:layout_marginBottom="3dp"
                    android:layout_marginStart="3dp"
                    android:visibility="gone" />
                <TextView
                    android:id="@+id/list_app_users"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:drawablePadding="2dp"
                    android:drawableStart="@drawable/ic_people_white_12dp"
                    android:textColor="#ffffff"
                    android:layout_gravity="bottom|end"
                    android:layout_marginBottom="3dp"
                    android:layout_marginEnd="3dp"
                    android:background="@drawable/badge_primary"
                    android:textSize="10sp" />
            </FrameLayout>
            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/card_challenge_cover_container"
                android:padding="5dp">
                <TextView
                    android:id="@+id/list_app_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentStart="true"
                    android:ellipsize="end"
                    android:maxLines="2"
                    android:textSize="11sp"
                    android:textStyle="bold" />
                <TextView
                    android:id="@+id/list_app_url"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentStart="true"
                    android:layout_below="@id/list_app_name"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:textSize="11sp" />
            </RelativeLayout>
        </RelativeLayout>
    </android.support.v7.widget.CardView>
</LinearLayout>

  • 답변 # 1

    드로어 블 벡터는 일반적으로 지원 라이브러리를 사용할 때 사전 롤리팝 장치에서 작동합니다. 어떻게 든 그들은 drawableStart 에서 작동하지 않습니다 drawableEnd  등의 속성.

    내 교체

          <TextView
                    android:id="@+id/list_app_users"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:drawablePadding="2dp"
                    android:drawableStart="@drawable/ic_people_white_12dp"
                    android:textColor="#ffffff"
                    android:layout_gravity="bottom|end"
                    android:layout_marginBottom="3dp"
                    android:layout_marginEnd="3dp"
                    android:background="@drawable/badge_primary"
                    android:textSize="10sp" />
    
    

    모든 장치에서 작동하는 약간 더 복잡한 레이아웃 :

               <LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
                    android:id="@+id/list_app_users_container"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom|end"
                    android:layout_marginBottom="3dp"
                    android:layout_marginEnd="3dp"
                    android:background="@drawable/badge_primary">
                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginEnd="3dp"
                        app:srcCompat="@drawable/ic_people_white_12dp" />
                    <TextView
                        android:id="@+id/list_app_users"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textColor="#ffffff"
                        android:textSize="10sp" />
                </LinearLayout>
    
    

  • 답변 # 2

    이 파일은 프로젝트 res/drawable/ic_notifications_white_12dp.xml에 없습니다

    이 줄을 제거해야합니다

                       android:drawableStart="@drawable/ic_notifications_white_12dp"
    
    

    이것이 도움이 되길 바랍니다.

  • 답변 # 3

    LayoutInflater inflater = LayoutInflater.from(getContext());
    convertView = inflater.inflate(R.layout.list_app, parent, false);
    
    

관련 자료

  • 이전 vba - MS Word의 특정 섹션에서 페이지 번호 매기기를 계속 하시겠습니까?
  • 다음 select2 - select2 - enter 버튼으로 태그 추가