title: Android Gradle applicationId setting causing "No resource found" in themes.xml
body: <p>I converted the Open-Source <a href="https://github.com/google/google-authenticator-android" rel="nofollow">Google Authenticator</a> from the existing Eclipse project to a Gradle-based Android Studio project. The project builds fine after the conversion. I made the fully working Android Studio project available on <a href="https://github.com/capi/google-authenticator-android/commit/03c8d14036d326706e194f720357ba35918433f7" rel="nofollow">GitHub</a>.</p>
  
  <p>However, I now changed the <code>applicationId</code> in <code>build.gradle</code> to another ID in order to be able to install it alongside my productive Google Authenticator on my device. According to my understanding of <a href="http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename" rel="nofollow">ApplicationId versus PackageName</a> this should be the way to go.</p>
  
  <p>The <code>build.gradle</code> now looks like this:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 14
      buildToolsVersion "21.1.2"
  
      defaultConfig {
          applicationId "invalid.mydomain.project"
          minSdkVersion 7
          targetSdkVersion 14
  
          testApplicationId "invalid.mydomain.project.tests"
          testInstrumentationRunner "android.test.InstrumentationTestRunner"
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
          }
      }
  }
  </code></pre>
  
  <p>while the <code>AndroidManifest.xml</code> contains the old package name:</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
            package="com.google.android.apps.authenticator2"
            android:versionCode="21" android:versionName="2.21"&gt;
  ...
  </code></pre>
  
  <p>When doing the Gradle build now, this results in an error, that a resource cannot be found with the package's name:</p>
  
  <pre><code>:app:processDebugResources
  E:\Martin\Projects\google-authenticator-android\app\build\intermediates\res\debug\values\values.xml:199: error: Error: No resource found that matches the given name: attr 'com.google.android.apps.authenticator2:color'.
  
  E:\Martin\Projects\google-authenticator-android\app\build\intermediates\res\debug\values-v11\values.xml:16: error: Error: No resource found that matches the given name: attr 'com.google.android.apps.authenticator2:color'.
  </code></pre>
  
  <p>The command that is actually failing is:</p>
  
  <pre><code>D:\java_dev\Android\android-sdk\build-tools\21.1.2\aapt.exe package -f --no-crunch -I D:\java_dev\Android\android-sdk\platforms\android-14\android.jar -M E:\Martin\Projects\google-authenticator-android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S E:\Martin\Projects\google-authenticator-android\app\build\intermediates\res\debug -A E:\Martin\Projects\google-authenticator-android\app\build\intermediates\assets\debug -m -J E:\Martin\Projects\google-authenticator-android\app\build\generated\source\r\debug -F E:\Martin\Projects\google-authenticator-android\app\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package com.google.android.apps.authenticator2 -0 apk
  </code></pre>
  
  <p>My question now is, is this expected behavior and do I now really need to search/replace the package name in the <code>*.xml</code> files? From my understanding, this is exactly what <code>ApplicationId</code> attempts to avoid.</p>
  
  <p>Is this maybe an issue with Android SDK Build Tools, not in Android Studio?</p>
  
  <p>I reproduced the issue on a clean checkout of the code I provided on both Windows and Linux, so it <em>should</em> not be OS-related.</p>