termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
1.96k stars 301 forks source link

running termux-x11 fails #222

Closed Sirox228 closed 1 year ago

Sirox228 commented 1 year ago

when i run termux-x11 :1 & it prints this

[1] 15426
~ $ Loading shared library: /data/data/com.termux/files/usr/libexec/termux-x11/starter.apk!/lib/arm64-v8a/libx11-starter.so
res = 0
Activity is started
Got getWaylandFD
{ParcelFileDescriptor: java.io.FileDescriptor@d2aef22}
Lorie requested fd
Got getLogFD
{ParcelFileDescriptor: java.io.FileDescriptor@6705db3}
Got finish request
App sent finishing command
~ $ Failed to connect to Termux:X11. Something went wrong.

sends intent to termux-x11, but it can't connect, when i run env DISPLAY=:1 xfce4-session it says xfce4-session: Cannot open display: . i granted all permissions and set allow-external-apps to true in .termux/termux.properties. It seems that it can't find some file.?

twaik commented 1 year ago

i granted all permissions and set allow-external-apps to true in .termux/termux.properties.

This mechanism seems broken. Disable allow-external-apps. Try to launch Termux:X11 app from launcher and then use termux-x11

Sirox228 commented 1 year ago

nothing changed

twaik commented 1 year ago

Post a video please.

twaik commented 1 year ago

nothing changed

Did you stop an application before launching it from launcher?

Sirox228 commented 1 year ago

Post a video please.

https://drive.google.com/file/d/1APzgj2hmP9bVq-CLgn2QXzj0GSwQMjlC/view?usp=drivesdk

nothing changed

Did you stop an application before launching it from launcher?

no

twaik commented 1 year ago

Stop it using Android UI and try again. It is known bug and I am already working on it.

83syam commented 1 year ago

@twaik how

twaik commented 1 year ago
Video https://user-images.githubusercontent.com/9674930/217868421-0033b190-3cd0-4125-9573-2434c2a4fdf2.mp4
twaik commented 1 year ago

Any updates?

twaik commented 1 year ago

Any updates?

Sirox228 commented 1 year ago

no

stopka-html commented 1 year ago

Same problem

