Android: unable to evaluate locals while debugging in eclipse - android

Ever since updating my android sdk and eclipse plugin, I cannot see the values of local variables while debugging in eclipse. This worked fine previously. Has anyone else experienced this and found a solution?
Late edit, but an important note:
This only happens for classes in projects marked as "Is Library". I have 2 projects, one of which is marked as an android library, the other of which utilizes this library. When I run an activity from the second project, I can evaluate local variables for its classes but not the library classes.

Sometimes, I have the problem that I have to reboot Eclipse cause it is not connecting correctly to the emulator(or the device) on debug-mode. Otherwise, you can also try by going to your
/android-sdk/platform-tools/
folder and there, run adb.
You can try to reboot the demon and so on by running
adb kill-server
and after, start it again by:
adb start-server
Hope it is going to work.....Otherwise the other solution could be to reinstall the Android plugin to see if there was a problem there....

Try one of the two things:
Window -> Reset perspective..
Just close that "Variable" window and reopen.

Would you like to share the code with us?

Try with
Window>Preferences>Java>Compiler>Compliance and Classfiles
check ON "Add variable attributes to generated class files (used by debugger)"

Related

Android studio isn't opening [duplicate]

Every time I run Android Studio, this loading screen pops up, but Android Studio stays here and doesn't load. It's like this following picture except that the loading bar is loaded all the way but stuck there. I am running Windows 10.
I have tried many things, including setting the system variables JDK_HOME to where my JDK is located and the same for JAVA_HOME. I have also set a path. I ran as admin many times and let AS through a firewall.
I have also restarted and reinstalled countless times.
The version of AS is 2.0, and I am running the latest versions of Java.
Any help?
Open file Android Studio setup directory/bin/idea.properties
Add disable.android.first.run=true to end
Restart Android Studio
PLEASE NOTE: This will break patch updating to the next version. We
now check full binary checksums on the whole installation to prevent
various install corruption bugs as well as to preserve application
signatures. Therefore, make a copy of this file first, and before
updating, put it back.
Please try the following method to fix that issue:
Find the folder of your AndroidStudio: based on the following directory
macOS: ~/Library/Application Support/Google/AndroidStudio[version]
Delete the AndroidStudio folder.
Restart
Ref:https://developer.android.com/studio/known-issues#studio-config-directories
In order to know how to debug the problem, I executed the bin\studio.bat script in the terminal and inspected the actual Idea exceptions in order to fix the problem.
For me, this was the issue:
ERROR - llij.ide.plugins.PluginManager - java.net.BindException: Address already in use: bind
java.util.concurrent.CompletionException: java.net.BindException: Address already in use: bind
This means the plugin manager is trying to listen on a port that is not available. Is something listening on that port? For me, it was the stupid "excluded ports" by Windows, so I simply stopped the service:
net stop winnat (as administrator), and confirmed that Android Studio started to work.
No need to re-install, delete precious configuration (and plugins, etc.). Just read the log provided by the bin\studio.bat script, and I was able to fix the issue.

Android Studio : The application could not be installed: SHELL_UNRESPONSIVE

i'm trying to install my app debug from my android studio. it's work well yesterday, but today when i try to install it again, the application cant be installed on my device and showing error like below on my android studio.
Installation did not succeed.
The application could not be installed: SHELL_UNRESPONSIVE
The device timed out while trying to install the application.
Retry
what should i do? i tried install on other device, and it worked fine. My device is Redmi 4X and other device is Samsung J3
Faced the same issue, not sure of the reason but in Android studio, Click on the File -> Invalidate Caches/ Restart and then it starts to work.
I got same issue with my device. i restart my device and its work properly.
The problem is because you don't have the proper SDK for the Android version. I'm telling you because a month has passed for me too. The solution is to download the appropriate pack in the SDK Manager.
If you have doubts how to enter:
Close the project.
In the welcome panel click on settings, then choose the SDK Manager option.
Click show package details and select the version for Android and choose all packages.
Finally you click ok XD
Try this method if it works perfect greetings
If other answers didn't help and previously application was installing correctly on your device, try to check your AndroidManifest file. Check that nothing forbids to install your app because of os version conflict or manifest merging errors or other reasons.
I came across this problem recently, through process of elimination I determined the cause was related to dependencies in the build.gradle(your app name).
I suggest working backwards and comment out everything that was added since the last known working build/install.
In my case I have a legacy app developed back in 2016 being rewritten, dependencies for signalR have changed quite a bit since then, the original libs where causing the install to fail while everything else seemed excellent, not even a single build error was occurring. Commenting out the libs and references got the application to a runnable state.
In my case, I deleted the emulator and recreated it. It solved the issue.
Before this, I had already tried following which did not work for me:
From menu: File->Invalidate cache/restart.
Deleting .cxx, .idea, .gradle, build folders and rebuilding.
Cold boot device emulator
Posting this in case someone is trapped in my kind of situation.

