title: Manifest merger failed targeting Android 12
body: <p>Using Android Studio 4.2.1, after changing sdk target to Android 12 in my build.gradle file, I am getting a <code>Manifest merger failed with multiple errors, see logs</code> error.</p>
  <p>The errors shown in the <code>Merged Manifest</code> tab are as follows:</p>
  <pre><code>Merging Errors: 
  Error: Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. My_App.app main manifest (this file) 
  Error: Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. My_App.app main manifest (this file) 
  Error: Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. My_App.app main manifest (this file) 
  </code></pre>
  <p>However the <code>android:exported</code> tag is already applied in my AndroidManifest.xml file. I only have one activity. No services or broadcast receivers. See below:</p>
  <pre class="lang-xml prettyprint-override"><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;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      package=&quot;com.mydomain.myapp&quot;&gt;
  
      &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;
  
      &lt;application
          android:name=&quot;com.mydomain.myapp.MyApplication&quot;
          android:allowBackup=&quot;false&quot;
          tools:replace=&quot;allowBackup&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/AppTheme&quot;&gt;
          &lt;activity
              android:name=&quot;com.mydomain.myapp.ui.MainActivity&quot;
              android:exported=&quot;true&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;meta-data
              android:name=&quot;preloaded_fonts&quot;
              android:resource=&quot;@array/preloaded_fonts&quot; /&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  <p>My build.gradle(:app) file:</p>
  <pre><code>android {
      compileSdkVersion(&quot;android-S&quot;)
      buildToolsVersion &quot;30.0.3&quot;
  
      defaultConfig {
          ...
          minSdkVersion 23
          targetSdkVersion(&quot;S&quot;)
          ...
  }
  </code></pre>
  <p>Any idea how I could resolve this issue?</p>