stopka-html commented 1 year ago
``` java.io.FileNotFoundException: /data/system/theme_config/theme_compatibility.xml: open failed: ENOENT (No such file or directory) at libcore.io.IoBridge.open(IoBridge.java:492) at java.io.FileInputStream.(FileInputStream.java:160) at java.io.FileInputStream.(FileInputStream.java:115) at java.io.FileReader.(FileReader.java:58) at miui.content.res.ThemeCompatibilityLoader.getVersion(ThemeCompatibilityLoader.java:108) at miui.content.res.ThemeCompatibilityLoader.getConfigDocumentTree(ThemeCompatibilityLoader.java:126) at miui.content.res.ThemeCompatibilityLoader.loadConfig(ThemeCompatibilityLoader.java:59) at miui.content.res.ThemeCompatibility.(ThemeCompatibility.java:31) at miui.content.res.ThemeCompatibility.isThemeEnabled(ThemeCompatibility.java:111) at android.content.res.MiuiResourcesImpl.(MiuiResourcesImpl.java:41) at android.content.res.Resources.(Resources.java:353) at android.content.res.MiuiResources.(MiuiResources.java:49) at android.content.res.Resources.getSystem(Resources.java:233) at android.app.ActivityManager.isHighEndGfx(ActivityManager.java:999) at android.app.ActivityThread.systemMain(ActivityThread.java:7646) at com.termux.x11.Loader.main(Loader.java:37) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:407) Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) at libcore.io.Linux.open(Native Method) at libcore.io.ForwardingOs.open(ForwardingOs.java:166) at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254) at libcore.io.IoBridge.open(IoBridge.java:478) ... 17 more $XDG_RUNTIME_DIR is unset. Exporting default value (/data/data/com.termux/files/usr/tmp). Looks like com.termux lacks "Draw Over Apps" permission. You can grant com.termux the "Draw Over Apps" permission from its App Info activity: Android Settings -> Apps -> Termux -> Advanced -> Draw over other apps. res = 0 Activity is started Got getWaylandFD {ParcelFileDescriptor: java.io.FileDescriptor@dfd0557} Lorie requested fd Got getLogFD {ParcelFileDescriptor: java.io.FileDescriptor@4a5f844} Got finish request App sent finishing command Failed to connect to Termux:X11. Something went wrong.` ```

Termux-info

``` Termux Variables: TERMUX_APP_PACKAGE_MANAGER=apt TERMUX_APP__AM_SOCKET_SERVER_ENABLED=true TERMUX_APP__APK_PATH=/data/app/~~rX8bDlQpVgK-0ulCPyRgDA==/com.termux-HBzh_aDX8RQldJXXWz9HbQ==/base.apk TERMUX_APP__APK_RELEASE=GITHUB TERMUX_APP__FILES_DIR=/data/user/0/com.termux/files TERMUX_APP__IS_DEBUGGABLE_BUILD=true TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false TERMUX_APP__PACKAGE_MANAGER=apt TERMUX_APP__PACKAGE_NAME=com.termux TERMUX_APP__PACKAGE_VARIANT=apt-android-7 TERMUX_APP__PID=30750 TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c29,c257,c512,c768 TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete TERMUX_APP__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c29,c257,c512,c768 TERMUX_APP__TARGET_SDK=28 TERMUX_APP__UID=10285 TERMUX_APP__USER_ID=0 TERMUX_APP__VERSION_CODE=118 TERMUX_APP__VERSION_NAME=0.118.0+c6dce12 TERMUX_MAIN_PACKAGE_FORMAT=debian TERMUX_VERSION=0.118.0+c6dce12 Packages CPU architecture: aarch64 Subscribed repositories: # sources.list deb https://termux.cdn.lumito.net/termux-main stable main # root-repo (sources.list.d/root.list) deb https://termux.cdn.lumito.net/termux-root root stable # x11-repo (sources.list.d/x11.list) deb https://termux.cdn.lumito.net/termux-x11 x11 main Updatable packages: All packages up to date termux-tools version: 1.37.0 Android version: 11 Kernel build information: Linux localhost 4.14.180-perf-gae096ac9215c #1 SMP PREEMPT Tue May 24 18:19:47 CST 2022 aarch64 Android Device manufacturer: Xiaomi Device model: FP3 LD Variables: LD_LIBRARY_PATH= LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so ```
twaik commented 1 year ago

Did you allow Termux Draw over other apps permission?

stopka-html commented 1 year ago

Did you allow Termux Draw over other apps permission?

Yes

stopka-html commented 1 year ago

also if you are wondering i see an error

"....termux.permission.RUN.COMMAND"

twaik commented 1 year ago

Did you give Termux:X11 this permission in android settings?

ctrlcctrlv commented 1 year ago

I have this issue as well.

ctrlcctrlv commented 1 year ago

I received a crash which I think is related.

java.lang.NullPointerException
        at android.os.Parcel.createExceptionOrNull(Parcel.java:2432)
        at android.os.Parcel.createException(Parcel.java:2410)
        at android.os.Parcel.readException(Parcel.java:2393)
        at android.os.Parcel.readException(Parcel.java:2335)
        at com.android.internal.app.IAppOpsService$Stub$Proxy.reportRuntimeAppOpAccessMessageAndGetConfig(IAppOpsService.java:1666)
        at android.app.AppOpsManager$1.reportStackTraceIfNeeded(AppOpsManager.java:290)
        at android.app.AppOpsManager$1.onNoted(AppOpsManager.java:265)
        at android.app.AppOpsManager.readAndLogNotedAppops(AppOpsManager.java:9359)
        at android.os.Parcel.readExceptionCode(Parcel.java:2357)
        at android.os.Parcel.readException(Parcel.java:2332)
        at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:2328)
        at com.termux.x11.starter.Compat.startActivity(Compat.java:27)
        at com.termux.x11.starter.Starter.startActivity(Starter.java:144)
        at com.termux.x11.starter.Starter.onRun(Starter.java:80)
        at com.termux.x11.starter.Starter.lambda$main$0(Starter.java:42)
        at com.termux.x11.starter.Starter$$ExternalSyntheticLambda2.run(Unknown Source:2)
        at java.lang.Thread.run(Thread.java:1012)
Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.internal.util.AnnotationValidations.validate(AnnotationValidations.java:129)
        at android.app.SyncNotedAppOp.<init>(SyncNotedAppOp.java:227)
        at android.app.SyncNotedAppOp$1.createFromParcel(SyncNotedAppOp.java:243)
        at android.app.SyncNotedAppOp$1.createFromParcel(SyncNotedAppOp.java:235)
        at com.android.internal.app.IAppOpsService$Stub.onTransact(IAppOpsService.java:728)

