termux / termux/termux-api

Bug occurring when retrieving notifications at irregular intervals.

Open
#899 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.3k
Forks
920
PR merge metrics
No merged PRs in 30d

Description

Problem description
Sometimes when I run termux-notification-list I get an error notification. See file.

Steps to reproduce
Sometimes when executing termux-notification-list

Expected behavior
Problem fixed.

Additional information

See file

FILE :

Report Info

User Action: plugin execution command
Sender: ResultReturner
Report Timestamp: 2026-08-04 09:49:13.709 UTC

Termux:API Error

Error in ResultReturner:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.service.notification.StatusBarNotification[] android.service.notification.NotificationListenerService.getActiveNotifications()' on a null object reference
	at com.termux.api.apis.NotificationListAPI.listNotifications(SourceFile:37)
	at com.termux.api.apis.NotificationListAPI$1.writeJson(SourceFile:29)
	at com.termux.api.util.ResultReturner$ResultJsonWriter.writeResult(SourceFile:169)
	at com.termux.api.util.ResultReturner.lambda$returnData$0(SourceFile:271)
	at com.termux.api.util.ResultReturner.$r8$lambda$RFR2zSHu5FsJH7JvuCx4CPnUmMY(SourceFile:0)
	at com.termux.api.util.ResultReturner$$ExternalSyntheticLambda0.run(SourceFile:0)
	at java.lang.Thread.run(Thread.java:1572)
	Suppressed: java.lang.Exception: Called by:
		at com.termux.api.util.ResultReturner.returnData(SourceFile:239)
		at com.termux.api.apis.NotificationListAPI.onReceive(SourceFile:26)
		at com.termux.api.TermuxApiReceiver.doWork(SourceFile:178)
		at com.termux.api.TermuxApiReceiver.onReceive(SourceFile:65)
		at android.app.ActivityThread.handleReceiver(ActivityThread.java:5424)
		at android.app.ActivityThread.-$$Nest$mhandleReceiver(ActivityThread.java:0)
		at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2847)
		at android.os.Handler.dispatchMessage(Handler.java:115)
		at android.os.Looper.loopOnce(Looper.java:302)
		at android.os.Looper.loop(Looper.java:412)
		at android.app.ActivityThread.main(ActivityThread.java:9998)
		at java.lang.reflect.Method.invoke(Native Method)
		at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:613)
		at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1074)

Termux:API App Info (Current)

APP_NAME: Termux:API
PACKAGE_NAME: com.termux.api
VERSION_NAME: 0.53.0
VERSION_CODE: 1002
UID: 10346
TARGET_SDK: 28
IS_DEBUGGABLE_BUILD: false
SE_PROCESS_CONTEXT: u:r:untrusted_app_27:s0:c90,c257,c512,c768
SE_FILE_CONTEXT: u:object_r:app_data_file:s0:c90,c257,c512,c768
SE_INFO: default:targetSdkVersion=28:complete
APK_RELEASE: F-Droid
SIGNING_CERTIFICATE_SHA256_DIGEST: 228FB2CFE90831C1499EC3CCAF61E96E8E1CE70766B9474672CE427334D41C42

Termux App Info

APP_NAME: Termux
PACKAGE_NAME: com.termux
VERSION_NAME: 0.118.3
VERSION_CODE: 1002
UID: 10346
TARGET_SDK: 28
IS_DEBUGGABLE_BUILD: false
SE_PROCESS_CONTEXT: u:r:untrusted_app_27:s0:c90,c257,c512,c768
SE_FILE_CONTEXT: u:object_r:app_data_file:s0:c90,c257,c512,c768
SE_INFO: default:targetSdkVersion=28:complete
TERMUX_APP_PACKAGE_MANAGER: -
TERMUX_APP_PACKAGE_VARIANT: -
APK_RELEASE: F-Droid
SIGNING_CERTIFICATE_SHA256_DIGEST: 228FB2CFE90831C1499EC3CCAF61E96E8E1CE70766B9474672CE427334D41C42

Device Info

Software

OS_VERSION: 6.1.141-android14-11-o-gffc54a6d2287
SDK_INT: 36
RELEASE: 16
ID: UKQ1.231108.001
DISPLAY: CPH2709_16.0.5.1002(EX01)
INCREMENTAL: V.R4T2.499d60a-25a58ad-25b4db7
SECURITY_PATCH: 2026-06-01
IS_TREBLE_ENABLED: true
TYPE: user
TAGS: release-keys
MAX_PHANTOM_PROCESSES: - (Requires DUMP and PACKAGE_USAGE_STATS permission)
MONITOR_PHANTOM_PROCS: true
DEVICE_CONFIG_SYNC_DISABLED: -

Hardware

MANUFACTURER: OnePlus
BRAND: OnePlus
MODEL: CPH2709
PRODUCT: CPH2709EEA
BOARD: pineapple
HARDWARE: qcom
DEVICE: OP6131L1
SUPPORTED_ABIS: arm64-v8a

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the NotificationListAPI entry point named in the stack trace and trace the termux-notification-list request through its notification lookup. Reproduce the command when possible and inspect the attached NullPointerException context. Done means the command no longer fails with this exception when notifications are retrieved at irregular intervals.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.