title: Android Studio - Files under the build folder are generated and should not be edited
body: <p>I have gone through similar questions posted on StackOverflow regarding this issue, but none of them solved my problem.</p>
  
  <p>So, as in all questions, I am getting errors while trying to compile the application. </p>
  
  <p><a href="https://i.stack.imgur.com/2SLsK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2SLsK.png" alt="enter image description here"></a></p>
  
  <p>I know, i shouldn't edit this debug->AndroidManifest.xml file as its auto-generated. But, the app->AndroidManifest.xml file doesn't show any errors??? What should i edit when there are no errors?</p>
  
  <p>here is my AndroidManifest.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.test.awstestapp"&gt;
  
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
      &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
      &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
      &lt;uses-permission android:name="com.google.android.c2dm.permission.REGISTER" /&gt;
      &lt;uses-permission android:name="com.test.awstestapp.permission.C2D_MESSAGE" /&gt;
  
      &lt;permission
          android:name="com.test.awstestapp.permission.C2D_MESSAGE"
          android:protectionLevel="signature" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher_image"
          android:label="@string/app_name"
          android:theme="@style/AppTheme"&gt;
          &lt;activity
              android:name="com.test.awstestapp.AndroidMobilePushApp"
              android:label="@string/app_name"
              android:launchMode="singleTop"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;service
              android:name="com.test.awstestapp.MessageReceivingService"
              android:label="com.test.awstestapp.MessageReceivingService"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.test.awstestapp.AndroidMobilePushApp" /&gt;
                  &lt;action android:name="com.test.awstestapp.ExternalReceiver" /&gt;
  
                  &lt;category android:name="com.test.awstestapp" /&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
  
          &lt;receiver
              android:name="com.test.awstestapp.ExternalReceiver"
              android:permission="com.google.android.c2dm.permission.SEND"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.REGISTER" /&gt;
  
                  &lt;category android:name="com.test.awstestapp" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>The AndroidManifest.xml file in build->....->debug, is as below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.test.awstestapp"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="10"
          android:targetSdkVersion="22" /&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
      &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
      &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
      &lt;uses-permission android:name="com.google.android.c2dm.permission.REGISTER" /&gt;
      &lt;uses-permission android:name="com.test.awstestapp.permission.C2D_MESSAGE" /&gt;
  
      &lt;permission
          android:name="com.test.awstestapp.permission.C2D_MESSAGE"
          android:protectionLevel="signature" /&gt;
  
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true" /&gt;
  
      &lt;android:uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  
      &lt;uses-permission android:name="android.permission.USE_CREDENTIALS" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher_image"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name="com.test.awstestapp.AndroidMobilePushApp"
              android:label="@string/app_name"
              android:launchMode="singleTop" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;service
              android:name="com.test.awstestapp.MessageReceivingService"
              android:label="com.test.awstestapp.MessageReceivingService" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.test.awstestapp.AndroidMobilePushApp" /&gt;
                  &lt;action android:name="com.test.awstestapp.ExternalReceiver" /&gt;
  
                  &lt;category android:name="com.test.awstestapp" /&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
  
          &lt;receiver
              android:name="com.test.awstestapp.ExternalReceiver"
              android:permission="com.google.android.c2dm.permission.SEND" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.REGISTER" /&gt;
  
                  &lt;category android:name="com.test.awstestapp" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
          &lt;!-- Include the AdActivity and InAppPurchaseActivity configChanges and themes. --&gt;
          &lt;activity
              android:name="com.google.android.gms.ads.AdActivity"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
              android:theme="@android:style/Theme.Translucent" /&gt;
          &lt;activity
              android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
              android:theme="@style/Theme.IAPTheme" /&gt;
  
          &lt;meta-data
              android:name="com.google.android.gms.version"
              android:value="@integer/google_play_services_version" /&gt;
          &lt;meta-data
              android:name="com.google.android.gms.wallet.api.enabled"
              android:value="true" /&gt;
  
          &lt;receiver
              android:name="com.google.android.gms.wallet.EnableWalletOptimizationReceiver"
              android:exported="false" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.android.gms.wallet.ENABLE_WALLET_OPTIMIZATION" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Why is the auto generated manifest different from the original? </p>
  
  <p>Solutions tried till now:</p>
  
  <ol>
  <li>Clean Project</li>
  <li>File->Invalidate Caches/Restart</li>
  <li>Renamed ic_launcher to ic_launcher_image (just to test if the file name is causing the issue).</li>
  </ol>
  
  <p>Here are the errors that are being shown in Logcat:</p>
  
  <p><a href="https://i.stack.imgur.com/ykddT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ykddT.png" alt="enter image description here"></a></p>
  
  <p>How can i solve this?</p>