Apache Cordova (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present

Regarding this error while building an Android APP

(at Binary XML file line #46): com.in.my.district.MainActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present] Performing Streamed Install

There's already a solution in SO, but how to adapt it to the config.xml of Apache Cordova projects?

Upvotes: 0

Views: 147

Answers (1)

Mister_CK
Mister_CK

Reputation: 1063

android:exported is still missing in some places. For me the problem was inside a plugin, you have to update/patch those. I had to do it for the social-sharing plugin and patched it with patch-package. If you cannot find it, can you share your android-manifest.xml? (since the android-manifest is inside the platforms folder changing the file itself wont work as it is rebuild every time you build your app, so you need to change it from the config.xml/hooks/patches, see this answer: How to set Android exported for Cordova application)

You can edit your config.xml with edit-config or you can create a custom hook. But I recommend looking at the plugin that causes this first. It is very likely a plugin and they are much easier to fix with a patch, rather than editing your config.xml directly. It is also a solution that is closer to the source of the problem.

Upvotes: 2

Related Questions