Manifest Merge Tool

I think we didn’t pay enough attention to the new great feature Manifest Merge Tool.

Using this feature we don’t need to ask our users to do this extra step: “please add those lines into AndroidManifest.xml, plist, index.html” and so on.
The whole process of adding library now more consistent and easier for the end user.


The first example is Defold Sharing NE 1.6.0.

Old deprecated manual steps:

Additional steps for iOS

In the case when a user wants to save a video or an image to the gallery iOS will need to show an explanation to the user. Your explanation should be added into your Info.plist:

	<key>NSPhotoLibraryAddUsageDescription</key>
	<string>Your application needs permission to save the content to the gallery.</string>
	<key>NSPhotoLibraryUsageDescription</key>
	<string>Your application needs permission to save the content to the gallery.</string>

Additional steps for Android

Sharing files (images) on Android is quite a bit tricker than on iOS due to the Android permission system. The correct way to share files is via a FileProvider. In order to use the extension on Android you need to add the following to your AndroidManifest.xml file:

<manifest>
	    ...
	    <application>
	        ...
	        <provider
	            android:name="android.support.v4.content.FileProvider"
	            android:authorities="{{android.package}}.fileprovider"
	            android:grantUriPermissions="true"
	            android:exported="false">
	            <meta-data
	                android:name="android.support.FILE_PROVIDER_PATHS"
	                android:resource="@xml/filepaths" />
	        </provider>
	        ...
	    </application>
	</manifest>

Instead of these manual steps, we have new files for the merging tool according to the documentation:
image

We’ve started to change our libraries one by one using this new tool and I want to ask you to do the same with your libraries.
That will make work with Defold and your extensions easier and more pleasant.

Thank you!

17 Likes

From documentation:

The base manifest is either the default one (in builtins\manifests\<platforms>\...), or a custom one supplied by the user.

But seems, what builtins manifest always used. Even I use custom manifset - i’ve got android permissions from builtin manifest

How can I disable this?

Huh, so you have specified another Android manifest in game.project but you’re still seeing stuff included from the manifest in builtins? Are you sure the added stuff is from builtins and not merged from one of the extensions you are using?

1 Like

Yea, I have specified custom android manifest, and see stuff from this in compiled result.

I test on permissions, and this permissions pointed only in builtin manifest. We have not other ext. manifest with permissions such as WRITE_EXTERNAL_STORAGE and READ_PHONE_STATE

edit: Also, we have the android:targetSdkVersion, so by documentation, these permissions is not to be added. Our target sdk version is 28

To remove these permissions (they’re added automatically by the manifest merger), you have to make sure all your manifests (and those in any extensions) specify the minimum version:

(example from extension-facebook)

<uses-sdk android:minSdkVersion="{{android.minimum_sdk_version}}" android:targetSdkVersion="{{android.target_sdk_version}}" />
1 Like

Hm, thanks. Not very clear rule :slight_smile:

We will check this by upgrading our NE and I’ll post result here later.
If this is true, need to specify this rule in documentation https://defold.com/manuals/extensions-manifest-merge-tool/

Yes, we will add a link to Android’s manifest merge documentaiton.
In the mean time, here it is:

1 Like

This link already in documentation on android merge-tool

But seems, i’ve missed the point on “extension” manifest, sorry :slight_smile:
I’ve read this as just your main manifest file

Thanks for fast answer and documentation link

3 Likes

No worries, we’re always looking to improve upon documentation, so it’s good that you mention your painpoints.

3 Likes