Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unexpected error while obtaining screenshot from device: EOF

When I try to make a screenshot in Android Studio from some of my projects (by pressing the camera icon), I get the following message:

"Unexpected error while obtaining screenshot from device: EOF"

I can make a screenshot of the same image if I click the camera icon after opening a totally different project. Is there some corrupted file associated with the project that needs to be deleted and replaced?

like image 777
user1608385 Avatar asked Oct 23 '18 05:10

user1608385


People also ask

What is the unexpected EOF error in Python?

If the unexpected EOF error occurs when running a Python program, this is usually a sign that some code is missing. This is a syntax error that shows that a specific Python statement doesn’t follow the syntax expected by the Python interpreter. For example, when you use a for loop you have to specify one or more lines of code inside the loop.

How to prevent screenshot in Android Studio from being taken?

If you have getActivity ().getWindow ().addFlags (LayoutParams.FLAG_SECURE); set (normally used to avoid screenshots), it will also prevent you from taking screenshots from Android Studio, generating the same error Unexpected Error while obtaining screenshot. Show activity on this post.

What is unexpected EOF while parsing with a for loop?

SyntaxError: Unexpected EOF While Parsing with a For Loop Let’s see the syntax error that occurs when you write a for loopto go through the elements of a listbut you don’t complete the body of the loop. In a Python file called eof_for.py define the following list: animals = ['lion', 'tiger', 'elephant'] Then write the line below:

How to get rid of the unexpected EOF while parsingerror?

The end of file is unexpected because the interpreter expects to find the body of the for loop before encountering the end of the Python code. To get rid of the unexpected EOF while parsingerror you have to add a body to the for loop. For example a single line that prints the elements of the list: for animal in animals: print(animal)


1 Answers

I ran into this problem recently - everything had been working fine previously. Apparently it started when I migrated to SDK 26 a few weeks ago. This fixed it for me: - shut down Studio - rename adb.exe in Android\sdk\platform-tools to .saf - copy the older adb.exe from Android\android-sdk\platform-tools to Android\sdk\platform-tools - restart Studio

So basically replace the SDK 26 adb.exe with an older version...

like image 129
B. Brown Avatar answered Sep 24 '22 01:09

B. Brown