Why is EmojiCompat consuming significant retained memory in my Flutter Android app without explicit usage?
03:27 29 May 2025

I'm developing a Flutter application that doesn't utilize emojis in any part of the UI or logic.

However, upon profiling the app using Android Studio's Memory Profiler, I observed that androidx.emoji2.text.EmojiCompat is among the top classes by retained size:

Retained size: Approximately 352 KB

Allocations: 1 instance

Shallow size: 51 B arXiv +2 arXiv +2 WIRED +2

In my pubspec.yaml, I haven't included any emoji-related packages. My dependencies are as follows:

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.6
  http: ^1.2.0
  flutter_secure_storage: 9.0.0
  built_value: ^8.6.2
  built_collection: ^5.1.1
  provider: ^6.0.5
  flutter_slidable: ^3.0.0
  flutter_launcher_icons: ^0.13.1
  hive: ^2.2.3
  hive_flutter: 1.1.0
  uuid: ^4.4.2
  oauth2: ^2.0.2
  url_launcher: ^6.1.14
  loading_overlay: 0.3.0
  path_provider: ^2.1.1
  flutter_dotenv: ^5.1.0
  geolocator: ^12.0.0
  geocoding: ^3.0.0
  timeago: ^3.5.0
  camera: ^0.11.0+1
  image_picker: ^1.0.4
  google_mlkit_commons: ^0.8.1
  google_mlkit_text_recognition: ^0.13.1
  google_mlkit_entity_extraction: ^0.13.1
  path: ^1.8.2
  barcode: ^2.2.3
  barcode_widget: ^2.0.3
  us_states: ^1.2.0
  vibration: ^3.1.3
  flutter_appauth: ^6.0.2
  intl: ^0.19.0
  shared_preferences: ^2.3.0
  mobile_scanner: ^5.2.3
  flutter_svg: ^2.0.9
  flutter_localizations:
    sdk: flutter
  package_info_plus: ^8.0.1
  timezone: ^0.10.0
  dropdown_search: ^6.0.2
  drop_down_list: ^2.0.0
  share_plus: ^11.0.0
  flutter_image_compress: ^2.4.0

Given that I haven't explicitly added any emoji-related packages, I'm puzzled by the presence and memory consumption of EmojiCompat.

enter image description here

flutter profiling memory-consumption