Skip to content

Xiaomi MiUI: java.io.FileNotFoundException: /data/system/theme_config/theme_compatibility.xml #994

Closed

Description

@siddharths2710

OS: Ubuntu 16.04
Android: Version 5.0.2
Mode of running: Run scrcpy without installation

On running the program without installation, the bottom keys are missing from the display (Please zoom in the image):

scrcpy_issue1-min

Please check the log that appears after executing ./run x

INFO: scrcpy 1.12 <https://github.com/Genymobile/scrcpy>
551 KB/s (26234 bytes in 0.046s)
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:456)
	at java.io.FileInputStream.<init>(FileInputStream.java:76)
	at java.io.FileInputStream.<init>(FileInputStream.java:103)
	at java.io.FileReader.<init>(FileReader.java:66)
	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.<clinit>(ThemeCompatibility.java:31)
	at miui.content.res.ThemeCompatibility.isThemeEnabled(ThemeCompatibility.java:111)
	at android.content.res.MiuiResources.<clinit>(MiuiResources.java:29)
	at android.content.res.Resources.getSystem(Resources.java:259)
	at android.app.LoadedApk.<init>(LoadedApk.java:197)
	at android.app.ContextImpl.createSystemContext(ContextImpl.java:2214)
	at android.app.ActivityThread.getSystemContext(ActivityThread.java:1812)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.genymobile.scrcpy.Workarounds.fillAppInfo(Workarounds.java:66)
	at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:56)
	at com.genymobile.scrcpy.Server.scrcpy(Server.java:34)
	at com.genymobile.scrcpy.Server.main(Server.java:163)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:329)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
	at libcore.io.Posix.open(Native Method)
	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
	at libcore.io.IoBridge.open(IoBridge.java:442)
	... 21 more
INFO: Initial texture: 1080x1920

Activity

  1. siddharths2710 commented on Dec 10, 2019

    @siddharths2710
    Author

    Upon trying adb shell ls /data/, it says opendir failed, Permission denied. Could this be the issue?
    Unfortunately I'm not able to execute adb root for the device :(

  2. changed the title [-]Bottom Input Keys are missing[/-] [+]Missing input keys[/+] on Dec 10, 2019
  3. hafizidev commented on Dec 11, 2019

    @hafizidev

    I ran into same error message. But mine use full screen gesture, so mine never shows bottom navigation bar. Seems like Xiaomi's MiUI related issue?

    OS: Windows 10
    Android: Version 10.0
    Android Device: Xiaomi Mi 9T

    INFO: scrcpy 1.12.1 <https://github.com/Genymobile/scrcpy>
    C:\Users\User\scrcpy\scrcpy-server: 1 file pushed. 4.3 MB/s (26202 bytes in 0.006s)
    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:496)
            at java.io.FileInputStream.<init>(FileInputStream.java:159)
            at java.io.FileInputStream.<init>(FileInputStream.java:115)
            at java.io.FileReader.<init>(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.<clinit>(ThemeCompatibility.java:31)
            at miui.content.res.ThemeCompatibility.isThemeEnabled(ThemeCompatibility.java:111)
            at android.content.res.MiuiResourcesImpl.<clinit>(MiuiResourcesImpl.java:40)
            at android.content.res.Resources.<init>(Resources.java:283)
            at android.content.res.MiuiResources.<init>(MiuiResources.java:49)
            at android.content.res.Resources.getSystem(Resources.java:204)
            at android.app.LoadedApk.<init>(LoadedApk.java:235)
            at android.app.ContextImpl.createSystemContext(ContextImpl.java:2430)
            at android.app.ActivityThread.getSystemContext(ActivityThread.java:2427)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.genymobile.scrcpy.Workarounds.fillAppInfo(Workarounds.java:66)
            at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:56)
            at com.genymobile.scrcpy.Server.scrcpy(Server.java:34)
            at com.genymobile.scrcpy.Server.main(Server.java:163)
            at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
            at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:380)
    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:167)
            at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
            at libcore.io.IoBridge.open(IoBridge.java:482)
            ... 22 more
    INFO: Initial texture: 1080x2336
    
  4. siddharths2710 commented on Dec 11, 2019

    @siddharths2710
    Author

    @hafizidev Yeah should be. In any case, we can depend on the shortcuts as an alternative.

  5. rom1v commented on Dec 11, 2019

    @rom1v
    Collaborator

    On running the program without installation, the bottom keys are missing from the display (Please zoom in the image):

    That's expected. If they don't appear on the device, they won't be mirrored. See #7.

    IIUC, there is an exception, but mirroring still works?

    To investigate the issue, could you test with 1.11 and 1.10, please (which changed things where the exception occurs)?

  6. changed the title [-]Missing input keys[/-] [+]Xiaomi MiUI: java.io.FileNotFoundException: /data/system/theme_config/theme_compatibility.xml[/+] on Dec 11, 2019
  7. hafizidev commented on Dec 11, 2019

    @hafizidev

    On running the program without installation, the bottom keys are missing from the display (Please zoom in the image):

    That's expected. If they don't appear on the device, they won't be mirrored. See #7.

    IIUC, there is an exception, but mirroring still works?

    To investigate the issue, could you test with 1.11 and 1.10, please (which changed things where the exception occurs)?

    Yes mirroring still works, just there is this exception in the console while starting the app.

    I ran both version 1.10 and 1.11 and this exception doesn't occur in both versions.

  8. rom1v commented on Dec 11, 2019

    @rom1v
    Collaborator

    OK, so this is harmless. It's just a workaround which is applied to make some devices work.

    When the workaround fails for some reason it just log the stacktrace in the console.

  9. Xplouder commented on Dec 15, 2019

    @Xplouder

    Looks like I have the same/similar error. However the cast works but i can not control de device.

    INFO: scrcpy 1.12 <https://github.com/Genymobile/scrcpy>
    /usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 3.0 MB/s (26196 bytes in 0.008s)
    java.io.FileNotFoundException: /data/system/theme_config/theme_compatibility.xml (No such file or directory)
    	at java.io.FileInputStream.open0(Native Method)
    	at java.io.FileInputStream.open(FileInputStream.java:231)
    	at java.io.FileInputStream.<init>(FileInputStream.java:165)
    	at java.io.FileInputStream.<init>(FileInputStream.java:112)
    	at java.io.FileReader.<init>(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.<clinit>(ThemeCompatibility.java:31)
    	at miui.content.res.ThemeCompatibility.isThemeEnabled(ThemeCompatibility.java:111)
    	at android.content.res.MiuiResourcesImpl.<clinit>(MiuiResourcesImpl.java:40)
    	at android.content.res.Resources.<init>(Resources.java:267)
    	at android.content.res.MiuiResources.<init>(MiuiResources.java:49)
    	at android.content.res.Resources.getSystem(Resources.java:190)
    	at android.app.LoadedApk.<init>(LoadedApk.java:211)
    	at android.app.ContextImpl.createSystemContext(ContextImpl.java:2331)
    	at android.app.ActivityThread.getSystemContext(ActivityThread.java:2190)
    	at java.lang.reflect.Method.invoke(Native Method)
    	at com.genymobile.scrcpy.Workarounds.fillAppInfo(Workarounds.java:66)
    	at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:56)
    	at com.genymobile.scrcpy.Server.scrcpy(Server.java:34)
    	at com.genymobile.scrcpy.Server.main(Server.java:163)
    	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:388)
    INFO: Initial texture: 1080x2336
    
  10. vncastanheira commented on Jan 5, 2020

    @vncastanheira

    This happens with my Xiaomi phone as well and I'm also using fullscreen gestures.
    At least it doesn't crash the application.

    Btw, awesome app.

  11. acai2046 commented on Jan 10, 2020

    @acai2046

    C:\Users\Administrator>adb shell
    chiron:/ $ ls /data/
    ls: /data/: Permission denied
    1|chiron:/ $ ls /
    ls: //vndservice_contexts: Permission denied
    ls: //verity_key: Permission denied
    ls: //vendor_service_contexts: Permission denied
    ls: //vendor_hwservice_contexts: Permission denied
    ls: //ueventd.rc: Permission denied
    ls: //plat_hwservice_contexts: Permission denied
    ls: //init.zygote64_32.rc: Permission denied
    ls: //init.zygote32.rc: Permission denied
    ls: //init.usb.rc: Permission denied
    ls: //init.usb.configfs.rc: Permission denied
    ls: //init.recovery.qcom.rc: Permission denied
    ls: //init.recovery.hardware.rc: Permission denied
    ls: //init.rc: Permission denied
    ls: //init.miui.rc: Permission denied
    ls: //init.miui.post_boot.sh: Permission denied
    ls: //init.miui.nativedebug.rc: Permission denied
    ls: //init.miui.google_revenue_share_v2.rc: Permission denied
    ls: //init.miui.google_revenue_share.rc: Permission denied
    ls: //init.miui.early_boot.sh: Permission denied
    ls: //init.miui.cust.rc: Permission denied
    ls: //init.environ.rc: Permission denied
    ls: //init.batteryd.rc: Permission denied
    ls: //init: Permission denied
    ls: //default.prop: Permission denied
    ls: //cn.prop: Permission denied
    acct data plat_file_contexts sdcard
    bin dev plat_property_contexts sepolicy
    bt_firmware dsp plat_seapp_contexts storage
    bugreports etc plat_service_contexts sys
    cache firmware proc system
    charger mnt product vendor
    config odm res vendor_file_contexts
    cust oem root vendor_property_contexts
    d persist sbin vendor_seapp_contexts

  12. acai2046 commented on Jan 13, 2020

    @acai2046

    /storage/emulated/0/data/目录,和/data/目录不是同一个目录吧?

    /storage/emulated/0/下的目录是可以读写找到的。

    adb 不可读写 /data/
    手机根目录下没有找到/data/只有storage文件


    晕
    小米应用市场里有句话:
    Root手机后会照成系统的不稳定,并且可能会给您带来不可挽回的硬件损伤,如果您需要root权限请刷开发版MIUI.
    http://www.miui.com/download.html

  13. added a commit that references this issue on Jan 19, 2020
    96bd2c9
  14. 13 remaining items

  15. azhenglianxi commented on May 16, 2020

    @azhenglianxi

    棒棒哒~ 我想问这是什么语音开发的 小白 看着啥都想 但是感觉啥都不是 混合语言吗

  16. lydacious commented on Feb 22, 2023

    @lydacious

    Hello, I am having this issue.

    INFO: scrcpy 1.12.1 <https://github.com/Genymobile/scrcpy>
    /usr/share/scrcpy/scrcpy-server: 1 file pushed. 9.5 MB/s (24773 bytes in 0.002s)
    java.io.FileNotFoundException: /data/system/theme_config/theme_compatibility.xml: open failed: ENOENT (No such file or directory)INFO: Initial texture: 1080x2400
    
    	at libcore.io.IoBridge.open(IoBridge.java:574)
    	at java.io.FileInputStream.<init>(FileInputStream.java:160)
    	at java.io.FileInputStream.<init>(FileInputStream.java:115)
    	at java.io.FileReader.<init>(FileReader.java:60)
    	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.<clinit>(ThemeCompatibility.java:31)
    	at miui.content.res.ThemeCompatibility.isThemeEnabled(ThemeCompatibility.java:111)
    	at android.content.res.MiuiResourcesImpl.<clinit>(MiuiResourcesImpl.java:41)
    	at android.content.res.MiuiResources.<init>(MiuiResources.java:58)
    	at android.content.res.IMiuiResourceImpl.createResources(IMiuiResourceImpl.java:13)
    	at android.content.res.ThemeManagerStub.createMiuiResources(ThemeManagerStub.java:56)
    	at android.content.res.Resources.getSystem(Resources.java:235)
    	at android.app.LoadedApk.<init>(LoadedApk.java:243)
    	at android.app.ContextImpl.createSystemContext(ContextImpl.java:2980)
    	at android.app.ActivityThread.getSystemContext(ActivityThread.java:2722)
    	at java.lang.reflect.Method.invoke(Native Method)
    	at com.genymobile.scrcpy.Workarounds.fillAppInfo(Workarounds.java:66)
    	at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:56)
    	at com.genymobile.scrcpy.Server.scrcpy(Server.java:34)
    	at com.genymobile.scrcpy.Server.main(Server.java:163)
    	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:383)
    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:563)
    	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
    	at libcore.io.IoBridge.open(IoBridge.java:560)
    	... 23 more
    [server] ERROR: Exception on thread Thread[main,5,main]
    java.lang.AssertionError: java.lang.reflect.InvocationTargetException
    	at com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplaySurface(SurfaceControl.java:75)
    	at com.genymobile.scrcpy.ScreenEncoder.setDisplaySurface(ScreenEncoder.java:178)
    	at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:70)
    	at com.genymobile.scrcpy.Server.scrcpy(Server.java:34)
    	at com.genymobile.scrcpy.Server.main(Server.java:163)
    	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:383)
    Caused by: java.lang.reflect.InvocationTargetException
    	at java.lang.reflect.Method.invoke(Native Method)
    WARN: Device disconnected
    	at com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplaySurface(SurfaceControl.java:73)
    	... 6 more
    Caused by: java.lang.IllegalArgumentException: displayToken must not be null
    	at android.view.SurfaceControl$Transaction.setDisplaySurface(SurfaceControl.java:3215)
    	at android.view.SurfaceControl.setDisplaySurface(SurfaceControl.java:2254)
    	... 8 more
    
  17. rom1v commented on Feb 22, 2023

    @rom1v
    Collaborator

    Use a newer version.

    Caused by: java.lang.IllegalArgumentException: displayToken must not be null

    Android 12 requires at least scrcpy v1.18. Just use the latest (1.25 currently).

  18. lydacious commented on Mar 1, 2023

    @lydacious

    Use a newer version.

    Caused by: java.lang.IllegalArgumentException: displayToken must not be null

    Android 12 requires at least scrcpy v1.18. Just use the latest (1.25 currently).

    yup, it worked. thanks

  19. added a commit that references this issue on Jun 16, 2023
  20. added a commit that references this issue on Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions