title: NativeScript Android: Command gradlew.bat failed with exit code 1
body: <p>I tried to run my NativeScript application via <code>tns run android --log trace</code>. After doing some stuff for quite a long time I get the following error:</p>
  
  <blockquote>
    <p>%my_Path%\platforms\android\src\main\AndroidManifest.xml:27:9-31 Error:
         Attribute meta-data#android.support.VERSION@value value=(25.3.1) from [com.android.support:design:25.3.1] AndroidManifest.xml:27:9-31
      is also present at [com.android.support:support-v4:26.0.0-alpha1] AndroidManifest.xml:27:9-38 value=(26.0.0-alpha1).
       Suggestion: add 'tools:replace="android:value"' to  element at AndroidManifest.xml:25:5-27:34 to override.</p>
    
    <p>See <a href="http://g.co/androidstudio/manifest-merger" rel="nofollow noreferrer">http://g.co/androidstudio/manifest-merger</a> for more information about the manifest merger.</p>
    
    <p>:processF0F1F2F3DebugManifest FAILED</p>
    
    <p>FAILURE: Build failed with an exception.</p>
    
    <ul>
    <li><p>What went wrong:
    Execution failed for task ':processF0F1F2F3DebugManifest'.
    Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.3.1) from [com.android.support:design:25.3.1] AndroidManifest.xml:27:9-31
       is also present at [com.android.support:support-v4:26.0.0-alpha1] AndroidManifest.xml:27:9-38 value=(26.0.0-alpha1).
    Suggestion: add 'tools:replace="android:value"' to  element at AndroidManifest.xml:25:5-27:34 to override.</p></li>
    <li><p>Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.</p></li>
    </ul>
    
    <p>BUILD FAILED</p>
    
    <p>Total time: 1 mins 5.249 secs
    Unable to apply changes on device: emulator-5554. Error is: Command gradlew.bat failed with exit code 1.</p>
  </blockquote>
  
  <p>My setting:</p>
  
  <p><code>npm -v</code> = 3.10.10</p>
  
  <p><code>node -v</code> = v6.11.2</p>
  
  <p><code>JAVA_HOME</code> environment variable is properly set</p>
  
  <p><code>ANDROID_HOME</code> is set to C:...\AppData\Local\Android\android-sdk</p>
  
  <p><code>tns doctor</code> says:</p>
  
  <pre><code>┌──────────────────┬─────────────────┬────────────────┬──────────────────┐
  │ Component        │ Current version │ Latest version │ Information      │
  │ tns-core-modules │ 2.2.1           │ 3.1.1          │ Update available │
  └──────────────────┴─────────────────┴────────────────┴──────────────────┘
  </code></pre>
  
  <p>And <code>tns devices</code>:</p>
  
  <pre><code>┌───┬────────────────┬──────────┬───────────────────┬──────────┬───────────┐
  │ # │ Device Name    │ Platform │ Device Identifier │ Type     │ Status    │
  │ 1 │ sdk_gphone_x86 │ Android  │ emulator-5554     │ Emulator │ Connected │
  └───┴────────────────┴──────────┴───────────────────┴──────────┴───────────┘
  </code></pre>
  
  <p>On iOS that project works properly.</p>
  
  <p>--------------- UPDATE -----------------</p>
  
  <p>After adding the <code>configurations.all</code> dependency to my <code>app.gradle</code> file i get the following error:</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: Class android.support.graphics.drawable.AnimatedVectorDrawableCompat$AnimatedVectorDrawableCompatState conflict: %my_path%\platforms\android\build\intermediates\exploded-aar\com.android.support\animated-vector-drawable\26.0.0-alpha1\jars\classes.jar and %my_path%\platforms\android\build\intermediates\exploded-aar\com.android.support\animated-vector-drawable\25.3.1\jars\classes.jar
          at com.telerik.metadata.ClassRepo.addToCache(ClassRepo.java:21)
          at com.telerik.metadata.Builder.build(Builder.java:38)
          at com.telerik.metadata.Generator.main(Generator.java:44)
  :buildMetadata FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':buildMetadata'.
   Process 'command 'C:\Program Files\Java\jdk1.8.0_144\bin\java.exe'' finished with non-zero exit value 1
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  
  BUILD FAILED
  </code></pre>
  
  <p>---------------------- UPDATE 2 -------------------------------------</p>
  
  <p>I navigated into my <code>platforms/android</code> directory and ran <code>gradlew clean</code> and tried again. It did not change the outcome. I also tried other emulators. </p>
  
  <p>Now I navigated again into <code>platforms/android</code> and ran <code>gradlew build -s</code>:</p>
  
  <pre><code>The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
          at org.gradle.api.tasks.compile.JavaCompile.setDependencyCacheDir(JavaCompile.java:241)
          //...
  The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
          at org.gradle.api.internal.tasks.DefaultTaskInputs.source(DefaultTaskInputs.java:136)
  
          Incremental java compilation is an incubating feature.
  The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
          at org.gradle.api.internal.AbstractTask.leftShift(AbstractTask.java:513)
          //...
  
  %my_path%\platforms\android\build\intermediates\res\merged\F0F1F2F3\debug\values-v24\values-v24.xml:3: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
  
  %my_path%\platforms\android\build\intermediates\res\merged\F0F1F2F3\debug\values-v24\values-v24.xml:4: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
  
  %my_path%\platforms\android\build\intermediates\res\merged\F0F1F2F3\debug\values-v24\values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
  
  %my_path%\platforms\android\build\intermediates\res\merged\F0F1F2F3\debug\values-v24\values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
  
  :processF0F1F2F3DebugResources FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':processF0F1F2F3DebugResources'.
  &gt; com.android.ide.common.process.ProcessException: Failed to execute aapt
  
  * Try:
  Run with --info or --debug option to get more log output.
  
  * Exception is:
  org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':processF0F1F2F3DebugResources'.
          //...
  Caused by: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Failed to execute aapt
          at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:185)
          //...
  Caused by: com.android.ide.common.process.ProcessException: Failed to execute aapt
          at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:873)
          //...
  Caused by: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing 'C:\Users\frr\AppData\Local\Android\android-sdk\build-tools\25.0.2\aapt.exe' with arguments {package -f --no-crunch -I C:\Users\frr\AppData\Local\Android\android-sdk\platforms\android-23\android.jar -M C:\Dev\biff\HandyApp\platforms\android\build\intermediates\manifests\full\F0F1F2F3\debug\AndroidManifest.xml -S C:\Dev\biff\HandyApp\platforms\android\build\intermediates\res\merged\F0F1F2F3\debug -m -J C:\Dev\biff\HandyApp\platforms\android\build\generated\source\r\F0F1F2F3\debug -F C:\Dev\biff\HandyApp\platforms\android\build\intermediates\res\resources-F0-F1-F2-F3-debug.ap_ --debug-mode --custom-package de.filmfestbraunschweig.biff -0 apk --no-version-vectors --output-text-symbols C:\Dev\biff\HandyApp\platforms\android\build\intermediates\symbols\F0F1F2F3\debug --no-version-vectors}
          at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299)
          //...
  Caused by: com.android.ide.common.process.ProcessException: Error while executing 'C:\Users\frr\AppData\Local\Android\android-sdk\build-tools\25.0.2\aapt.exe' with arguments {package -f --no-crunch -I C:\Users\frr\AppData\Local\Android\android-sdk\platforms\android-23\android.jar -M C:\Dev\biff\HandyApp\platforms\android\build\intermediates\manifests\full\F0F1F2F3\debug\AndroidManifest.xml -S C:\Dev\biff\HandyApp\platforms\android\build\intermediates\res\merged\F0F1F2F3\debug -m -J C:\Dev\biff\HandyApp\platforms\android\build\generated\source\r\F0F1F2F3\debug -F C:\Dev\biff\HandyApp\platforms\android\build\intermediates\res\resources-F0-F1-F2-F3-debug.ap_ --debug-mode --custom-package de.filmfestbraunschweig.biff -0 apk --no-version-vectors --output-text-symbols C:\Dev\biff\HandyApp\platforms\android\build\intermediates\symbols\F0F1F2F3\debug --no-version-vectors}
          at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:75)
          //...
  Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\frr\AppData\Local\Android\android-sdk\build-tools\25.0.2\aapt.exe'' finished with non-zero exit value 1
          at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:369)
          at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:47)
          ... 9 more
  
  BUILD FAILED
  </code></pre>
  
  <p>my app.gradle:</p>
  
  <pre><code>// Add your native dependencies here:
  
  // Uncomment to add recyclerview-v7 dependency
  //dependencies {
  //  compile 'com.android.support:recyclerview-v7:+'
  //}
  
  android {  
    defaultConfig {  
      generatedDensities = []
      applicationId = %applicationID%
    }  
    aaptOptions {  
      additionalParameters "--no-version-vectors"  
    }  
    dependencies {
      configurations.all {
          resolutionStrategy.eachDependency { DependencyResolveDetails details -&gt;
              def requested = details.requested
              if (requested.group == 'com.android.support') {
                  details.useVersion '26.0.+'
              }
          }
      }
    }
  }
  </code></pre>
  
  <p>In my package.json I define the following:</p>
  
  <pre><code>  "nativescript": {
      "id": %NativeScriptID%,
      "tns-ios": {
        "version": "3.1.0"
      },
      "tns-android": {
        "version": "3.1.1"
      }
    }
  </code></pre>
  
  <p>The NativeScriptID is different from the applicationID in the app.gradle.</p>
  
  <p>Edit: I am running on Windows 10</p>