Got getWaylandFD
{ParcelFileDescriptor: java.io.FileDescriptor@a45955}
Lorie requested fd
Got getLogFD
{ParcelFileDescriptor: java.io.FileDescriptor@5f01f6a}
Got finish request
App sent finishing command
Starting Xwayland
(EE) could not connect to wayland server
~ $ termux-x11 :1 &
[2] 9325
[1]   Exit 1                  termux-x11 :1
ctrlcctrlv commented 1 year ago

Running in tmux I see that it starts fine but as soon as I run Xfce it crashed with:

Failed to connect to Termux:X11. Something went wrong.

ctrlcctrlv commented 1 year ago

I feel like I'm very close. This program is very fickle

$ res = 0
Activity is started
Got getWaylandFD
{ParcelFileDescriptor: java.io.FileDescriptor@158ed1}
Lorie requested fd
Got getLogFD
{ParcelFileDescriptor: java.io.FileDescriptor@157ad36}
Got finish request
App sent finishing command
.../Download/termux-x11 $ Starting Xwayland
Starting Xwayland
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(EE)
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE)
(EE) could not connect to wayland server
twaik commented 1 year ago

You did not kill previous instances of Xwayland...

ctrlcctrlv commented 1 year ago

I've never gotten it to work at all. I've tried a few different versions. I never launch Xwayland so if it does not kill the process when it is crashing then that does explain that log. But the most normal crash is simply

Starting Xwayland (EE) could not connect to wayland server

ctrlcctrlv commented 1 year ago

It doesn't expect X to be running right? Because I killed both Xorg and the SDL2 Xorg client (which despite being more reliable is worse because it doesn't support graphical acceleration).

twaik commented 1 year ago

Try to reboot your phone and try again.

ctrlcctrlv commented 1 year ago

No luck. It crashes on a completely clean boot.

![Screenshot_20230223-083632](https://user-images.githubusercontent.com/838783/220922585-6e661330-e244-484f-8444-f57166c63c88.png) ![Screenshot_20230223-083608](https://user-images.githubusercontent.com/838783/220922727-1f29116d-58b7-4fd1-947a-96e332e79ebe.png)
ctrlcctrlv commented 1 year ago

My next attempt immediately afterwards I got another new error that I'd never seen before.

~ $ termux-x11 :1 &
[2] 14400
[1]   Exit 1                  termux-x11 :1
~ $ res = 2
Activity is started
~ $ Android reported activity started but we did not get any respond
Looks like we failed to start activity.
MTSYuki commented 1 year ago

I've the same problem.

xwayland is running fine, but, when I installed the least build, It crash every time when launching.

Even cleaning data and force close, still won't work.

Please note that I was launching LXQT

Here's a video:

https://user-images.githubusercontent.com/120740271/220942951-c8212afa-b014-446d-ab73-6952df176b0d.mp4

twaik commented 1 year ago

Please, try the last build. If a problem persists I need you to post a logcat.

twaik commented 1 year ago

Hi guys. Can you please check if it happens with latest build here?

twaik commented 1 year ago

@Sirox228 @83syam @stopka-html @ctrlcctrlv @MTSYuki Last available builds should fix this problem.

stopka-html commented 1 year ago

@Sirox228 @83syam @stopka-html @ctrlcctrlv @MTSYuki Last available builds should fix this problem.

Yes, fixed