Error:(44) No Resource Identifier found for attribute 'srcCompat' in package 'my package name'

Asked

Viewed 161 times

0

Hello,

When I open my project, the following error occurs: Error:(44) No Resource Identifier found for attribute 'srcCompat' in package. And the R of my layout, does not find the layouts and with that all my classes get error. Here are some images: Mensagem do erro R fica vermelho nas classes

XML of one of the activities (list_layout_message)

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

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <TextView
            android:id="@+id/textViewUsuario"
            android:layout_width="320dp"
            android:layout_height="30dp"
            android:text="TextView"
            android:textAppearance="@style/Base.TextAppearance.AppCompat.Large" />

        <TextView
            android:id="@+id/textViewDatas"
            android:layout_width="50dp"
            android:layout_height="30dp"
            android:layout_alignParentEnd="true"
            android:layout_alignParentTop="true"
            android:text="Data" />

        <TextView
            android:id="@+id/textViewTexto"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_below="@+id/textViewUsuario"
            android:text="TextView" />

        <TextView
            android:id="@+id/textView2"
            android:layout_width="match_parent"
            android:layout_height="5dp"
            android:layout_alignParentStart="true"
            android:layout_below="@+id/fbtnRespMensagem"
            android:text="TextView" />

        <android.support.design.widget.FloatingActionButton
            android:id="@+id/fbtnRespMensagem"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignStart="@+id/textViewDatas"
            android:layout_below="@+id/textViewTexto"
            android:clickable="true"
            android:onClick="respostaMensagem"
            app:backgroundTint="#2397f3"
            app:fabSize="mini"
            app:srcCompat="@android:drawable/ic_menu_revert" />
    </RelativeLayout>

</LinearLayout>

Can anyone help me? I’ve looked everywhere, and no solution :/

  • Check for errors in layout list_layout_message.

  • @ramaral I have checked, and does not present error. I do not know if you have noticed, but, all layouts are with this problem.

  • This is because of the R class. Add the layout code to the question list_layout_message.

  • @ramaral XML added.

1 answer

2

Apparently the mistake is in app:srcCompat="@android:drawable/ic_menu_revert".

With the information provided, I cannot know why.

For now, you can solve the problem by replacing

app:srcCompat="@android:drawable/ic_menu_revert"

for

android:src="@android:drawable/ic_menu_revert"
  • ramaral, made here and now resulted in error Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.Processexception: Failed to execute aapt Error:No Resource Identifier found for attribute 'roundIcon' in package 'android'.

  • Where are you wearing roundIcon?

  • I’ve been looking for the roundIcon, but I can’t find anything and I don’t remember using anything by that name.

  • Do a Clean Project on Build->Clean Project

  • I did the clean, and then the rebuild... the error persists :/

  • You must find where roundIcon is being used, It is best to give this question as solved and then ask another question, since it is another problem.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.