title: Failed to query the value of property 'packageName'. Manifest file does not exist:
body: <p>EDIT: Workaround</p>
  <p>I can build my app using <code>./gradlew :app:assembleRelease</code> but this isn't actually fixing the issue it is only a workaround. After that I find the apk in <code>/app/build/outputs/apk/release</code> and sign the apk manually in the terminal using <code>apksigner</code>. If anyone is reading this: and no solution to this problem is found, this is a workaround that works (although it isn't a solution). To sign the apk manually, search for &quot;Build your app from the command line&quot; and a Android developers page explaining how to do this should come up.</p>
  <hr>
  <p>Every time I try to build, it does &quot;:generateDebugBuildConfig&quot; instead of &quot;app:generateDebugBuildConfig&quot;.</p>
  <pre><code>Execution failed for task ':generateDebugBuildConfig'.
  &gt; Failed to calculate the value of task ':generateDebugBuildConfig' property 'buildConfigPackageName'.
     &gt; Failed to query the value of property 'packageName'.
        &gt; Manifest file does not exist: /home/android-studio/Documents/your_android_app/src/main/AndroidManifest.xml
  
  </code></pre>
  <p>This issue seems to be the exact same as this one :</p>
  <p><a href="https://stackoverflow.com/questions/55467012/cannot-read-packagename-generatedebugbuildconfig">Cannot Read packageName &#39;:generateDebugBuildConfig&#39;</a></p>
  <p>Yet that got no answer.</p>
  <p>The manifest file points to the wrong direction:</p>
  <p>/home/android-studio/Documents/your_android_app/src/main/AndroidManifest.xml</p>
  <p>instead of</p>
  <p>/home/android-studio/Documents/your_android_app/<strong>app</strong>/src/main/AndroidManifest.xml</p>
  <p>This is caused by the fact that build runs &quot;:generateDebugBuildConfig&quot; instead of &quot;:app:generateDebugBuildConfig&quot;</p>
  <p>I cannot find anything about this on the internet except the issue I linked to (which had no solution).</p>
  <p><a href="https://stackoverflow.com/questions/17424135/android-studio-android-manifest-doesnt-exists-or-has-incorrect-root-tag">It is NOT THIS BUG</a>, that one shows up in the graphical UI while this one shows up in the build output. (Plus I tried most of the solutions there, they all didn't work).</p>
  <p>Furthermore, I can run my app perfectly fine, seems like I can run the module &quot;app&quot; and this fixes the issue.</p>
  <p><a href="https://i.imgur.com/Z1oqP01.png" rel="nofollow noreferrer">Image showing the run configurations that do not apply to build for some reason</a></p>
  <p>I cannot do this for Build at all, and therefore I cannot use it. The problem with this is I cannot generate a signed apk if the build doesn't work.</p>
  <p>Thanks for all the help.</p>
  <p>EDIT:</p>
  <p>build.gradle</p>
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  apply plugin: 'com.android.application'
  apply plugin: 'kotlin-android'
  apply plugin: 'kotlin-parcelize'
  
  
  android {
      compileSdkVersion 30
      buildToolsVersion &quot;30.0.2&quot;
  
      defaultConfig {
          applicationId &quot;com.mapitall.SwiftAddress&quot;
          minSdkVersion 21
          targetSdkVersion 30
          versionCode 1
          versionName &quot;0.0.1&quot;
  
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
      kotlinOptions {
          jvmTarget = '1.8'
      }
  }
  
  buildscript {
      ext.kotlin_version = &quot;1.4.20&quot;
      repositories {
          google()
          jcenter()
      }
      dependencies {
          classpath &quot;com.android.tools.build:gradle:4.1.1&quot;
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
          maven { url &quot;https://jitpack.io&quot;}
      }
  }
  </code></pre>
  <p>build.gradle (app)</p>
  <pre><code>plugins {
      id 'com.android.application'
      id 'kotlin-android'
      id 'kotlin-parcelize'
  
  }
  
  android {
      compileSdkVersion 30
      buildToolsVersion &quot;30.0.2&quot;
  
      defaultConfig {
          applicationId &quot;com.mapitall.SwiftAddress&quot;
          minSdkVersion 21
          targetSdkVersion 30
          versionCode 1
          versionName &quot;0.0.1&quot;
  
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
      kotlinOptions {
          jvmTarget = '1.8'
      }
  }
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib:1.4.21&quot;
      implementation 'androidx.core:core-ktx:1.3.2'
      implementation 'androidx.appcompat:appcompat:1.2.0'
      implementation 'com.google.android.material:material:1.2.1'
      implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
      testImplementation 'junit:junit:4.13.1'
      androidTestImplementation 'androidx.test.ext:junit:1.1.2'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
      implementation 'org.osmdroid:osmdroid-android:6.1.8'
      implementation 'com.github.MKergall:osmbonuspack:6.6.0'
      implementation 'androidx.preference:preference:1.1.1'
  }
  </code></pre>
  <p>AndroidManifest.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      package=&quot;com.mapitall.SwiftAddress&quot;
      android:versionCode=&quot;1&quot;
      android:versionName=&quot;0.1&quot;&gt;
  
      &lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;
  
      &lt;application
          android:allowBackup=&quot;true&quot;
          android:icon=&quot;@mipmap/ic_launcher&quot;
          android:label=&quot;@string/app_name&quot;
          android:roundIcon=&quot;@mipmap/ic_launcher_round&quot;
          android:supportsRtl=&quot;true&quot;
          android:theme=&quot;@style/Theme.KeypadMapper4&quot;&gt;
          &lt;activity android:name=&quot;com.mapitall.SwiftAddress.ChooseBackgroundImagery&quot; /&gt;
          &lt;activity android:name=&quot;com.mapitall.SwiftAddress.Keypad&quot; /&gt;
          &lt;activity android:name=&quot;com.mapitall.SwiftAddress.MainActivity&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
  
                  &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  <p>Here is the stacktrace after trying to build the app in terminal using gradle:</p>
  <pre><code>&gt; Task :generateDebugBuildConfig FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':generateDebugBuildConfig'.
  &gt; Failed to calculate the value of task ':generateDebugBuildConfig' property 'buildConfigPackageName'.
     &gt; Failed to query the value of property 'packageName'.
        &gt; Manifest file does not exist: /home/android-studio/Documents/SwiftAddress2/src/main/AndroidManifest.xml
  
  * Try:
  Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  
  * Exception is:
  org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':generateDebugBuildConfig'.
          at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38)
          at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
          at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
          at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:409)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:399)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:94)
          at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
          at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
          at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
          at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:356)
          at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
          at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
          at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
          at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
          at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
          at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
          at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
          at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
          at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
          at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
  Caused by: org.gradle.api.internal.provider.AbstractProperty$PropertyQueryException: Failed to calculate the value of task ':generateDebugBuildConfig' property 'buildConfigPackageName'.
          at org.gradle.api.internal.provider.AbstractProperty.finalizeNow(AbstractProperty.java:239)
          at org.gradle.api.internal.provider.AbstractProperty.beforeRead(AbstractProperty.java:230)
          at org.gradle.api.internal.provider.AbstractProperty.calculatePresence(AbstractProperty.java:56)
          at org.gradle.api.internal.provider.AbstractMinimalProvider.isPresent(AbstractMinimalProvider.java:74)
          at org.gradle.api.internal.tasks.properties.bean.AbstractNestedRuntimeBeanNode$BeanPropertyValue.call(AbstractNestedRuntimeBeanNode.java:137)
          at org.gradle.api.internal.tasks.properties.AbstractValidatingProperty.validate(AbstractValidatingProperty.java:39)
          at org.gradle.api.internal.tasks.properties.DefaultTaskProperties.validate(DefaultTaskProperties.java:193)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.validate(ExecuteActionsTaskExecuter.java:506)
          at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:50)
          at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
          at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
          at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
          at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
          at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
          at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
          at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:194)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:186)
          at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:114)
          at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
          at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
          at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
          at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
          at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
          at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
          at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
          at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:409)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:399)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:94)
          at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
          at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
          at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
          at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:356)
          at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
          at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
          at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
          at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
          at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
          at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
          at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
          at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
          at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
          at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
  Caused by: org.gradle.api.internal.provider.AbstractProperty$PropertyQueryException: Failed to query the value of property 'packageName'.
          at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:136)
          at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValue(AbstractProperty.java:127)
          at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
          at org.gradle.api.internal.provider.AbstractMinimalProvider.withFinalValue(AbstractMinimalProvider.java:151)
          at org.gradle.api.internal.provider.DefaultProperty.finalValue(DefaultProperty.java:133)
          at org.gradle.api.internal.provider.DefaultProperty.finalValue(DefaultProperty.java:25)
          at org.gradle.api.internal.provider.AbstractProperty.finalizeNow(AbstractProperty.java:236)
          ... 46 more
  Caused by: com.android.builder.errors.EvalIssueException: Manifest file does not exist: /home/android-studio/Documents/SwiftAddress2/src/main/AndroidManifest.xml
          at com.android.builder.errors.IssueReporter.reportError(IssueReporter.kt:106)
          at com.android.builder.errors.IssueReporter.reportError$default(IssueReporter.kt:102)
          at com.android.build.gradle.internal.manifest.LazyManifestParserKt.parseManifest(LazyManifestParser.kt:91)
          at com.android.build.gradle.internal.manifest.LazyManifestParserKt.access$parseManifest(LazyManifestParser.kt:1)
          at com.android.build.gradle.internal.manifest.LazyManifestParser$manifestData$2$provider$1.transform(LazyManifestParser.kt:47)
          at com.android.build.gradle.internal.manifest.LazyManifestParser$manifestData$2$provider$1.transform(LazyManifestParser.kt:36)
          at org.gradle.api.internal.provider.TransformBackedProvider.mapValue(TransformBackedProvider.java:73)
          at org.gradle.api.internal.provider.TransformBackedProvider.calculateOwnValue(TransformBackedProvider.java:65)
          at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
          at org.gradle.api.internal.provider.MappingProvider.calculateOwnValue(MappingProvider.java:55)
          at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
          at org.gradle.api.internal.provider.AbstractMinimalProvider.withFinalValue(AbstractMinimalProvider.java:151)
          at org.gradle.api.internal.provider.DefaultProperty.finalValue(DefaultProperty.java:133)
          at org.gradle.api.internal.provider.DefaultProperty.finalValue(DefaultProperty.java:25)
          at org.gradle.api.internal.provider.AbstractProperty.finalizeNow(AbstractProperty.java:236)
          at org.gradle.api.internal.provider.AbstractProperty.beforeRead(AbstractProperty.java:230)
          at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValue(AbstractProperty.java:126)
          at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
          at org.gradle.api.internal.provider.TransformBackedProvider.calculateOwnValue(TransformBackedProvider.java:64)
          at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
          at org.gradle.api.internal.provider.MappingProvider.calculateOwnValue(MappingProvider.java:55)
          at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
          at org.gradle.api.internal.provider.DefaultProperty.calculateValueFrom(DefaultProperty.java:128)
          at org.gradle.api.internal.provider.DefaultProperty.calculateValueFrom(DefaultProperty.java:25)
          at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:133)
          ... 52 more
  </code></pre>