Android Studio Gradle Error - Protocol Family Unavailable

So I am relatively new to Android dev. and have been getting Android Studio set up on my computers. I have it set up just fine on my Mac. When I downloaded and installed it on my Windows 8.1 desktop the gradle build seems to fail every time. With an error message stating that the Protocol Family Unavailable. I've tried several things including uninstalling and reinstalling Android Studio.
NOTE: I did try what was said to work here Gradle project refresh failed - Protocol family unavailable yet it did not solve the problem for me.
When I used Stunnel I faced this problem and my problem was solved when I disconnented it.
Check too see if you have any Stunnel, Vpn or Proxy connection and if so, disconnect it.
I also had this problem and the referenced thread also didn't work for me.
What did work was setting _JAVA_OPTIONS environment variable to make Java use IPv4.
_JAVA_OPTIONS = -Djava.net.preferIPv4Stack=true
Note that Android Studio sets this variable in the vmoptions file. But for some reason, it isn't used by the Java VM started by Android Studio to run Gradle daemon.
After I did that, everything started to work ok and Gradle could build my project.
I hope it helps.
I run into this problem when my firewall blocked studio64.exe from connecting to the internet. I fixed it by granting access.
You could try to fix it temporarily by disabling your anti-virus software while using Android Studio. I'm not entirely sure it will work, but it's worth a try, it worked for me, though I'm aware-, and agree with that this is far from a permanent fix, but it might be good enough while waiting for a fix from the Android Studio team, at least it will let you keep working!
Hope this helps!
"Run command prompt as administrator - type cmd in the 'search programs and files' text box in the Windows Start menu; right-click and select 'Run as administrator'.
At the command prompt, type
netsh winsock reset
Restart your PC
This worked for me."
I found it in
Android studio "Cannot start internal HTTP server"
My problem was using a VPN on an per-app basis connection mode while Android Studio was blocked.
I solved same problem by disabling antivirus.
for me proxifire.exe was running in background and cause to connection problem, after closing problem gone
This answer is same as first answer in this topic, means first answer is true and works well, but my answer is in detail, i did not set that variable, just turn off proxy.
This error arises due to proxifier running that basically tunnels the computer in ipv6 which is not supported by daemon.
So to overcome this and build project either close the proxifier application from system tray or add the environment variable
_JAVA_OPTIONS= -http://Djava.net.preferIPv4Stack=true

Unhandled event loop exception in plugin org.eclipse.ui

