Repository: termux/termux-app

Issue #2552: [Bug]: app crash
Created: 2022-01-30T02:05:54Z
Problem description
`## Report Info
User Action: crash report
Sender: TermuxActivity
Report Timestamp: 2022-01-30 01:36:04.374 UTC

Crash Details
Crash Thread: Thread[main,5,main]
Crash Timestamp: 2022-01-30 01:20:13.577 UTC
Crash Message:
Unable to start activity ComponentInfo{com.termux/com.termux.app.TermuxActivity}: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.termux/.app.TermuxService }: app is in background uid UidRecord{533ae62 u0a187 TPSL idle procs:1 seq(0,0,0)}

Stacktrace
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.termux/com.termux.app.TermuxActivity}: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.termux/.app.TermuxService }: app is in background uid UidRecord{533ae62 u0a187 TPSL idle procs:1 seq(0,0,0)}
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2947)
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3082)
 at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
 at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
 at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1832)
 at android.os.Handler.dispatchMessage(Handler.java:106)
 at android.os.Looper.loop(Looper.java:201)
 at android.app.ActivityThread.main(ActivityThread.java:6821)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.termux/.app.TermuxService }: app is in background uid UidRecord{533ae62 u0a187 TPSL idle procs:1 seq(0,0,0)}
 at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1587)
 at android.app.ContextImpl.startService(ContextImpl.java:1542)
 at android.content.ContextWrapper.startService(ContextWrapper.java:674)
 at com.termux.app.TermuxActivity.onCreate(TermuxActivity.java:242)
 at android.app.Activity.performCreate(Activity.java:7224)
 at android.app.Activity.performCreate(Activity.java:7213)
 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
 ... 11 more



Termux App Info
APP_NAME: Termux
PACKAGE_NAME: com.termux
VERSION_NAME: 0.118.0
VERSION_CODE: 118
TARGET_SDK: 28
IS_DEBUGGABLE_BUILD: false
APK_RELEASE: F-Droid
SIGNING_CERTIFICATE_SHA256_DIGEST: 228FB2CFE90831C1499EC3CCAF61E96E8E1CE70766B9474672CE427334D41C42

Device Info
Software
OS_VERSION: 4.4.153-perf+
SDK_INT: 28
RELEASE: 9
ID: PKQ1.180904.001
DISPLAY: PKQ1.180904.001
INCREMENTAL: 9.9.3
SECURITY_PATCH: 2019-09-05
IS_DEBUGGABLE: 1
IS_TREBLE_ENABLED: true
TYPE: user
TAGS: release-keys
Hardware
MANUFACTURER: Xiaomi
BRAND: xiaomi
MODEL: Redmi Note 7
PRODUCT: lavender
BOARD: sdm660
HARDWARE: qcom
DEVICE: lavender
SUPPORTED_ABIS: arm64-v8a, armeabi-v7a, armeabi
##`
Steps to reproduce the behavior.
runing some nodejs
What is the expected behavior?
No response
System information

Termux application version:0.118
Android OS version:android 9
Device model:XiaoMi

Duplicate issue #2741: [Bug]: Android 11 My Termux crashes when my device is turned off
Created: 2022-04-26T10:51:59Z
Problem description
My Termux crashes when my device is turned off
Report Info
User Action: crash report
Sender: TermuxActivity
Report Timestamp: 2022-04-26 10:37:21.018 UTC

Crash Details
Crash Thread: Thread[main,5,main]
Crash Timestamp: 2022-04-26 10:31:39.120 UTC
Crash Message:
Unable to start activity ComponentInfo{com.termux/com.termux.app.TermuxActivity}: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.termux/.app.TermuxService }: app is in background uid UidRecord{35f847e u0a885 TPSL idle change:idle|cached procs:1 seq(0,0,0)}

Stacktrace
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.termux/com.termux.app.TermuxActivity}: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.termux/.app.TermuxService }: app is in background uid UidRecord{35f847e u0a885 TPSL idle change:idle|cached procs:1 seq(0,0,0)}
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3730)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3898)
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2323)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:255)
	at android.app.ActivityThread.main(ActivityThread.java:8194)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.termux/.app.TermuxService }: app is in background uid UidRecord{35f847e u0a885 TPSL idle change:idle|cached procs:1 seq(0,0,0)}
	at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1770)
	at android.app.ContextImpl.startService(ContextImpl.java:1702)
	at android.content.ContextWrapper.startService(ContextWrapper.java:730)
	at com.termux.app.TermuxActivity.onCreate(TermuxActivity.java:242)
	at android.app.Activity.performCreate(Activity.java:8151)
	at android.app.Activity.performCreate(Activity.java:8135)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3699)
	... 11 more



Termux App Info
APP_NAME: Termux
PACKAGE_NAME: com.termux
VERSION_NAME: 0.118.0
VERSION_CODE: 118
TARGET_SDK: 28
IS_DEBUGGABLE_BUILD: false
APK_RELEASE: F-Droid
SIGNING_CERTIFICATE_SHA256_DIGEST: 228FB2CFE90831C1499EC3CCAF61E96E8E1CE70766B9474672CE427334D41C42

Device Info
Software
OS_VERSION: 4.19.127-02133-g3583f2e-dirty
SDK_INT: 30
RELEASE: 11
ID: RP1A.200720.011
DISPLAY: RMX2189_11_C.06
INCREMENTAL: 1621502313319
SECURITY_PATCH: 2021-08-05
IS_DEBUGGABLE: 0
IS_TREBLE_ENABLED: true
TYPE: user
TAGS: release-keys
Hardware
MANUFACTURER: realme
BRAND: realme
MODEL: RMX2189
PRODUCT: RMX2189T2
BOARD: oppo6765
HARDWARE: mt6765
DEVICE: RMX2189
SUPPORTED_ABIS: arm64-v8a, armeabi-v7a, armeabi

Steps to reproduce the behavior.

Open termux as usual
Turn off the device because it is not in use
Turn on device
Termux crash

What is the expected behavior?

Open termux as usual
Turn off the device because it is not in use
Turn on device
Nothing happened

System information

Termux application version: 0.118.0
Android OS version: 11
Device model: Realme C12 RMX2189

Closing comment (2022-05-06T08:31:13Z): Duplicate of #2552
Disable battery optimization for termux-app.