title: Gradle error - Could not find method storeFile() for arguments /path/to/storefile
body: <p>I have reviewed a number of posts on this topic,</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/29090337/gradle-dsl-method-not-found-storefile">Gradle DSL method not found: storeFile()</a></li>
  <li><a href="https://stackoverflow.com/questions/20562189/sign-apk-without-putting-keystore-info-in-build-gradle">Sign APK without putting keystore info in build.gradle</a></li>
  </ul>
  
  <p>for starters.  But I still cannot get past the Gradle error <code>Error:(69, 0) Could not find method storeFile() for arguments [/path/to/my.keystore]</code> on line 69:</p>
  
  <pre><code>storeFile file(keystoreProperties['storeFile'])
  </code></pre>
  
  <p>in the module gradle build file - contents of my module gradle.build file:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'signing'
  
  android {
  
      ...
  
      buildTypes {
  
          ...
  
          release {
              minifyEnabled true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  
              def keystorePropertiesFile = rootProject.file("keystore.properties");
              def keystoreProperties = new Properties()
              keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
              storeFile file(keystoreProperties['storeFile'])
              storePassword keystoreProperties['storePassword']
              keyAlias keystoreProperties['keyAlias']
              keyPassword keystoreProperties['keyPassword']
  
          }
  
          ...
  
      }
  
      ...
  
  }
  
  ...
  </code></pre>
  
  <p>where I load the <code>keystore.properties</code> file (located in project root), which contains:</p>
  
  <pre><code>storeFile=/path/to/my.keystore
  storePassword=storepwd
  keyPassword=keypwd
  keyAlias=keyalias
  </code></pre>
  
  <p>As you can see, I have a file constructor in the storeFile reference in the gradle.build file and a path to the keystore in the properties file. </p>
  
  <blockquote>
    <p><strong>Where is the mistake, or what am I missing, not understanding?</strong></p>
  </blockquote>
  
  <p><strong>Reference</strong></p>
  
  <ul>
  <li>Android Studio 2.3.3</li>
  <li>Gradle version 4.1</li>
  </ul>