I recently installed/updated eclipse environment. When I try to compile the code I'm getting the error as:
Unhandled event loop exception
and says the error is in the org.eclipse.ui plugin-in.
Can any one help me on this?
Ok please follow the following steps:
First close your eclipse.
Go to your Eclipse Folder
You will find the "Features" & "Plugins" folders in it.
Open the "Features" folder and search for the "org.eclipse.ui" folder or .jar file. If found then cut it & paste on desktop.
Open the "Plugins" Folder and search for the "org.eclipse.ui" folder or .jar file. If found then cut it & paste on desktop.
Now start your eclipse & try to compile.
It's possible that while updating it has downloaded the wrong updates.
Finally after spending 2 hours trying to fix Eclipse, I just re-installed Eclipse and everything worked in the following 15 minutes.
no need to worry.. if you running android application.. give eclipse some time... restart your computer after some times open eclipse clean all projects.. now try.. it working perfectly now.. :D
Cleaning all projects worked for me!
I also had "Unhanded event loop exception" in Eclipse neon.3 on Linux Mint, and there were other problems such as the perspective button bar either not showing or else throwing an error when you attempted to configure it.
I found the solution in comment #7 of an Eclipse bug discussion.
The solution is to start eclipse after first executing these commands:
export SWT_WEBKIT2=1
export SWT_GTK3=0
The solution here was not working for me but after digging through the internet it became clear that some other software is messing up eclipse.
In my case it was the hydra vision in the catalyst control center. As I can see any application that messing with window handling will or can cause this error, based on the variety of setups and background from other people who experienced this problem.
One of the best ways to determine which application is causing the problem (if it's an applicaion) is:
open the task manager
start killing processes (start with unknown or new or any video related driver).
After each process kill check eclipse (restart it each time, just in case)
and after killing hydra vision the error did not pop again (no restart was needed but who knows how other application works).
Hope this will help others to not spend a day on this annoying problem.
Best for all
In conjunction to cleaning all of the projects as suggested by Michael Martin, I also appended this line in the eclipse.ini:
-XX:+UseConcMarkSweepGC
Per this documentation.

Apk only runs in debug mode. Apk started with "Run" in Eclipse stops on breakpoints

I note that this has been asked before but I haven't found an answer yet. The main tell tale of this problem is that Eclipse stops on break points when the apk has been deployed as "Run"
I've done these so far and none produce a correctly running "Run" build from Project shell -> Run As -> 1. Android Application
• Disconnecting, uninstalling and re installing the apk does not fix the problem (this is a tablet device, not an emulator.)
• Made all of the project and library projects write able using the file system
• Brand new projects work correctly e.g. they don't stop on breakpoints in "Run" mode in the same Eclipse workspace as the problem project
• Window -> Preferences -> Run/Debug(expand) -> Launching "Launch in debug mode when workspace contains breakpoints" is set to never
• Closed and opened Eclipse
• Killed all of the running processes under the "Debug" tab in that perspective
• Cleaned the entire workspace both in Eclipse IDE and manually by deleting the res and gen folders of the main and library project dependencies
• Checked for the occurrence of the word "debug" in the project build files
• Clean built the project from the command line using: ant clean then ant release
Interestingly enough, when I clean build from the command line then fresh-install the new apk, if Eclipse is open the debugger will attach to the running process and stop at the first break point! If Eclipse is closed, the program will wait for the debugger with the standard "Waiting for Debugger" dialog.
So something is broken in the build process (haven't figured out what all files are getting involved yet) and/or something in .metadata and/or some depenency.
edit
I've found a file at:
C:\Projects\Mobile\Android\.metadata\.plugins\org.eclipse.debug.core\.launches\MyProjectName.launch
in the xml:
<launchConfiguration type="com.android.ide.eclipse.adt.debug.LaunchConfigType">
Don't know if it's a clue, but if I delete the file Eclipse will just replace it with the same.
edit
*Confirmed that the project Runs correctly when built and run from another machine, so I suspect that it's my work machine's Eclipse workspace that's causing this issue. Maybe I need to throw out all of the workspace's metadata and start over.
I encountered same issue. The solution is, restarting your device. Good luck.
You said you have breakpoints?
Try:
Window -> Preferences -> Run/Debug(expand) -> Launching
There should be a section entitled "Launch in debug mode when workspace contains breakpoints"
If that is not on "Never" that would be your problem.
I have the same problem and I need 4 steps to resolve them:
Disconnect the device
Reboot the device
Clean and build all the projects in workspace.
Start the app in emulator in Run mode and check it's ok.
Start the app in the device in Run mode and all works ok.
Only restarting the device not works for me!
I've encountered same problem: I could run my application only in debug mode, but it won't properly start when I press 'run' button. I've tried all solution here, but nothing works for me.
After some time I've found android.os.Debug.waitForDebugger(); in the begining of my Activity. I hope this answer sometimes help someone, because this question was first in Google, when I search for help.
Update
Use Intellij instead of Eclipse for Android development (far fewer IDE interface bugs) and then disregard the following altogether:
Two important rules I've found since the original post:
1) Get in the habit of waiting until Eclipse is finished build the workspace - the indicator shows up in the bottom left corner of Eclipse by default. WS build times can take minutes in a large project with multiple libs. Don't change anything until the build is complete.
2) Close all projects in the workspace and reopen them one-at-a-time starting with the project with no lib dependencies and so on. Make sure not to open a project until you can verify the the workspace has finished building what is already open. Fix any issues along the way before opening the next project.
Good luck.
Happens to me sometimes - have you uninstalled the application completely from the handset and tried to reinstall? Can you install the apk and then disconnect the handset from the machine? (obv won't work if you're using an emulator)
Faced same issue on Samsung S4 and issue is fixed by unchecking "Wait for debugger" option under "Developer options".
Had the same issue, check that you haven't got this line of code anywhere in your project:
android.os.Debug.waitForDebugger();
It may exist in a Service for debugging purposes, once you comment it out it will work in release mode. The problem is that this line of code waits for the debugger, and if you're not running in debug mode it will wait indefinitely

Categories

Resources