title: Android 12 Manifest merger failed with multiple errors, see logs
body: <p>As the title says, i have a problem to the recently targetSDK 31.When i was on targetSDK 30 or lower i have never had a problem. I tried many solutions that i found online with no luck. Below are some of my project's files.</p>
  <p>My Manifest file</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;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      package=&quot;warp.ly.demo&quot;&gt;
  
      &lt;uses-permission android:name=&quot;android.permission.INTERNET&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.READ_PHONE_STATE&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.GET_ACCOUNTS&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;
      &lt;uses-permission android:name=&quot;com.google.android.c2dm.permission.RECEIVE&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.FOREGROUND_SERVICE&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.BLUETOOTH&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.ACCESS_WIFI_STATE&quot; /&gt;
      &lt;uses-permission android:name=&quot;com.google.android.c2dm.permission.SEND&quot; /&gt;
  
      &lt;!--  Restrict Tablets  --&gt;
      &lt;!--    &lt;supports-screens--&gt;
      &lt;!--        android:largeScreens=&quot;true&quot;--&gt;
      &lt;!--        android:normalScreens=&quot;true&quot;--&gt;
      &lt;!--        android:smallScreens=&quot;true&quot;--&gt;
      &lt;!--        android:xlargeScreens=&quot;false&quot; /&gt;--&gt;
  
      &lt;!--    tools:node=&quot;replace&quot;--&gt;
      &lt;application
          android:name=&quot;warp.ly.demo.WarplyDemoApplication&quot;
          android:allowBackup=&quot;false&quot;
          android:exported=&quot;false&quot;
          android:extractNativeLibs=&quot;true&quot;
          android:fullBackupContent=&quot;false&quot;
          android:hardwareAccelerated=&quot;true&quot;
          android:icon=&quot;@drawable/ic_notification_logo&quot;
          android:installLocation=&quot;internalOnly&quot;
          android:label=&quot;@string/app_name&quot;
          android:largeHeap=&quot;true&quot;
          android:theme=&quot;@style/AppTheme&quot;&gt;
  
          &lt;!-- For Huawei Push --&gt;
          &lt;meta-data
              android:name=&quot;push_kit_auto_init_enabled&quot;
              android:value=&quot;true&quot; /&gt;
  
          &lt;meta-data
              android:name=&quot;com.huawei.hms.client.channel.androidMarket&quot;
              android:value=&quot;false&quot; /&gt;
  
          &lt;activity
              android:name=&quot;warp.ly.demo.activities.SplashActivity&quot;
              android:exported=&quot;true&quot;
              android:label=&quot;@string/app_name&quot;
              android:screenOrientation=&quot;portrait&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;.activities.MainActivity&quot;
              android:label=&quot;@string/title_activity_main&quot;
              android:screenOrientation=&quot;portrait&quot; /&gt;
  
          &lt;activity
              android:name=&quot;.activities.InboxActivity&quot;
              android:screenOrientation=&quot;portrait&quot; /&gt;
  
          &lt;activity
              android:name=&quot;ly.warp.sdk.activities.WarpViewActivity&quot;
              android:label=&quot;&quot;
              android:screenOrientation=&quot;portrait&quot; /&gt;
  
          &lt;activity
              android:name=&quot;ly.warp.sdk.dexter.PermissionsActivity&quot;
              android:launchMode=&quot;singleInstance&quot;
              android:screenOrientation=&quot;portrait&quot;
              android:theme=&quot;@android:style/Theme.Light.NoTitleBar&quot; /&gt;
  
          &lt;!-- Service used for updating user's location. --&gt;
          &lt;service
              android:name=&quot;ly.warp.sdk.services.UpdateUserLocationService&quot;
              android:exported=&quot;false&quot;
              android:permission=&quot;android.permission.BIND_JOB_SERVICE&quot; /&gt;
  
          &lt;service
              android:name=&quot;ly.warp.sdk.services.WarplyBeaconsRangingService&quot;
              android:exported=&quot;false&quot; /&gt;
  
          &lt;!-- Service used for in app notification. --&gt;
          &lt;service
              android:name=&quot;ly.warp.sdk.services.WarpInAppNotificationService&quot;
              android:exported=&quot;false&quot; /&gt;
  
          &lt;!-- Service used for handling Huawei Push Notifications, comment if we are in Google build --&gt;
          &lt;service
              android:name=&quot;ly.warp.sdk.services.HMSBaseMessagingService&quot;
              android:exported=&quot;false&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;com.huawei.push.action.MESSAGING_EVENT&quot; /&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
  
          &lt;!-- FCM Service for push notifications --&gt;
          &lt;service
              android:name=&quot;ly.warp.sdk.services.FCMBaseMessagingService&quot;
              android:exported=&quot;false&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;com.google.firebase.MESSAGING_EVENT&quot; /&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
  
          &lt;receiver
              android:name=&quot;ly.warp.sdk.receivers.LocationChangedReceiver&quot;
              android:exported=&quot;false&quot; /&gt;
  
          &lt;receiver
              android:name=&quot;ly.warp.sdk.receivers.ConnectivityChangedReceiver&quot;
              android:exported=&quot;false&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;android.net.conn.CONNECTIVITY_CHANGE&quot; /&gt;
                  &lt;category android:name=&quot;warp.ly.demo&quot; /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
  
          &lt;receiver
              android:name=&quot;ly.warp.sdk.receivers.BluetoothStateChangeReceiver&quot;
              android:exported=&quot;false&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;android.bluetooth.adapter.action.STATE_CHANGED&quot; /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
  
          &lt;receiver
              android:name=&quot;ly.warp.sdk.receivers.WarplyInAppNotificationReceiver&quot;
              android:exported=&quot;false&quot; /&gt;
      &lt;/application&gt;
  
      &lt;!-- For Huawei Push, only if we targetSdkVersion 30, comment if we are in Google build --&gt;
      &lt;!--    &lt;queries&gt;--&gt;
      &lt;!--        &lt;intent&gt;--&gt;
      &lt;!--            &lt;action android:name=&quot;com.huawei.hms.core.aidlservice&quot; /&gt;--&gt;
      &lt;!--        &lt;/intent&gt;--&gt;
      &lt;!--    &lt;/queries&gt;--&gt;
  &lt;/manifest&gt;
  </code></pre>
  <p>My app -&gt; build.gradle file</p>
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'com.google.gms.google-services'
  apply plugin: 'com.huawei.agconnect'
  
  android {
      compileSdkVersion 31
      buildToolsVersion &quot;31.0.0&quot;
  
      defaultConfig {
          applicationId &quot;warp.ly.demo&quot;
          minSdkVersion 23
          targetSdkVersion 31
          versionCode 100
          versionName &quot;1.0.0&quot;
      }
  
      lintOptions {
          checkReleaseBuilds false
          // Or, if you prefer, you can continue to check for errors in release builds,
          // but continue the build even when errors are found:
          abortOnError false
      }
  
      signingConfigs {
          config {
              // Set the parameters based on the actual signing information.
              keyAlias 'warplydemo'
              keyPassword 'warplydemo'
              storeFile file('../keystore/warplydemo.jks')
              storePassword 'warplydemo'
          }
      }
  
      buildTypes {
          debug {
              signingConfig signingConfigs.config
          }
          release {
              signingConfig signingConfigs.config
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation project(':libraries:warply_android_sdk')
  
      //Support
      implementation 'androidx.appcompat:appcompat:1.4.0' //1.4.0 if targetSDK is 31 else 1.3.1
      implementation 'androidx.recyclerview:recyclerview:1.2.1'
      implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
  
      implementation 'org.altbeacon:android-beacon-library:2.19.3'
      implementation 'com.squareup.picasso:picasso:2.5.2'
  
      // Huawei SDK
      implementation 'com.huawei.agconnect:agconnect-core:1.6.2.300'
  
  }
  </code></pre>
  <p>My library's app -&gt; build.gradle file</p>
  <pre><code>apply plugin: 'com.android.library'
  
  android {
  
      compileSdkVersion 31
      buildToolsVersion &quot;31.0.0&quot;
  
      defaultConfig {
          minSdkVersion 23
          targetSdkVersion 31
      }
      lintOptions {
          abortOnError false
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
          }
      }
  
      useLibrary 'org.apache.http.legacy'
  }
  
  dependencies {
      //------------------------------ Support -----------------------------//
      implementation 'androidx.appcompat:appcompat:1.4.0' //1.4.0 if targetSDK is 31 else 1.3.1
      implementation 'androidx.recyclerview:recyclerview:1.2.1'
      implementation 'androidx.cardview:cardview:1.0.0'
  
      implementation 'org.altbeacon:android-beacon-library:2.19.3'
      implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
      implementation &quot;commons-logging:commons-logging:1.2&quot;
  
      //------------------------------ Firebase -----------------------------//
      implementation platform('com.google.firebase:firebase-bom:29.0.3')
      implementation 'com.google.firebase:firebase-messaging'
  
      //------------------------------ GMS -----------------------------//
      implementation 'com.google.android.gms:play-services-base:18.0.1'
  
      //------------------------------ Work Manager -----------------------------//
      implementation 'androidx.work:work-runtime:2.7.1' //2.7.1 if targetSDK is 31 else 2.6.0
  
      //------------------------------ Glide -----------------------------//
      implementation 'com.github.bumptech.glide:glide:4.12.0'
      annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
  
      //------------------------------ Huawei -----------------------------//
      implementation 'com.huawei.hms:push:5.1.1.301'
      implementation 'com.huawei.hms:ads-identifier:3.4.39.302'
  
      //------------------------------ SQLCipher -----------------------------//
      implementation 'net.zetetic:android-database-sqlcipher:4.4.3@aar'
      implementation &quot;androidx.sqlite:sqlite:2.2.0&quot; //2.2.0 if targetSDK is 31 else 2.0.1
  }
  
  // In every export please update the version number
  task deleteJarLibrary(type: Delete) {
      delete 'jar/warply_android_sdk_v4.5.0.jar'
  }
  
  //from('build/intermediates/compile_library_classes/release/')
  
  //Old version
  // Gradle Tasks -&gt; warply_android_sdk -&gt; Tasks -&gt; other -&gt; createJarLibrary
  //task createJarLibrary(type: Copy) {
  //    from fileTree('build/intermediates/bundles/release/')
  //    into('jar/')
  //    include('classes.jar')
  //    rename('classes.jar', 'warply_android_sdk_v4.4.2.jar')
  //}
  
  // New version
  // Gradle Tasks -&gt; warply_android_sdk -&gt; Tasks -&gt; other -&gt; createFullJarRelease
  // When finished it copies tha .jar into
  // warply_android_sdk -&gt; build -&gt; intermediates -&gt; full_jar -&gt; release -&gt; createFullJarRelease
  
  task createJarLibrary(type: Jar, dependsOn: 'assembleRelease') {
      from fileTree('build/intermediates/bundles/release/')
  }
  
  createJarLibrary.dependsOn(deleteJarLibrary, build)
  </code></pre>
  <p>My Merged Manifest</p>
  <p><a href="https://i.stack.imgur.com/FZWi2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FZWi2.png" alt="enter image description here" /></a></p>
  <p>I have tried every solution i found here or in google. Thanks in advance!</p>