Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28475] Android: Add "android:exported" attribute to all activities/services that have an intent-filter

GitHub Issuen/a
TypeImprovement
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-08-02T17:15:45.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.1.0
ComponentsAndroid
Labelsactivity, android, broadcastReceiver, build, exports, intent-filter, manifest, service
ReporterJoshua Quick
AssigneeJoshua Quick
Created2021-06-05T04:58:08.000+0000
Updated2021-08-02T17:15:58.000+0000

Description

*Summary:* When targeting Android 12 (aka: API Level 31), all activities, services, and broadcast receivers that have an <intent-filter/> defined must also explicitly define an android:exported attribute or else the build will fail. This is a breaking-change made by Google. https://developer.android.com/about/versions/12/behavior-changes-12#exported The following error will be logged...
Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined.
*To-Do:* Set exported to false for the below Titanium SDK [AndroidManifest.xml](https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/AndroidManifest.xml) activities. * org.appcelerator.titanium.TiActivity * org.appcelerator.titanium.TiTranslucentActivity * ti.modules.titanium.media.TiCameraActivity * ti.modules.titanium.media.TiVideoActivity * ti.modules.titanium.ui.android.TiPreferencesActivity Set exported to true for SDK test app's main activity in [AndroidManifest.xml](https://github.com/appcelerator/titanium_mobile/blob/master/android/app/src/main/AndroidManifest.xml). Set exported to true for app template's main activity in [AndroidManifest.xml](https://github.com/appcelerator/titanium_mobile/blob/master/android/templates/build/AndroidManifest.xml).

Comments

  1. Joshua Quick 2021-06-11

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12881
  2. Lokesh Choudhary 2021-08-02

    FR Passed.

JSON Source