I'm trying to generate the signed bundle to publish my first app, but I cannot make it compile and I have look for every error and can't find an answer. This is the error message:
Task :app:mergeReleaseResources
C:\Users\TNS SAS\AndroidStudioProjects\numBus\app\build\intermediates
\incremental\mergeReleaseResources\stripped.dir\layout
\activity_main.xml:17:53: Id 'id/ button' has an invalid entry name ' button'.
C:\Users\TNS SAS\AndroidStudioProjects\numBus\app\build\intermediates
\incremental\mergeReleaseResources\stripped.dir\layout
\activity_main.xml: Failure to compile the resource file.
Task :app:mergeReleaseResources FAILED
Execution failed for task ':app:mergeReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
Resource compilation failed. Check logs for details.
The original .xml that makes reference is this code:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="40dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="40dp"
android:layout_marginBottom="20dp"
android:contentDescription="logo"
app:layout_constraintBottom_toTopOf="@+id/tvCedula"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/logo" />
<EditText
android:id="@+id/tvCedula"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:ems="10"
android:hint="Cédula"
android:inputType="number"
android:minHeight="48dp"
android:textColorHighlight="@color/purple_500"
android:textColorLink="@color/purple_200"
app:layout_constraintBottom_toTopOf="@+id/tvPlaca"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintStart_toStartOf="parent"/>
<EditText
android:id="@+id/tvPlaca"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:ems="10"
android:hint="Placa"
android:inputType="textAutoComplete"
android:minHeight="48dp"
app:layout_constraintBottom_toTopOf="@+id/spinnerEmpresas"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:textAllCaps="true" />
<Spinner
android:id="@+id/spinnerEmpresas"
android:layout_width="220dp"
android:layout_height="48dp"
android:layout_marginBottom="16dp"
android:animationCache="false"
android:dropDownWidth="wrap_content"
android:ems="10"
android:minHeight="48dp"
android:spinnerMode="dropdown"
app:layout_constraintBottom_toTopOf="@+id/sign_in_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="SpeakableTextPresentCheck" />
<com.google.android.gms.common.SignInButton
android:id="@+id/sign_in_button"
android:layout_width="wrap_content"
android:layout_height="55dp"
android:layout_marginBottom="150dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
When I look at the file that it's assembling, it is this:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.google.android.gms.common.SignInButton
android:id="@+id/ button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
The solution is not deleting resources.... not to delete apcompability in gradle....