title: Grade Plugin 3-alpha1 outputFile causes error
body: <p>I'm trying to update a project to Android Studio 3.</p>
  
  <p>The following snippet is no longer accepted in a build.gradle file.</p>
  
  <pre><code>applicationVariants.all { variant -&gt;
  
      variant.outputs.each { out -&gt;
  
          def oFile =out.outputFile  // This line causes failure
  
          //...
      }
  }
  </code></pre>
  
  <p>The error is a simple "Not Valid" yet the intellisense suggests it is as it autocompletes fine.</p>
  
  <p>Checking the idea.log shows the following exception:</p>
  
  <pre><code>Caused by: java.lang.RuntimeException: Not valid.
  at com.android.ide.common.build.ApkData.getMainOutputFile(ApkData.java:136)
  at com.android.build.gradle.internal.api.BaseVariantOutputImpl.getOutputFile(BaseVariantOutputImpl.java:60)
  at com.android.build.gradle.internal.api.ApkVariantOutputImpl_Decorated.getOutputFile(Unknown Source)
  at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.getProperty(BeanDynamicObject.java:228)
  at org.gradle.internal.metaobject.BeanDynamicObject.tryGetProperty(BeanDynamicObject.java:171)
  at org.gradle.internal.metaobject.CompositeDynamicObject.tryGetProperty(CompositeDynamicObject.java:55)
  at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:59)
  at com.android.build.gradle.internal.api.ApkVariantOutputImpl_Decorated.getProperty(Unknown Source)
  </code></pre>
  
  <p>I can find no documentation on Gradle 4. Would this be a bug or a function that is deprecated perhaps?</p>
  
  <p>Also filed at: <a href="https://issuetracker.google.com/issues/38408231" rel="noreferrer">https://issuetracker.google.com/issues/38408231</a></p>