title: Gradle: android.variantFilter cause build fail after upgrade to Gradle 2.2.1
body: <p>I am working in an Android project which has many flavors, I used this code in <code>build.gradle</code> to set the package name for each flavor:</p>
  
  <pre><code>flavorDimensions "type", "feature"
  
  productFlavors {
      abc { flavorDimension "type" }
  
      def { flavorDimension "type" }
  
      ABC { flavorDimension "feature" } 
  
      DEF { flavorDimension "feature" } 
  }
  android.variantFilter { variant -&gt;
      def flavorString = ""
      def flavors = variant.getFlavors()
      for (int i = 0; i &lt; flavors.size(); i++) {
          flavorString += flavors[i].name;
      }
      if(flavorString.equalsIgnoreCase("abcABC")) {
          variant.getDefaultConfig().applicationId "com.my.app.abc.abc"
      }
      if(flavorString.equalsIgnoreCase("abcDEF")) {
          variant.getDefaultConfig().applicationId "com.my.app.abc.def"
      }
      if(flavorString.equalsIgnoreCase("defABC")) {
          variant.getDefaultConfig().applicationId "com.my.app.def.abc"
      }
      if(flavorString.equalsIgnoreCase("defDEF")) {
          variant.getDefaultConfig().applicationId "com.my.app.def.def"
      }
  }
  </code></pre>
  
  <p>Everything was fine until I updated my gradle from 1.10.0 to 2.2.1, the build is failed and I get this error message:</p>
  
  <pre><code>Error:(63, 0) No signature of method: com.android.build.gradle.internal.api.ReadOnlyProductFlavor.applicationId() is applicable for argument types: (java.lang.String) values: [com.hac.apps.megahd.acc]
  Possible solutions: getApplicationId()
  </code></pre>
  
  <p>It seems like the <code>variant.getDefaultConfig().applicationId</code> is working different now. I searched the internet for the document for <code>android.variantFilter</code> but it seems not to be exist.</p>
  
  <p>Anyone can tell me how do I get this code work in gradle 2.2.1? Thanks a lot.</p>