title: A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed?
body: <p>I have create android app which has two product flavors one is production one is staging when I have dynamic links for production I have used following data code in manifest</p>
  <pre><code>&lt;data
              android:host=&quot;swapitapp.page.link&quot;
              android:scheme=&quot;https&quot;
              /&gt;
  </code></pre>
  <p>for staging following in android manifest</p>
  <pre><code>&lt;data
          android:host=&quot;kuncic.page.link&quot;
          android:scheme=&quot;https&quot;
          /&gt;
  </code></pre>
  <p>but when I run code in real device I am getting following errors</p>
  <pre><code> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
     &gt; Android resource linking failed
       C:\Users\Edgar\AndroidStudioProjects\Swapit_Android\app\build\intermediates\packaged_manifests\productionRelease\AndroidManifest.xml:11: AAPT: error: unexpected element &lt;intent-filter&gt; found in &lt;manifest&gt;
  </code></pre>
  <p>.</p>
  <p>below my Production 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;at.mksquad.swapit&quot;&gt;
  
  
      &lt;intent-filter&gt;
          &lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;
  
          &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;
          &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&gt;
  
          &lt;data
              android:host=&quot;swapitapp.page.link&quot;
              android:scheme=&quot;https&quot;
              /&gt;
  
      &lt;/intent-filter&gt;
  &lt;/manifest&gt;
  
  below for staging manifest
  &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;at.mksquad.swapit&quot;&gt;
  
      &lt;intent-filter&gt;
          &lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;
  
          &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;
          &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&gt;
  
  
          &lt;data
              android:host=&quot;kuncic.page.link&quot;
              android:scheme=&quot;https&quot;
              /&gt;
      &lt;/intent-filter&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  <p>below my main 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;at.mksquad.swapit&quot;&gt;
      &lt;!-- Hide in PlayStore from devices without BLE --&gt;
      &lt;uses-feature
          android:name=&quot;android.hardware.bluetooth_le&quot;
          android:required=&quot;true&quot; /&gt; &lt;!-- Check for available connection --&gt;
      &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt; &lt;!-- Write/Read DB and upload/download from storage --&gt;
      &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt; &lt;!-- Bluetooth-Access --&gt;
      &lt;uses-permission android:name=&quot;android.permission.BLUETOOTH&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.BLUETOOTH_ADMIN&quot; /&gt; &lt;!-- Needed for Android M (6.0) and above for Bluetooth usage --&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;!-- Haptic Feedback --&gt;
      &lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;
  
      &lt;application
          android:name=&quot;.SwapItApp&quot;
          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/AppTheme&quot;&gt;
          &lt;activity
              android:name=&quot;.ui.screenflow.splash.SplashActivity&quot;
              android:screenOrientation=&quot;portrait&quot;
              android:theme=&quot;@style/SplashTheme&quot;
              android:windowSoftInputMode=&quot;stateAlwaysHidden|adjustPan&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;activity
              android:name=&quot;.ui.screenflow.auth.AuthActivity&quot;
              android:screenOrientation=&quot;portrait&quot;
              android:windowSoftInputMode=&quot;stateAlwaysHidden|adjustPan&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;
  
                  &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;
                  &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&gt;
  
                  &lt;data
                      android:host=&quot;swapitapp.page.link&quot;
                      android:scheme=&quot;https&quot; /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity android:name=&quot;at.mksquad.swapit.ui.screenflow.auth.onboarding.OnBoardingActivity&quot;
              android:screenOrientation=&quot;portrait&quot; /&gt;
          &lt;activity
              android:name=&quot;.ui.screenflow.main.MainActivity&quot;
              android:screenOrientation=&quot;portrait&quot;
              android:windowSoftInputMode=&quot;stateAlwaysHidden|adjustResize&quot;&gt;
  
              &lt;!--            &lt;intent-filter android:label=&quot;@string/share_intent_file_title&quot;&gt;--&gt;
              &lt;!--                &lt;action android:name=&quot;android.intent.action.SEND&quot; /&gt;--&gt;
              &lt;!--                &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;--&gt;
              &lt;!--                &lt;data android:mimeType=&quot;*/*&quot; /&gt;--&gt;
              &lt;!--            &lt;/intent-filter&gt;--&gt;
              &lt;!--            &lt;intent-filter android:label=&quot;@string/share_intent_file_title&quot;&gt;--&gt;
              &lt;!--                &lt;action android:name=&quot;android.intent.action.SEND_MULTIPLE&quot; /&gt;--&gt;
              &lt;!--                &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;--&gt;
              &lt;!--                &lt;data android:mimeType=&quot;*/*&quot; /&gt;--&gt;
              &lt;!--            &lt;/intent-filter&gt;--&gt;
          &lt;/activity&gt;
  
          &lt;provider
              android:name=&quot;androidx.core.content.FileProvider&quot;
              android:authorities=&quot;${applicationId}.provider&quot;
              android:exported=&quot;false&quot;
              android:grantUriPermissions=&quot;true&quot;&gt;
              &lt;meta-data
                  android:name=&quot;android.support.FILE_PROVIDER_PATHS&quot;
                  android:resource=&quot;@xml/provider_paths&quot; /&gt;
          &lt;/provider&gt;
          &lt;service android:name=&quot;.services.FbMessageService&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;com.google.firebase.MESSAGING_EVENT&quot; /&gt;
              &lt;/intent-filter&gt;
              &lt;meta-data
                  android:name=&quot;com.google.firebase.messaging.default_notification_color&quot;
                  android:resource=&quot;@color/colorAccent&quot; /&gt;
  
          &lt;/service&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  <p>below my app.gradle.
  where I have structure my product flavors following way</p>
  <pre><code>productFlavors {
          production {
              dimension &quot;base&quot;
              applicationId 'at.mksquad.swapit.production'
          }
          staging {
              applicationIdSuffix &quot;.staging&quot;
              applicationId 'at.mksquad.swapit.staging'
  
          }
  </code></pre>
  <p>following <a href="https://i.stack.imgur.com/zbA6v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zbA6v.png" alt="this my current project structure" /></a> my project structure</p>
  <p>I want to know where exactly I am making mistake any help greatly appreciated.</p>