title: Gradle Generated APK name always has "app" and not my app name
body: <p>The following build script generates three APK's but doesn't seem to include the app's name.</p>
  
  <pre><code>buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  
      applicationVariants.all { variant -&gt;
          appendVersionNameVersionCode(variant, defaultConfig)
      }
    }
  }
  
  def appendVersionNameVersionCode(variant, defaultConfig) {
    variant.outputs.each { output -&gt;
      if (output.zipAlign) {
        def file = output.outputFile
        def fileName = file.name.replace(".apk", "-" + defaultConfig.versionName + "-" + defaultConfig.versionCode + ".apk")
        output.outputFile = new File(file.parent, fileName)
      }
  
      def file = output.packageApplication.outputFile
      def fileName = file.name.replace(".apk", "-" + defaultConfig.versionName + "-" + defaultConfig.versionCode + ".apk")
      output.packageApplication.outputFile = new File(file.parent, fileName)
    }
  }
  </code></pre>
  
  <p>This generates:</p>
  
  <pre><code>app-development-release-null-1.apk
  app-live-release-null-1.apk
  </code></pre>
  
  <p>How can I remove the "null" and replace "app" with my app's actual name?</p>
  
  <p><strong>Update</strong><br>
  I fixed the null by adding in a versionName to the top of the gradle file. For some reason it was missing but still can't seem to fix the "app" string and replace it with my app's name.</p>