title: Execution failed for task ':app:artifactoryPublish'
body: <p>I followed this guide on how to set up a private maven repo:
   (<a href="https://inthecheesefactory.com/blog/how-to-setup-private-maven-repository/en" rel="nofollow noreferrer">https://inthecheesefactory.com/blog/how-to-setup-private-maven-repository/en</a>).</p>
  
  <p>But when I run the following command:</p>
  
  <pre><code>gradlew.bat assembleRelease artifactoryPublish
  </code></pre>
  
  <p>I get this output:</p>
  
  <pre><code>* What went wrong:
  Execution failed for task ':app:artifactoryPublish'.
  &gt; File 'C:\Android\Artifact\app\build\outputs\aar\artifact-release.aar' does not exist, 
    and need to be published from publication aar
  </code></pre>
  
  <p>Running it with the --stacktrace flag</p>
  
  <pre><code>* Exception is:
  org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:artifactoryPublish'.
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
          at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
          at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
          at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
          at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
          at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
          at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
          at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
          at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
          at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
          at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
          at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
          at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
          at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
          at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
          at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
          at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
          at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
          at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
          at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
          at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
          at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
          at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
          at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
          at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
          at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
          at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
          at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196)
          at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193)
          at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
          at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
          at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
          at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193)
          at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
          at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
          at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
          at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
          at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
          at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
          at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
          at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
          at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
          at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
          at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
          at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
          at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
          at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
          at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
          at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
          at org.gradle.util.Swapper.swap(Swapper.java:38)
          at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
          at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
          at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
          at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
          at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
          at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
          at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
          at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
          at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
          at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
  Caused by: org.gradle.api.GradleException: File 'C:\Android\Artifact\app\build\outputs\aar\artifact-release.aar' does not exist, and need to be published from publication aar
          at org.jfrog.gradle.plugin.artifactory.task.helper.TaskHelperPublications.createBuilder(TaskHelperPublications.java:253)
          at org.jfrog.gradle.plugin.artifactory.task.helper.TaskHelperPublications.getArtifactDeployDetails(TaskHelperPublications.java:225)
          at org.jfrog.gradle.plugin.artifactory.task.helper.TaskHelperPublications.collectDescriptorsAndArtifactsForUpload(TaskHelperPublications.java:147)
          at org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask.collectDescriptorsAndArtifactsForUpload(ArtifactoryTask.java:70)
          at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.prepareAndDeploy(BuildInfoBaseTask.java:367)
          at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.collectProjectBuildInfo(BuildInfoBaseTask.java:129)
          at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
          at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:141)
          at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
          at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
          at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:632)
          at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:615)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
          ... 70 mor
  </code></pre>
  
  <p>The build.gradle file:</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:2.3.0'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
          classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.0.1"
      }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>and the app.gradle file:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'com.jfrog.artifactory'
  apply plugin: 'maven-publish'
  
  android {
      compileSdkVersion 25
      buildToolsVersion "25.0.2"
      defaultConfig {
          applicationId "no.omega.artifact"
          minSdkVersion 21
          targetSdkVersion 25
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
          exclude group: 'com.android.support', module: 'support-annotations'
      })
      compile 'com.android.support:appcompat-v7:25.3.0'
      compile 'com.android.support.constraint:constraint-layout:1.0.2'
      testCompile 'junit:junit:4.12'
  }
  
  def libraryGroupId = 'no.omega'
  def libraryArtifactId = 'artifact'
  def libraryVersion = '1.0.0'
  
  publishing {
      publications {
          aar(MavenPublication) {
              groupId libraryGroupId
              version libraryVersion
              artifactId libraryArtifactId
  
              artifact("$buildDir/outputs/aar/${artifactId}-release.aar")
          }
      }
  }
  
  artifactory {
      contextUrl = 'http://*********:8081/artifactory'
      publish {
          repository {
              repoKey = 'libs-release-local'
  
              username = artifactory_username
              password = artifactory_password
          }
          defaults {
              publications('aar')
              publishArtifacts = true
  
              properties = ['qa.level': 'basic', 'q.os': 'android', 'dev.team': 'core']
              publishPom = true
          }
      }
  }
  </code></pre>
  
  <p>The project is just a Hello World generated by Android Studio. I am on a Windows 10 machine running Android Studio 2.3.</p>
  
  <p>What am I doing wrong?</p>