Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"termux-wake-lock" crashes termux 0.74 #1224

Closed
steffenl82 opened this issue Aug 22, 2019 · 6 comments · Fixed by #1238
Closed

"termux-wake-lock" crashes termux 0.74 #1224

steffenl82 opened this issue Aug 22, 2019 · 6 comments · Fixed by #1238

Comments

@steffenl82
Copy link

I use termux with a FireTV stick. Running "termux-wake-lock" immediately crashes the termux app. This happened only after updating termux to v0.74 (v0.72 was running fine).

I guess this is the relevant logcat:

--------- beginning of crash
08-22 20:55:08.068 3757 3757 E AndroidRuntime: FATAL EXCEPTION: main
08-22 20:55:08.068 3757 3757 E AndroidRuntime: Process: com.termux, PID: 3757
08-22 20:55:08.068 3757 3757 E AndroidRuntime: java.lang.RuntimeException: Unable to start service com.termux.app.TermuxService@267e688 with Intent { act=com.termux.service_wake_lock cmp=com.termux/.app.TermuxService }: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS dat=package:com.termux flg=0x10000000 }
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3365)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at android.app.ActivityThread.-wrap21(ActivityThread.java)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6188)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:801)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS dat=package:com.termux flg=0x10000000 }
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1809)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1523)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at android.app.ContextImpl.startActivity(ContextImpl.java:820)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at android.app.ContextImpl.startActivity(ContextImpl.java:797)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at android.content.ContextWrapper.startActivity(ContextWrapper.java:356)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at com.termux.app.TermuxService.onStartCommand(SourceFile:22)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3348)
08-22 20:55:08.068 3757 3757 E AndroidRuntime: ... 8 more
08-22 20:55:08.112 3757 3757 I Process : Sending signal. PID: 3757 SIG: 9
08-22 20:55:09.212 6221 6221 W System : ClassLoader referenced unknown path: /system/priv-app/MetricsApi/lib/arm
08-22 20:55:09.265 6221 6221 D AndroidRuntime: Shutting down VM

@TGWGitHub
Copy link

Same problem here.

Termux v0.74 on Samsung A500H running Android v6.0.1.

Termux v0.72 is the last known-good version without the issue.

@ghost ghost added the bug report label Sep 2, 2019
@steffenl82
Copy link
Author

I guess that this is caused by that change: #1216

@tomty89
Copy link
Contributor

tomty89 commented Sep 6, 2019

@ghost
Copy link

ghost commented Sep 6, 2019

@tomty89 Are you sure that just changing permission will help ? We should probably handle ActivityNotFoundException when

is called.

@tomty89
Copy link
Contributor

tomty89 commented Sep 6, 2019

Hmm maybe some other stuff is broken as well (could be the ROMs themselves). Just noticed that it doesn't work on some Android M while it should.

There's no reason not to fix the permission though.

@danog
Copy link
Contributor

danog commented Sep 6, 2019

Hmmm this actually makes sense because you're running on a TV stick, android TV sticks don't have batteries, they're powered directly via USB, so the ROMs wouldn't come with all the battery management logic that would otherwise be present on vanilla android.
Should've thought of this though, I too have one of these things laying around :)
#1238 should fix the issue, even if I don't think -sdk-23 is of any use, since the app starts just fine.

fornwall pushed a commit that referenced this issue Sep 8, 2019
@ghost ghost locked and limited conversation to collaborators Oct 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants