title: :app:mergeDebugResources FAILED Android
body: <p>My application was working fine and then I added VCS from Git and updated my android studio to 2.2.  Now I have been stuck on this error for the last week:</p>
  
  <pre><code>    Information:Gradle tasks [:app:clean, :app:generateDebugSources,                   :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug]
      Error:java.lang.ArrayIndexOutOfBoundsException
      Information:BUILD FAILED
      Information:Total time: 16.643 secs
      Information:1 error
      Information:0 warnings
      Information:See complete output in console
  </code></pre>
  
  <p>Heres the stacktrace output:</p>
  
  <pre><code>    :app:compileDebugRenderscript
      :app:generateDebugBuildConfig
      :app:generateDebugResValues
      :app:generateDebugResources
      :app:mergeDebugResources FAILED
  
      FAILURE: Build failed with an exception.
  
      * What went wrong:
      Execution failed for task ':app:mergeDebugResources'.
      &gt; java.lang.ArrayIndexOutOfBoundsException (no error message)
  
      * Try:
      Run with --info or --debug option to get more log output.
  
      * Exception is:
      org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugResources'.
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
          at         org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execut    e(PostExecutionAnalysisTaskExecuter.java:35)
          at     org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpT    oDateTaskExecuter.java:66)
          at     org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
          at     org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute    (SkipEmptySourceFilesTaskExecuter.java:52)
          at     org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
          at     org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyI    fTaskExecuter.java:53)
          at org.    gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(Execut    eAtMostOnceTaskExecuter.java:43)
      at     org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
      at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
      at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
      at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
      at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
      at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
      at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
      at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
      at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
      at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
      at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
      at org.gradle.internal.Factories$1.create(Factories.java:22)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
      at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
      at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
      at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
      at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
      at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
      at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
      at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
      at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:46)
      at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
      at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:58)
      at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
      at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
      at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
      at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
      at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
      at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
      at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
      at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
      at org.gradle.util.Swapper.swap(Swapper.java:38)
      at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
      at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
      at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
      at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:237)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
      at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
  Caused by: java.lang.ArrayIndexOutOfBoundsException
  
  
  BUILD FAILED
  
  Total time: 16.643 secs
  </code></pre>
  
  <p>Here's my Manifest:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      package="sjohns70.motive8"&gt;
  
      &lt;!--
           The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
           Google Maps Android API v2, but you must specify either coarse or fine
           location permissions for the 'MyLocation' functionality. 
      --&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
      &lt;uses-sdk tools:overrideLibrary="com.google.android.gms.all"/&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
  
          &lt;!--
               The API key for Google Maps-based APIs is defined as a string resource.
               (See the file "res/values/google_maps_api.xml").
               Note that the API key is linked to the encryption key used to sign the APK.
               You need a different API key for each encryption key, including the release key that is used to
               sign the APK for publishing.
               You can define the keys for the debug and release targets in src/debug/ and src/release/. 
          --&gt;
          &lt;meta-data
              android:name="com.google.android.geo.API_KEY"
              android:value="@string/google_maps_key" /&gt;
  
          &lt;activity
              android:name=".MapsActivity"
              android:label="@string/title_activity_maps"&gt;
  
          &lt;/activity&gt;
          &lt;activity android:label="@string/app_name" android:name=".HomeScreen"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
  
          &lt;/activity&gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="MainActivity"/&gt;
          &lt;activity android:name="com.facebook.FacebookActivity"
              android:configChanges=
                  "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
              android:theme="@android:style/Theme.Translucent.NoTitleBar"
              android:label="@string/app_name" /&gt;
          &lt;meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/&gt;
          &lt;meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/google_maps_key" /&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>And finally my build.gradle:</p>
  
  <pre><code>    apply plugin: 'com.android.application'
  
      android {
      compileSdkVersion 24
      buildToolsVersion "24.0.2"
  
      defaultConfig {
          applicationId "sjohns70.motive8"
          minSdkVersion 17
          targetSdkVersion 24
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
      dependencies {
          compile fileTree(dir: 'libs', include: ['*.jar'])
          testCompile 'junit:junit:4.12'
          compile 'com.android.support:appcompat-v7:24.2.1'
          compile 'com.google.android.gms:play-services:9.6.1'
          compile 'com.facebook.android:facebook-android-sdk:4.+'
      }
  </code></pre>
  
  <p>Thanks!</p>