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

i got an error when i run scrcpy v1.5 #337

Closed
puface opened this issue Nov 16, 2018 · 17 comments
Closed

i got an error when i run scrcpy v1.5 #337

puface opened this issue Nov 16, 2018 · 17 comments
Labels

Comments

@puface
Copy link

puface commented Nov 16, 2018

hi all
i update scrcpy v1.5 today .
i can build success by scrcpy server v1.5.jar file but i got an error when i run scrcpy -m 1024
the error :
397 KB/s (19291 bytes in 0.047s)
ERROR: Exception on thread Thread[main,5,main]
java.lang.IllegalArgumentException: Crop must contains 4 values separated by colons: "''"
at com.genymobile.scrcpy.Server.parseCrop(Server.java:91)
at com.genymobile.scrcpy.Server.createOptions(Server.java:72)
at com.genymobile.scrcpy.Server.main(Server.java:108)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249)

@rom1v
Copy link
Collaborator

rom1v commented Nov 16, 2018

scrcpy --version

@puface
Copy link
Author

puface commented Nov 16, 2018

hi rom1v
i use ubuntu 16.04 . scrcpy v1.4 can work to well in ubuntu 16.04 am64

$ scrcpy --version 
scrcpy 1.5

dependencies:
 - SDL 2.0.4
 - libavcodec 56.60.100
 - libavformat 56.40.101
 - libavutil 54.31.100

@rom1v
Copy link
Collaborator

rom1v commented Nov 16, 2018

aapt d badging scrcpy-server.jar | head -1

aapt is in your Android SDK directory, in build-tools/VERSION/.

If you installed it (with sudo ninja install):

aapt d badging /usr/local/share/scrcpy/scrcpy-server.jar | head -1

@puface
Copy link
Author

puface commented Nov 16, 2018

~/scrcpy/x/server$ ls
scrcpy-server.jar
puzhi@puzhi-1080ti:~/scrcpy/x/server$ aapt d badging scrcpy-server.jar | head -1
package: name='com.genymobile.scrcpy' versionCode='6' versionName='1.5' platformBuildVersionName=''

@puface
Copy link
Author

puface commented Nov 16, 2018

$ aapt d badging /usr/local/share/scrcpy/scrcpy-server.jar | head -1
package: name='com.genymobile.scrcpy' versionCode='6' versionName='1.5' platformBuildVersionName=''
the error is :platformBuildVersionName is null ? 

@rom1v
Copy link
Collaborator

rom1v commented Nov 16, 2018

OK, so it seems good.

From ~/scrcpy/, execute ./run x -m 1024.

@puface
Copy link
Author

puface commented Nov 16, 2018

hi rom1v
i got an same error .
maybe i don't use 28.0.3 version bcz my android version only working at andorid v6 ?
~/Android/Sdk/build-tools$ ls
28.0.3

@rom1v
Copy link
Collaborator

rom1v commented Nov 16, 2018

java.lang.IllegalArgumentException: Crop must contains 4 values separated by colons: "''"

This is clearly due to a change in the way the crop parameters are passed (to pass an additional parameter) in 345f885. But I don't understand why it does not work as expected on your device.

What is the result of:

adb shell printf '[%s]\\n' a "''" b

?

@rom1v rom1v added the bug label Nov 16, 2018
@puface
Copy link
Author

puface commented Nov 16, 2018

~/scrcpy$ adb shell printf '[%s]\\n' a "''" b
/system/bin/sh: printf: not found 

my android is rk3288 , it's working at android v6.0

@rom1v
Copy link
Collaborator

rom1v commented Nov 16, 2018

OK, then:

adb shell echo a "''" b

How many spaces does it print between a and b?

@puface
Copy link
Author

puface commented Nov 16, 2018

$ adb shell echo a "''" b
a '' b

rom1v added a commit that referenced this issue Nov 16, 2018
The client passes parameters to the server via "adb shell" arguments.

Use "-" instead of "" when no crop is specified to avoid empty
arguments, which are not handled the same way on all devices.

Fixed <#337>.
@rom1v
Copy link
Collaborator

rom1v commented Nov 16, 2018

@puface Thank you for the details.

Please checkout the dev branch, it should be fixed 😉

@rom1v rom1v closed this as completed Nov 20, 2018
@ghost
Copy link

ghost commented Nov 22, 2018

Hi rom1v,
I run into the same problem, but I checked out the dev branch. The git log says that this issue should have been solved.
I'm on Ubuntu 16.04 with a Android 8.0.0 device.
Thanks.

@rom1v
Copy link
Collaborator

rom1v commented Nov 22, 2018

@mgienal Did you recompile the server? (you must not use the prebuilt server, since the fix updates it)

@ghost
Copy link

ghost commented Nov 22, 2018

I see, I'm using the prebuilt server now. So do I need to build my own server to avoid the problem?

@sshock
Copy link

sshock commented Dec 21, 2018

I'm also running into this. Can we get an updated prebuilt server 🙏 ?

@rom1v
Copy link
Collaborator

rom1v commented Jan 21, 2019

@sshock Sorry, didn't have time. But now there is v1.6 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants