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

scrcpy not working v1.21 windows 10 #2903

Open
VarunArora14 opened this issue Dec 27, 2021 · 13 comments
Open

scrcpy not working v1.21 windows 10 #2903

VarunArora14 opened this issue Dec 27, 2021 · 13 comments

Comments

@VarunArora14
Copy link

VarunArora14 commented Dec 27, 2021

I have read the FAQ.
I have searched in existing issues.

Environment

  • OS: Windows 10
  • scrcpy version: 1.21
  • installation method: choco (for both adb and scrcpy)
  • device model: redmi note 7
  • Android version: 10

Describe the bug
Scrcpy command is not running properly in terminal giving error

ERROR: Failed to execute: [adb], [-s], [192.168.1.6:5555], [push], ["C:\ProgramData\chocolatey\lib\scrcpy\tools\scrcpy-server"], ["/data/local/tmp/scrcpy-server.jar"]

Paths of adb and scrcpy through where.exe scrcpy are -

C:\ProgramData\chocolatey\bin\adb.exe
C:\ProgramData\chocolatey\lib\scrcpy\tools\adb.exe
C:\ProgramData\chocolatey\bin\scrcpy.exe
C:\ProgramData\chocolatey\lib\scrcpy\tools\scrcpy.exe

Environment variables defined for chocolatey/bin and chocolatey/lib/scrcpy/tools

image

Till previous versions things were working fine as far as I remember. After I updated Android Studio and scrcpy, this error is coming now. Also, when I closed Android studio before, scrcpy closed bcos adb got closed too(don't know if it is useful information)

@VarunArora14
Copy link
Author

VarunArora14 commented Dec 27, 2021

Also, I just removed 1.21 version and installed 1.20 exe file and then checked choco one, it works fine as before. It's not working for 1.21 only

@rom1v
Copy link
Collaborator

rom1v commented Dec 27, 2021

Does C:\ProgramData\chocolatey\lib\scrcpy\tools\scrcpy-server exist?

It's not working for 1.21 only

Probably a chocolatey packaging issue. Could you try the official release?

Also, when I closed Android studio before, scrcpy closed bcos adb got closed too(don't know if it is useful information)

It should not, but this is unrelated.

@VarunArora14
Copy link
Author

Tried the win64 zip file from release, same error from both wired and wireless connection. Interestingly, clicking the scrcpy.exe file with device connected wired and wireless runs the application and mirrors like before.

@rom1v
Copy link
Collaborator

rom1v commented Dec 27, 2021

same error from both wired and wireless connection

The exact same error, with the chocolatey path?

If so, then you set SCRCPY_SERVER_PATH to this value. Unset it.

@VarunArora14
Copy link
Author

VarunArora14 commented Dec 27, 2021

I tried with chocolatey path and the official release (putting it as environment variable), they give almost same error. The chocolatey error is above.
image
This is the 1.21 windows release error(not choco package)

Does C:\ProgramData\chocolatey\lib\scrcpy\tools\scrcpy-server exist?

image
Yes it does exist

The exact same error, with the chocolatey path?

Yes, the above 2 errors seem quite same to me

If so, then you set SCRCPY_SERVER_PATH to this value. Unset it.

I have never created that variable SCRCPY_SERVER_PATH as a sytem variable. Interestingly, I could not find scrcpy-server.jar file in my computer(like one in tmp/scrcpy-server.jar in the error). It was just scrcpy-server file(in scrcpy folder). Don't know if it's relevant or not.

image
(Finding scrcpy-server named files)

@rom1v
Copy link
Collaborator

rom1v commented Dec 27, 2021

Please post the text as text in a ``` block instead of a screenshot.

What if you execute the command which fails manually?

adb -s 192.168.1.6:5555 push "D:\Downloads\scrcpy-win64-v1.21\scrcpy-server" "/data/local/tmp/scrcpy-server.jar"

Interestingly, I could not find scrcpy-server.jar file in my computer(like one in tmp/scrcpy-server.jar in the error). It was just scrcpy-server file(in scrcpy folder). Don't know if it's relevant or not.

Yes, the file is called scrcpy-server on the computer, but scrcpy-server.jar on the device (see 83ace84 #944 for details).

@VarunArora14
Copy link
Author

What if you execute the command which fails manually?

adb -s 192.168.1.6:5555 push "D:\Downloads\scrcpy-win64-v1.21\scrcpy-server" "/data/local/tmp/scrcpy-server.jar"

It gives the following error -

$ adb -s 192.168.1.6:5555 push "D:\Downloads\scrcpy-win64-v1.21\scrcpy-server" "/data/local/tmp/scrcpy-server.jar"
D:\Downloads\scrcpy-win64-v1.21\scrcpy-server: 1 file pushed, 0 skipped. 80.1 MB/s (40067 bytes in 0.000s)
adb: error: failed to copy 'D:\Downloads\scrcpy-win64-v1.21\scrcpy-server' to 'C:/Program Files/Git/data/local/tmp/scrcpy-server.jar': remote secure_mkdirs failed: No such file or directory

@rom1v
Copy link
Collaborator

rom1v commented Dec 27, 2021

to 'C:/Program Files/Git/data/local/tmp/scrcpy-server.jar'

WTF ❓ 🤔

And if you remove the quotes "?

@rom1v
Copy link
Collaborator

rom1v commented Dec 27, 2021

Your shell edits the commands to rewrite paths, which causes problems. Don't use git-bash or similar to launch scrcpy or execute adb commands.

@VarunArora14
Copy link
Author

Your shell edits the commands to rewrite paths, which causes problems. Don't use git-bash or similar to launch scrcpy or execute adb commands.

I see. The scrcpy works fine with cmd but does not work with git-bash in this version for both chocolatey and windows release and gives same error for git-bash. Although since I had git-bash as main one till 1.20 I didn't face this problem with that. Will use cmd now.

And if you remove the quotes "?

It gives this error idk why.

adb -s 192.168.1.6:5555 push D:\Downloads\scrcpy-win64-v1.21\scrcpy-server /data/local/tmp/scrcpy-server.jar
adb: error: cannot stat 'D:Downloadsscrcpy-win64-v1.21scrcpy-server': No such file or directory

@DenisMondon
Copy link

DenisMondon commented Dec 29, 2021

Hi. I'm facing the same issue. When clicking scrcpy.exe directly from File Explorer or from Terminal, it works well but not from the Android Studio plugin... I have the same error as @VarunArora14
Specs : Windows 11, scrcpy 1.21

@rom1v
Copy link
Collaborator

rom1v commented Dec 29, 2021

but not from the Android Studio plugin

Which Android studio plugin? You should report the problem to them.

@VictorHerreraO
Copy link

Which Android studio plugin? You should report the problem to them.

I believe the plugin is this one

Ran into a similar issue with that plugin after upgrading to v1.21, but this comment on #2838 fixed the issue for me

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

No branches or pull requests

4 participants