scrcpy: Crash on Android 12 Developer Preview 1
Environment
- OS: macOS
- scrcpy version: 1.17
- installation method: brew
- device model: Google Pixel
- Android version: 12 DP1
ADB Logcat output
adb logcat
2021-02-18 15:23:02.317 1027-1112/? D/VSC: @ 981.257: [Device Pickup Sensor] Request accel, interval 20.0 ms, latency 100.0 ms
2021-02-18 15:23:03.093 1691-1714/? I/pixel-thermal: fps-therm-monitor: 41.104 degC
2021-02-18 15:23:03.094 24704-24704/? W/adbd: timeout expired while flushing socket, closing
2021-02-18 15:23:03.720 5378-5468/? D/DeviceStateHelper: Audo mode: 0
2021-02-18 15:23:03.725 5378-5468/? D/DeviceStateHelper: Audo mode: 0
2021-02-18 15:23:03.729 5378-5468/? D/DeviceStateHelper: Audo mode: 0
2021-02-18 15:23:04.465 1027-1112/? D/VSC: @ 983.409: [Device Pickup Sensor] Stop accel
2021-02-18 15:23:04.466 1027-1112/? D/VSC: @ 983.411: [Device Pickup Sensor] Request motion_detect, interval 18446744027136.0 ms, latency 0.0 ms
2021-02-18 15:23:05.104 1691-1714/? I/pixel-thermal: fps-therm-monitor: 41.046 degC
2021-02-18 15:23:05.388 29135-29135/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
2021-02-18 15:23:05.392 29135-29135/? E/libc: Access denied finding property "persist.device_config.runtime_native_boot.profilebootclasspath"
2021-02-18 15:23:05.392 29135-29135/? E/libc: Access denied finding property "persist.device_config.runtime_native_boot.enable_apex_image"
2021-02-18 15:23:05.392 29135-29135/? I/AndroidRuntime: Using default boot image
2021-02-18 15:23:05.392 29135-29135/? E/libc: Access denied finding property "persist.device_config.runtime_native_boot.disable_lock_profiling"
2021-02-18 15:23:05.392 29135-29135/? I/AndroidRuntime: Leaving lock profiling enabled
2021-02-18 15:23:05.392 29135-29135/? E/libc: Access denied finding property "persist.device_config.runtime_native_boot.enable_generational_cc"
2021-02-18 15:23:05.387 29135-29135/? W/app_process: type=1400 audit(0.0:411): avc: denied { read } for name="u:object_r:device_config_runtime_native_boot_prop:s0" dev="tmpfs" ino=23759 scontext=u:r:shell:s0 tcontext=u:object_r:device_config_runtime_native_boot_prop:s0 tclass=file permissive=0 b/175106535
2021-02-18 15:23:05.387 29135-29135/? W/app_process: type=1400 audit(0.0:412): avc: denied { read } for name="u:object_r:device_config_runtime_native_boot_prop:s0" dev="tmpfs" ino=23759 scontext=u:r:shell:s0 tcontext=u:object_r:device_config_runtime_native_boot_prop:s0 tclass=file permissive=0 b/175106535
2021-02-18 15:23:05.387 29135-29135/? W/app_process: type=1400 audit(0.0:413): avc: denied { read } for name="u:object_r:device_config_runtime_native_boot_prop:s0" dev="tmpfs" ino=23759 scontext=u:r:shell:s0 tcontext=u:object_r:device_config_runtime_native_boot_prop:s0 tclass=file permissive=0 b/175106535
2021-02-18 15:23:05.390 29135-29135/? W/app_process: type=1400 audit(0.0:414): avc: denied { read } for name="u:object_r:device_config_runtime_native_boot_prop:s0" dev="tmpfs" ino=23759 scontext=u:r:shell:s0 tcontext=u:object_r:device_config_runtime_native_boot_prop:s0 tclass=file permissive=0 b/175106535
2021-02-18 15:23:05.537 29135-29135/? D/app_process: Time zone APEX ICU file found: /apex/com.android.tzdata/etc/icu/icu_tzdata.dat
2021-02-18 15:23:05.537 29135-29135/? D/app_process: I18n APEX ICU file found: /apex/com.android.i18n/etc/icu/icudt67l.dat
2021-02-18 15:23:05.578 29135-29135/? W/app_process: JNI RegisterNativeMethods: attempt to register 0 native methods for android.media.AudioAttributes
2021-02-18 15:23:05.585 29135-29135/? D/AndroidRuntime: Calling main entry com.genymobile.scrcpy.Server
2021-02-18 15:23:05.588 29135-29135/? I/scrcpy: Device: Google Pixel 3 (Android 11)
--------- beginning of system
2021-02-18 15:23:05.617 1719-3908/? I/PowerManagerService: Waking up from Dozing (uid=1000, reason=WAKE_REASON_POWER_BUTTON, details=android.policy:POWER)...
2021-02-18 15:23:05.617 3837-3837/? I/Elmyra/ElmyraService: Gated by SystemKeyPress
2021-02-18 15:23:05.621 29135-29135/? I/app_process: Thread[1,tid=29135,Native,Thread*=0x7587519010,peer=0x12c04db0,"main"] recursive attempt to load library "libmedia_jni.so"
2021-02-18 15:23:05.622 29135-29135/? I/app_process: Thread[1,tid=29135,Native,Thread*=0x7587519010,peer=0x12c04db0,"main"] recursive attempt to load library "libmedia_jni.so"
2021-02-18 15:23:05.622 29135-29135/? D/MtpDeviceJNI: register_android_mtp_MtpDevice
2021-02-18 15:23:05.622 29135-29135/? I/app_process: Thread[1,tid=29135,Native,Thread*=0x7587519010,peer=0x12c04db0,"main"] recursive attempt to load library "libmedia_jni.so"
2021-02-18 15:23:05.622 1719-1881/? I/DisplayPowerController: Blocking screen on until initial contents have been drawn.
2021-02-18 15:23:05.622 29135-29135/? I/app_process: Thread[1,tid=29135,Native,Thread*=0x7587519010,peer=0x12c04db0,"main"] recursive attempt to load library "libmedia_jni.so"
2021-02-18 15:23:05.623 3837-5862/? D/KeyguardViewMediator: notifyScreenOn
2021-02-18 15:23:05.623 3837-5862/? D/KeyguardViewMediator: onStartedWakingUp, seq = 7
2021-02-18 15:23:05.623 3837-5862/? D/KeyguardViewMediator: notifyStartedWakingUp
2021-02-18 15:23:05.623 1027-1027/? I/sensors-hal: batch_physical_sensor:285, android.sensor.light/51, period=250000000, max_latency=0
2021-02-18 15:23:05.623 1027-1027/? I/sensors-hal: batch_physical_sensor:296, android.sensor.light/51, period=250000000, max_latency=0 request completed
2021-02-18 15:23:05.624 1027-1027/? I/sensors-hal: activate_physical_sensor:220, android.sensor.light/51 en=1
2021-02-18 15:23:05.624 1027-1027/? I/sensors-hal: get_qmi_debug_flag:245, support_qmi_debug : false
2021-02-18 15:23:05.624 1719-6693/? I/WindowManager: Suppressed redundant power key press while already in the process of turning the screen on.
2021-02-18 15:23:05.625 1027-1027/? I/sensors-hal: activate_physical_sensor:233, android.sensor.light/51 en=1 completed
2021-02-18 15:23:05.627 1719-1843/? I/DisplayDeviceRepository: Display device changed state: "Built-in Screen", ON
2021-02-18 15:23:05.627 740-740/? D/SurfaceFlinger: Setting power mode 2 on display 0
2021-02-18 15:23:05.628 1027-1112/? I/ASH: @ 984.577: tmd2725: Enabling sensor 0
2021-02-18 15:23:05.628 743-743/? I/SDM: DisplayBase::SetDisplayState: Set state = 1, display 0
2021-02-18 15:23:05.628 1719-1843/? I/InputManager-JNI: Viewport [0] to add: local:0, isActive: true
2021-02-18 15:23:05.629 1719-3417/? I/InputReader: Reconfiguring input devices, changes=DISPLAY_INFO |
2021-02-18 15:23:05.629 1719-3417/? I/InputReader: Device reconfigured: id=4, name='fts', size 1080x2160, orientation 0, mode 1, display id 0
2021-02-18 15:23:05.630 3837-3837/? D/KeyguardViewMediator: handleNotifyScreenTurningOn
2021-02-18 15:23:05.635 29135-29158/? D/CCodec: allocate(c2.qti.avc.encoder)
2021-02-18 15:23:05.635 1027-29156/? I/sensors-hal: handle_indication_realtime:456, SCHED_FIFO(10) for qmi_cbk
2021-02-18 15:23:05.636 3837-3837/? D/KeyguardViewMediator: handleNotifyWakingUp
2021-02-18 15:23:05.639 1027-1112/? I/VSC: @ 984.589: [BINNED_BRIGHTNESS] Created instance at 0xb2064dd8
2021-02-18 15:23:05.639 1027-1112/? D/VSC: @ 984.589: [Binned Brightness] Request ambient_light, interval 250.0 ms, latency 0.0 ms
2021-02-18 15:23:05.641 1027-1112/? D/VSC: @ 984.590: [Binned Brightness] Request proximity, interval 200.0 ms, latency 0.0 ms
2021-02-18 15:23:05.641 1027-1112/? D/CHRE: @ 984.590: Parsed nanoapp message from host: app ID 0x476f6f676c00100e, endpoint 0x1, msgType 202, payload size 5
2021-02-18 15:23:05.642 3837-3837/? D/StatusBar: disable<e i a s b h R c s > disable2<q i n >
2021-02-18 15:23:05.642 3837-3837/? D/StatusBar: disable<e i a s b h R c s > disable2<q i n >
2021-02-18 15:23:05.642 29135-29158/? I/Codec2Client: Available Codec2 services: "default" "software"
2021-02-18 15:23:05.644 3837-3837/? D/StatusBar: updateQsExpansionEnabled - QS Expand enabled: true
2021-02-18 15:23:05.644 5289-5289/? D/NfcService: MSG_APPLY_SCREEN_STATE 4
2021-02-18 15:23:05.646 3837-3837/? D/StatusBar: updateQsExpansionEnabled - QS Expand enabled: true
2021-02-18 15:23:05.646 3837-3988/? D/KeyguardViewMediator: updateActivityLockScreenState(true, false)
2021-02-18 15:23:05.647 4193-4193/? D/GRIL-S: [0024]> UPDATE_DEVICE_STATE DeviceState: Usb:1, Wifi: 1, Wifi AP: 0, Earpiece: 0, Bluetooth: 1, Wireless charging: 0, Screen: 1, Camera: 0, 0, 0, 0, Motion: 1, Bluetooth tethering: 0, Voice: 0, Wifi 2.4G: 0, Radio: 1, Bluetooth connected: 0, Bluetooth media: 0
2021-02-18 15:23:05.647 29135-29158/? I/CCodec: setting up 'default' as default (vendor) store
2021-02-18 15:23:05.648 1027-1027/? I/sensors-hal: batch_physical_sensor:285, android.sensor.light/51, period=200000000, max_latency=0
2021-02-18 15:23:05.648 1027-1027/? I/sensors-hal: batch_physical_sensor:296, android.sensor.light/51, period=200000000, max_latency=0 request completed
2021-02-18 15:23:05.649 7492-7548/? I/QCNEJ/CndHalConnector: -> SND notifyScreenStateChanged(true)
2021-02-18 15:23:05.649 7492-7548/? I/QCNEJ/CndHalConnector: -> SND notifyScreenStateChanged(false)
2021-02-18 15:23:05.649 4193-5500/? D/GRIL-S: [0024]< UPDATE_DEVICE_STATE
2021-02-18 15:23:05.653 1045-1426/? I/QC2Interface: Created Interface (c2.qti.avc.encoder)
2021-02-18 15:23:05.653 1045-1426/? E/QC2Prop: SK::kPropInputDelay:0
2021-02-18 15:23:05.653 1045-1426/? E/QC2Prop: SK::kPropOutputDelay:0
2021-02-18 15:23:05.654 1045-1426/? I/QC2Comp: Create: Allocated component[51] for name c2.qti.avc.encoder
2021-02-18 15:23:05.654 1045-1426/? I/QC2CompStore: Created component(c2.qti.avc.encoder) id(51)
2021-02-18 15:23:05.657 29135-29158/? I/CCodec: Created component [c2.qti.avc.encoder]
2021-02-18 15:23:05.657 29135-29158/? D/CCodecConfig: read media type: video/avc
2021-02-18 15:23:05.658 29135-29158/? D/ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.pool-ids.values
2021-02-18 15:23:05.662 1719-1867/? D/KernelCpuUidUserSysTimeReader: Removing uids 90001-90001
2021-02-18 15:23:05.664 1719-1867/? D/KernelCpuUidUserSysTimeReader: Removing uids 90002-90002
2021-02-18 15:23:05.664 1719-1867/? D/KernelCpuUidUserSysTimeReader: Removing uids 90003-90003
2021-02-18 15:23:05.664 1719-1867/? D/KernelCpuUidUserSysTimeReader: Removing uids 90004-90004
2021-02-18 15:23:05.664 29135-29158/? D/CCodecConfig: ignoring local param raw.color (0xc2001809) as it is already supported
2021-02-18 15:23:05.664 1719-1867/? D/KernelCpuUidUserSysTimeReader: Removing uids 90005-90005
2021-02-18 15:23:05.665 1045-9990/? E/QC2Prop: SK::kPropInputDelay:0
2021-02-18 15:23:05.665 1045-9990/? E/QC2Prop: SK::kPropOutputDelay:0
2021-02-18 15:23:05.665 29135-29158/? I/CCodecConfig: query failed after returning 20 values (BAD_INDEX)
2021-02-18 15:23:05.665 29135-29158/? D/CCodecConfig: c2 config diff is Dict {
c2::u32 algo.bitrate-mode.value = 3
c2::i32 algo.priority.value = -1
c2::u32 algo.quality.value = 50
c2::float algo.rate.value = 4.2039e-44
c2::u32 coded.bitrate.value = 20000000
c2::float coded.frame-rate.value = 30
c2::u32 coded.pl.level = 20480
c2::u32 coded.pl.profile = 20480
c2::u32 coded.vui.color.matrix = 0
c2::u32 coded.vui.color.primaries = 0
c2::u32 coded.vui.color.range = 0
c2::u32 coded.vui.color.transfer = 0
c2::i32 coding.gop.intra-period = 1
c2::u32 coding.request-sync-frame.value = 0
Buffer coding.temporal-layering = {
00000000: 10 00 00 00 07 20 01 52 01 00 00 00 00 00 00 00 ..... .R........
}
c2::u32 default.color.matrix = 0
c2::u32 default.color.primaries = 0
c2::u32 default.color.range = 0
c2::u32 default.color.transfer = 0
c2::u32 input.delay.value = 8
string input.media-type.value = "video/raw"
c2::u32 output.buffers.prepend-header.value = 2
c2::u32 output.delay.value = 8
string output.media-type.value = "
2021-02-18 15:23:05.666 29135-29158/? W/ColorUtils: expected specified color aspects (0:0:0:0)
2021-02-18 15:23:05.668 3837-3837/? W/View: requestLayout() improperly called by com.android.keyguard.CarrierText{17b0af9 V.ED..... ......ID 44,0-821,110 #7f0b02a2 app:id/keyguard_carrier_text} during layout: running second layout pass
2021-02-18 15:23:05.668 21568-21756/? I/NearbyDiscovery: FastPairHandler: Received action android.intent.action.SCREEN_ON [CONTEXT service_id=49 ]
2021-02-18 15:23:05.669 740-1274/? E/SurfaceFlinger: Only privileged processes can create a secure display
2021-02-18 15:23:05.670 29135-29158/? D/CCodec: [c2.qti.avc.encoder] buffers are bound to CCodec for this session
2021-02-18 15:23:05.670 29135-29158/? D/CCodecConfig: no c2 equivalents for color-format
2021-02-18 15:23:05.670 29135-29158/? D/CCodecConfig: no c2 equivalents for repeat-previous-frame-after
2021-02-18 15:23:05.670 29135-29158/? D/CCodecConfig: no c2 equivalents for flags
2021-02-18 15:23:05.670 29135-29158/? D/CCodecConfig: no c2 equivalents for encoder
2021-02-18 15:23:05.671 29135-29158/? D/CCodecConfig: c2 config diff is c2::u32 coded.bitrate.value = 8000000
c2::float coded.frame-rate.value = 60
c2::i32 coding.gop.intra-period = 600
c2::u32 raw.pixel-format.value = 34
c2::u32 raw.size.height = 2160
c2::u32 raw.size.width = 1080
2021-02-18 15:23:05.671 29135-29158/? W/ColorUtils: expected specified color aspects (0:0:0:0)
2021-02-18 15:23:05.672 29135-29158/? W/Codec2Client: query -- param skipped: index = 1107298332.
2021-02-18 15:23:05.672 29135-29158/? W/Codec2Client: query -- param skipped: index = 3254781982.
2021-02-18 15:23:05.672 29135-29158/? D/CCodec: setup formats input: AMessage(what = 0x00000000) = {
Rect crop(0, 0, 1079, 2159)
int32_t color-standard = 0
int32_t color-range = 0
int32_t color-transfer = 0
int32_t frame-rate = 60
int32_t height = 2160
int32_t i-frame-period = 600
string mime = "video/raw"
int32_t prepend-sps-pps-to-idr-frames = 1
int32_t priority = 1
int32_t width = 1080
int32_t android._dataspace = 0
int32_t android._color-format = 2130708361
int32_t color-format = 2130708361
} and output: AMessage(what = 0x00000000) = {
int32_t bitrate = 8000000
int32_t bitrate-mode = 1
Rect crop(0, 0, 1079, 2159)
int32_t width = 1080
int32_t color-standard = 0
int32_t color-range = 0
int32_t color-transfer = 0
int32_t frame-rate = 60
int32_t height = 2160
int32_t i-frame-period = 600
int32_t level = 1
int32_t max-bitrate = 8000000
string mime = "video/avc"
int32_t prepend-sps-pps-to-idr-frames = 1
int32_t priority = 1
int32_t profile = 1
}
2021-02-18 15:23:05.675 29135-29158/? D/CCodec: input format changed to AMessage(what = 0x00000000) = {
Rect crop(0, 0, 1079, 2159)
int32_t color-standard = 1
int32_t color-range = 2
int32_t color-transfer = 3
int32_t frame-rate = 60
int32_t height = 2160
int32_t i-frame-period = 600
string mime = "video/raw"
int32_t prepend-sps-pps-to-idr-frames = 1
int32_t priority = 1
int32_t width = 1080
int32_t android._dataspace = 260
int32_t android._color-format = 2130708361
int32_t color-format = 2130708361
}
2021-02-18 15:23:05.675 1045-9990/? E/QC2Prop: SK::kPropInputDelay:0
2021-02-18 15:23:05.676 21568-21756/? D/BluetoothAdapter: isLeEnabled(): ON
2021-02-18 15:23:05.676 29135-29158/? D/GraphicBufferSource: setting dataspace: 0x104, acquired=0
2021-02-18 15:23:05.676 29135-29158/? D/CCodec: ISConfig minFps=10 => repeatDelayUs=100000
2021-02-18 15:23:05.679 29135-29135/? D/AndroidRuntime: Shutting down VM
--------- beginning of crash
2021-02-18 15:23:05.681 29135-29135/? E/AndroidRuntime: FATAL EXCEPTION: main
PID: 29135
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:243)
at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:91)
at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:60)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:80)
at com.genymobile.scrcpy.Server.main(Server.java:252)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplaySurface(SurfaceControl.java:73)
at com.genymobile.scrcpy.ScreenEncoder.setDisplaySurface(ScreenEncoder.java:243)
at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:91)
at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:60)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:80)
at com.genymobile.scrcpy.Server.main(Server.java:252)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
Caused by: java.lang.IllegalArgumentException: displayToken must not be null
at android.view.SurfaceControl$Transaction.setDisplaySurface(SurfaceControl.java:3067)
at android.view.SurfaceControl.setDisplaySurface(SurfaceControl.java:2147)
at java.lang.reflect.Method.invoke(Native Method)
at com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplaySurface(SurfaceControl.java:73)
at com.genymobile.scrcpy.ScreenEncoder.setDisplaySurface(ScreenEncoder.java:243)
at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:91)
at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:60)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:80)
at com.genymobile.scrcpy.Server.main(Server.java:252)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
2021-02-18 15:23:05.681 29135-29135/? E/scrcpy: 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:243)
at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:91)
at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:60)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:80)
at com.genymobile.scrcpy.Server.main(Server.java:252)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplaySurface(SurfaceControl.java:73)
at com.genymobile.scrcpy.ScreenEncoder.setDisplaySurface(ScreenEncoder.java:243)
at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:91)
at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:60)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:80)
at com.genymobile.scrcpy.Server.main(Server.java:252)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
Caused by: java.lang.IllegalArgumentException: displayToken must not be null
at android.view.SurfaceControl$Transaction.setDisplaySurface(SurfaceControl.java:3067)
at android.view.SurfaceControl.setDisplaySurface(SurfaceControl.java:2147)
at java.lang.reflect.Method.invoke(Native Method)
at com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplaySurface(SurfaceControl.java:73)
at com.genymobile.scrcpy.ScreenEncoder.setDisplaySurface(ScreenEncoder.java:243)
at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:91)
at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:60)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:80)
at com.genymobile.scrcpy.Server.main(Server.java:252)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
2021-02-18 15:23:05.683 4050-4050/? D/TouchInteractionService: Stopping tracing. Dumping to file=/data/user/0/com.google.android.apps.nexuslauncher/files/launcher_trace.pb
Terminal output
2021-02-18 15:24:57.272 scrcpy[62892:742769] INFO: scrcpy 1.17 <https://github.com/Genymobile/scrcpy>
/usr/local/Cellar/scrcpy/1.17_1/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 80.1 MB/s (34930 bytes in 0.000s)
[server] INFO: Device: Google Pixel 3 (Android 11)
[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:243)
at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:91)
at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:60)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:80)
at com.genymobile.scrcpy.Server.main(Server.java:252)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.genymobile.scrcpy.wrappers.SurfaceControl.setDisplaySurface(SurfaceControl.java:73)
... 7 more
Caused by: java.lang.IllegalArgumentException: displayToken must not be null
at android.view.SurfaceControl$Transaction.setDisplaySurface(SurfaceControl.java:3067)
at android.view.SurfaceControl.setDisplaySurface(SurfaceControl.java:2147)
... 9 more
2021-02-18 15:24:57.738 scrcpy[62892:742769] INFO: Renderer: metal
2021-02-18 15:24:57.742 scrcpy[62892:742769] INFO: Initial texture: 1080x2160
2021-02-18 15:24:58.102 scrcpy[62892:742769] WARN: Device disconnected
2021-02-18 15:24:59.109 scrcpy[62892:742769] WARN: Killing the server...
EDIT by rom1v: Use scrcpy >= 1.18
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 31
- Comments: 83 (1 by maintainers)
Commits related to this issue
- Use non-secure display for Android >= 12 Since Android 12, secure displays could not be created with shell permissions anymore. Refs commit 1fdde490fd2a0b89680a2b5da5e5274192398023 Fixes #2129 <http... — committed to Genymobile/scrcpy by rom1v 3 years ago
- Use non-secure display for Android >= 12 Since Android 12, secure displays could not be created with shell permissions anymore. Refs commit 1fdde490fd2a0b89680a2b5da5e5274192398023 Fixes #2129 <http... — committed to Genymobile/scrcpy by rom1v 3 years ago
- Use non-secure display for Android >= 12 Since Android 12, secure displays could not be created with shell permissions anymore. Refs commit 1fdde490fd2a0b89680a2b5da5e5274192398023 Fixes #2129 <http... — committed to Genymobile/scrcpy by rom1v 3 years ago
- Use non-secure display for Android 12 preview Android 12 preview identifies as Android 11, but its codename is "S". Refs #2129 <https://github.com/Genymobile/scrcpy/issues/2129> — committed to Genymobile/scrcpy by rom1v 3 years ago
Fixed in v1.18: https://github.com/Genymobile/scrcpy/releases/tag/v1.18 🚀
Here are binaries with secure flag set to false, based on the current
dev
branch (nosecureflag_quickfix
):scrcpy.exe
SHA256: c35a5e512daf07eea5207567ed72a29a58c7660c0f659dc09fb67fe1def8e5a9scrcpy-server
SHA256: 9f30ded977d4bf46ae1f10a02b966c85bf40f11d94a94660396814e7ba13916fReplace these files in your v1.17 release.
Since it’s based on the development branch, please report any regression from the latest release (you’re beta testing 😉) 😃
debug the source code , when
SurfaceControl.createDisplay("my name", true)
was executed, find the error log text below int logcat .02-19 14:49:43.824 741 1870 E SurfaceFlinger: Only privileged processes can create a secure display
so, modify the parameter “secure“ to false in Android 12.
and re build the project to test, this problem was fixed.
In case anyone needs to know of the one workaround that does exist, if you are comfortable with rooting your device you can follow these instructions:
Unfortunately disabling flag_secure also means that the apps you disable it for will be, well, insecure. It will be possible to take screenshots of them and so forth. If any attacks targeting Android use the screen as their attack vector, the added security of flag_secure will no longer protect you.
Rooting your device may also interfere with things like banking apps. To work around that, you can install an additional Magisk module called “Shamiko” which will help your device bypass SafetyNet checks. I have also installed the LPosed module “HiddenCore” but I don’t know if this is actually doing anything for me that Shamiko isn’t, since it hasn’t been updated in quite some time and doesn’t even seem to be in the LPosed repository anymore.
Hopefully this information will prove useful for users with disabilities who rely on scrcpy to use their mobile devices.
Some distributions (like Ubuntu) package the version available when it’s out, and don’t upgrade: https://repology.org/project/scrcpy/versions
Uninstall the version from the distrib and install manually: https://github.com/Genymobile/scrcpy/blob/master/BUILD.md#simple
Fixed on
dev
branch by f7533e8896c5e362af9a2f31b2b8d849d3207cc2 + 16a63e0917e423fb417eaad3ae0ca05f16227db6.It will be in the next release (v1.18).
This allowed me to work. I found one issue and it has to do with Chrome Incognito tabs not displaying. It actually just shows a black screen but everything else still works.
No, I have no other solution. (I have this change in mind since #1935, but the Android 12 preview was not available at that time.)
Yes, I guess I will merge something like this: android12_nosecure
Unfortunately, #36 will be “unsolved”.
Any plans to fix this? I’m trying to screen record a protected content on my phone for academic purposes. Looking forward for an update.
Hey,
Anyone who wants to have pre made build for MacOs, I’ve created one separately, instructions are on the Readme.
https://github.com/me-abhishekpal/scrcpy-quickfix-secure-flag-MacOS
All credit goes to the original author(https://github.com/Genymobile/scrcpy/commits?author=rom1v), I just created the build for the unknown.
Root users may also use this fork which simply runs the scrcpy-server as the system user: https://github.com/Genymobile/scrcpy/issues/3049#issuecomment-1603612740
Yes, Android 12 Beta 1 is still SDK 30. The codename is ‘S’.
@ssalenik Seems very annoying. Mirroring apps should show exactly what’s on the device… 😦
Wait why downvote? How can I see what I’m doing with this?
In general, using BuildCompat.isAtLeastS() is the robust way to do this sort of check.
@Shnxxx there is nothing to “fix”. Its an change in Android that can not be bypassed with Scrcpy.
Probably soon (maybe next week if I can).
You can be notified on releases with Watch > Releases only on the top of github.
Can you compile a binary that can be used by Mac OS? Thank you very much!
@rom1v Wow you answered fast. It’s safe to use even before Android 12, right?
Its also crashing on DP2 😄
Odd. Now I see it open. Did you hack into how Github works? 😃
BuildCompat
is in androidx, not available from scrcpy server 😉FYI, for this check to work on the developer preview: https://github.com/Genymobile/scrcpy/blob/ca3d807e7fe2cd795d0efe74034640d1594a1954/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java#L230 Need to add, eg:
Since the preview still reports the the SDK as 30
@AfzalivE Wait you mean there is a fix to the crash? I don’t see it mentioned here. How can I get the fix? Can you please publish it here as executable files ?
I might be misunderstanding what you’re saying but we weren’t talking about the stability of Android 12. That’s in its first developer preview so bugs are expected. We were talking about the stability of scrcpy working with Android 12 after the fix discussed in this thread. Could you try the fix?
Tried all the shortcuts and wifi debugging, everything there seemed fine.
adb logcat
@rom1v please take it as refer, thanks~