diff --git a/pythonforandroid/bootstraps/_sdl_common/build/templates/AndroidManifest.tmpl.xml b/pythonforandroid/bootstraps/_sdl_common/build/templates/AndroidManifest.tmpl.xml
index 4aba5fc40c..66ec71d05e 100644
--- a/pythonforandroid/bootstraps/_sdl_common/build/templates/AndroidManifest.tmpl.xml
+++ b/pythonforandroid/bootstraps/_sdl_common/build/templates/AndroidManifest.tmpl.xml
@@ -142,6 +142,7 @@
{% for a in args.add_activity %}
{% endfor %}
+ {{ args.extra_manifest_application_xml }}
diff --git a/pythonforandroid/bootstraps/common/build/build.py b/pythonforandroid/bootstraps/common/build/build.py
index 2eb2d555fc..04f56ac391 100644
--- a/pythonforandroid/bootstraps/common/build/build.py
+++ b/pythonforandroid/bootstraps/common/build/build.py
@@ -1050,6 +1050,15 @@ def create_argument_parser():
ap.add_argument('--extra-manifest-application-arguments', default='',
help='Extra arguments to be added to the tag of'
'AndroidManifest.xml')
+ ap.add_argument('--extra-manifest-application-xml', default='',
+ help=('Extra xml to write directly inside the '
+ 'element of AndroidManifest.xml, i.e. as a sibling of /'
+ '/etc, as opposed to --extra-manifest-application-arguments '
+ 'which only supports attributes on the tag itself. '
+ 'Needed for e.g. a entry (such as a FileProvider), which '
+ 'neither --extra-manifest-xml (a sibling of , at the '
+ ' root) nor --extra-manifest-application-arguments '
+ '(attributes only) can express.'))
ap.add_argument('--manifest-placeholders', dest='manifest_placeholders',
default='[:]', help=('Inject build variables into the manifest '
'via the manifestPlaceholders property'))
diff --git a/pythonforandroid/bootstraps/qt/build/templates/AndroidManifest.tmpl.xml b/pythonforandroid/bootstraps/qt/build/templates/AndroidManifest.tmpl.xml
index e9f21a18a3..62c9390e2d 100644
--- a/pythonforandroid/bootstraps/qt/build/templates/AndroidManifest.tmpl.xml
+++ b/pythonforandroid/bootstraps/qt/build/templates/AndroidManifest.tmpl.xml
@@ -106,6 +106,7 @@
{% for a in args.add_activity %}
{% endfor %}
+ {{ args.extra_manifest_application_xml }}
diff --git a/pythonforandroid/bootstraps/service_library/build/templates/AndroidManifest.tmpl.xml b/pythonforandroid/bootstraps/service_library/build/templates/AndroidManifest.tmpl.xml
index 2add7e7bf2..51f0d8a001 100644
--- a/pythonforandroid/bootstraps/service_library/build/templates/AndroidManifest.tmpl.xml
+++ b/pythonforandroid/bootstraps/service_library/build/templates/AndroidManifest.tmpl.xml
@@ -15,6 +15,7 @@
android:process=":service_{{ name }}"
android:exported="true" />
{% endfor %}
+ {{ args.extra_manifest_application_xml }}
diff --git a/pythonforandroid/bootstraps/service_only/build/templates/AndroidManifest.tmpl.xml b/pythonforandroid/bootstraps/service_only/build/templates/AndroidManifest.tmpl.xml
index 651a70aea6..fda2bcd36d 100644
--- a/pythonforandroid/bootstraps/service_only/build/templates/AndroidManifest.tmpl.xml
+++ b/pythonforandroid/bootstraps/service_only/build/templates/AndroidManifest.tmpl.xml
@@ -94,6 +94,7 @@
{% endif %}
+ {{ args.extra_manifest_application_xml }}
diff --git a/pythonforandroid/bootstraps/webview/build/templates/AndroidManifest.tmpl.xml b/pythonforandroid/bootstraps/webview/build/templates/AndroidManifest.tmpl.xml
index 3a99e87470..b87c5d51a7 100644
--- a/pythonforandroid/bootstraps/webview/build/templates/AndroidManifest.tmpl.xml
+++ b/pythonforandroid/bootstraps/webview/build/templates/AndroidManifest.tmpl.xml
@@ -102,6 +102,7 @@
{% endif %}
+ {{ args.extra_manifest_application_xml }}