I have an app that offers surveys to users. One of the partners is called Bitlabs, and we can import their SDK with:
com.github.BitBurst-GmbH.bitlabs-android-library:core:3.1.19
Another partner that I use is Pollfish. According to Pollfish documentation, we should (optional) add a cleartext http traffic. Please refer to step 6.2 from the documentation. So far, so good. I create the XML file, and add the android:networkSecurityConfig
to my Manifest.
The issue happens, when I try to build the project. It seems that the previous partner (Bitlabs) already does have an android:networkSecurityConfig
, and building the project fails with:
Caused by: java.lang.RuntimeException: Manifest merger failed : Attribute application@networkSecurityConfig value=(@xml/domain_whitelist) from AndroidManifest.xml:24:9-62
is also present at [com.github.BitBurst-GmbH.bitlabs-android-library:core:3.1.19] AndroidManifest.xml:15:18-78 value=(@xml/network_security_config).
Suggestion: add 'tools:replace="android:networkSecurityConfig"' to <application> element at AndroidManifest.xml:19:5-148:19 to override.
at com.android.build.gradle.internal.tasks.manifest.ManifestHelperKt.mergeManifests(ManifestHelper.kt:125)
at com.android.build.gradle.internal.tasks.manifest.ManifestHelperKt.mergeManifests$default(ManifestHelper.kt:46)
at com.android.build.gradle.tasks.ProcessApplicationManifest.doTaskAction(ProcessApplicationManifest.kt:178)
...
According to the Exception, I can simply add the tools:replace="android:networkSecurityConfig"
to my application element on my Manifest, but as far as I understood, this will replace the Bitlabs networkSecurityConfig
, right?
Is there any way to keep those two different configs? Maybe merge them or something?
You can manually add the data from Bitlabs'
network_security_config.xml
file to yourdomain_whitelist.xml
, and have the<application
tag in theAndroidManifest.xml
as follows: