title: Using Constraint View with databinding causes error "Execution failed for task ':app:mergeDebugResources'. >
body: <p>I'm a little new to android app development so forgive me in advance for being a newbie!  I've been fighting an issue that I can't find a resolution for on any boards.  I'm experiencing it in a larger project I'm working on but I've dumbed it down to the below test harness.  It seems to only occur when I combine databinding and constraint views.  Once I encounter the error even if I clear all of my constraints on the controls and rebuild them in a way that typically builds the error persists.  The only way out is to cntrl-z and redraw constraints in a way that will build or revert to a backup copy of the project. very odd. The effect I was going for with the text and button views was for them to be attached to each other more or less.</p>
  
  <p>1) Create <code>New Project &gt; Target API 19 4.4KitKat &gt; Empty Activity</code></p>
  
  <p>2) Change app gradle to implementation <code>com.android.support:appcompat-v7:28.0.0-alpha1</code> (otherwise the RC01 makes design view of <code>ActivityMain.XML</code> in the IDE not work)</p>
  
  <p>3) Add <code>dataBinding.enabled = true</code> to the app gradle</p>
  
  <p>4) Wrap the Constraint View in <code>ActivityMain.xml</code> with <code>&lt;layout&gt;&lt;/layout&gt;</code> (this is to make databinding work)</p>
  
  <p>5) In Design View of <code>ActivityMain.xml</code>, Drag a TextView and a Button on the screen</p>
  
  <p>6) Constrain the TextView left to the parent left and the TextView top to the parent top</p>
  
  <p>7) Constrain the Button top to the TextView Bottom, the button right to the parent right and the button left to the TextView left</p>
  
  <p>7) Sync project with gradle files >> get error below</p>
  
  <p>I've also provided the contents of <code>ActivityMain.xml</code> below.</p>
  
  <pre><code>Executing tasks: [:app:generateDebugSources]
  
  Configuration on demand is an incubating feature.
  :app:preBuild UP-TO-DATE
  :app:preDebugBuild UP-TO-DATE
  :app:compileDebugAidl UP-TO-DATE
  :app:compileDebugRenderscript UP-TO-DATE
  :app:checkDebugManifest UP-TO-DATE
  :app:generateDebugBuildConfig UP-TO-DATE
  :app:prepareLintJar UP-TO-DATE
  :app:mainApkListPersistenceDebug UP-TO-DATE
  :app:generateDebugResValues UP-TO-DATE
  :app:generateDebugResources UP-TO-DATE
  AGPBI: {"kind":"error","text":"error: duplicate attribute.","sources":[{"file":"C:\\Users\\justi\\AndroidStudioProjects\\MyApplication\\app\\src\\main\\res\\layout\\activity_main.xml","position":{"startLine":10}}],"original":"","tool":"AAPT"}
  :app:mergeDebugResources FAILED
  
  FAILURE: Build failed with an exception.
  </code></pre>
  
  <ul>
  <li><p>What went wrong:
  Execution failed for task <code>:app:mergeDebugResources</code>.</p>
  
  <blockquote>
    <p>Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details</p>
  </blockquote></li>
  <li><p>Try:</p></li>
  </ul>
  
  <p>Run with <code>--stacktrace</code> option to get the stack trace. Run with <code>--info</code> or <code>--debug</code> option to get more log output. Run with <code>--scan</code> to get full insights.</p>
  
  <ul>
  <li>Get more help at <a href="https://help.gradle.org" rel="nofollow noreferrer">https://help.gradle.org</a></li>
  </ul>
  
  <p>BUILD FAILED in 1s<br>
  9 actionable tasks: 1 executed, 8 up-to-date</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout 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"&gt;
  &lt;android.support.constraint.ConstraintLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".MainActivity"&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Hello World!"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintLeft_toLeftOf="parent"
      app:layout_constraintRight_toRightOf="parent"
      app:layout_constraintTop_toTopOf="parent" /&gt;
  
  &lt;TextView
      android:id="@+id/textView2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginStart="80dp"
      android:layout_marginTop="8dp"
      android:text="TextView"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent" /&gt;
  
  &lt;Button
      android:id="@+id/button2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginEnd="8dp"
      android:text="Button"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="@+id/textView2"
      app:layout_constraintTop_toBottomOf="@+id/textView2" /&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p></p>