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

startsWith() on null object at ScreenEncoder.java:158 #365

Closed
SwayChen opened this issue Dec 4, 2018 · 8 comments
Closed

startsWith() on null object at ScreenEncoder.java:158 #365

SwayChen opened this issue Dec 4, 2018 · 8 comments
Labels

Comments

@SwayChen
Copy link

@SwayChen SwayChen commented Dec 4, 2018

Model: Meizu 16th
OS: Flyme 7.1.1.2A base on Android 8.1.0

log like this:

MacBook-Pro:~ allconnected$ scrcpy
/usr/local/Cellar/scrcpy/1.5/share/scrcpy/scrcpy-server.jar: 1 file pushed. 1.2 MB/s (19308 bytes in 0.016s)
ERROR: Exception on thread Thread[main,5,main]
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference
	at android.media.MediaCodec.configure(MediaCodec.java:1918)
	at android.media.MediaCodec.configure(MediaCodec.java:1873)
	at com.genymobile.scrcpy.ScreenEncoder.configure(ScreenEncoder.java:158)
	at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:68)
	at com.genymobile.scrcpy.Server.scrcpy(Server.java:25)
	at com.genymobile.scrcpy.Server.main(Server.java:109)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:285)
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
2018-12-04 10:17:42.744 scrcpy[1111:16013] ERROR: Could not open video stream
2018-12-04 10:17:42.789 scrcpy[1111:15936] INFO: Initial texture: 1080x2160
@rom1v rom1v added the device label Dec 4, 2018
@thinkhy
Copy link

@thinkhy thinkhy commented Jun 18, 2019

Refer for the blog for a workable fix: https://www.jianshu.com/p/0d29cc53199c

@SwayChen
Copy link
Author

@SwayChen SwayChen commented Aug 9, 2019

Thanks for temporary solution by @thinkhy

@SwayChen SwayChen closed this Aug 9, 2019
@Jingle-seven
Copy link

@Jingle-seven Jingle-seven commented Oct 6, 2019

meizu biss

rom1v added a commit that referenced this issue Nov 13, 2019
Fill AppInfo to avoid NullPointerException on some devices.

Fixes <#365>

Signed-off-by: Romain Vimont <rom@rom1v.com>
@rom1v
Copy link
Collaborator

@rom1v rom1v commented Nov 13, 2019

See #888

@rom1v
Copy link
Collaborator

@rom1v rom1v commented Nov 13, 2019

Could you please replace scrcpy-server.jar in your scrcpy v1.10 and test again?
SHA256: b34c8ce7f8f60e6d6ef42c3b0975c6b7650755f2d50205a2e950f996e2091bbc

@SwayChen
Copy link
Author

@SwayChen SwayChen commented Nov 15, 2019

@rom1v Yep, it works fine with v1.10. Thanks!

Scrcpy Version
Meizu Device Info

@rom1v
Copy link
Collaborator

@rom1v rom1v commented Nov 15, 2019

Thank you for your feedbacks, I just merged it in dev 👍

It will be in the v1.11 release (the version number is still 1.10 but it's not the 1.10 release, it's a dev version).

This was referenced Nov 15, 2019
rom1v added a commit that referenced this issue Nov 19, 2019
Fill AppInfo to avoid NullPointerException on some devices.

Fixes <#365>

Signed-off-by: Romain Vimont <rom@rom1v.com>
@rom1v
Copy link
Collaborator

@rom1v rom1v commented Apr 30, 2020

To fix #994, I changed the way the workaround is called.

Could you please take scrcpy v1.13 and replace this file:

scrcpy-server
SHA256: b64e6672eeb2b7c00c6f83673783bd8839ba65ea2ac7edcdeeca44676047328b

and confirm that it works without any error message.

Thank you.

rom1v added a commit that referenced this issue May 2, 2020
To avoid NullPointerException on some devices, workarounds have been
implemented. But these workaround produce (harmless) internal errors
causing exceptions to be printed in the console.

To avoid this problem, apply the workarounds only if it fails without
them.

Fixes #994 <#994>
Refs #365 <#365>
Refs #940 <#940>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants