How to solve debug issue - java

Everything was working just fine, but then when I tried to debug again my app. It didn't work and instead, I got the message,
"alternative source available for the class java.lang.class android studio"
I didn't know what it meant. I clicked on disable, now I can't debug anymore and it says the library Dalvik.annotation.optimization.FastNative is not found (java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available)
Does somebody know how to fix this issue? I can run the app, but as you know.. debugging is very useful, especially for someone like me. That has been working with android for just one month ago
I'm using Android Studio 3.6
This is the screen I get when I try to debug

Issues of that sort usually get fixed when you make a clean build then try again, if not try invalidating caches and restarting (File > Invalidate caches/restart)

At the end, the solution was to disable the breakpoints. Especifically the Java Exception breakpoints and Excepction breakpoints, also deleted all my breakpoints just in case. And I can debug again!
To delete breakpoints just go to Run>>View Breakpointsand and uncheck
I hope this helps other newbies like me

Related

Unable to debug using eclipse debugger

So there is a small java program to add two numbers.
There is one break-point.
I used Debug as -> Java Application.
But still, Step Into, Step Over, Resume, Suspend and Terminate buttons are disabled in my eclipse.
See below:
Debugger recognized the breakpoint at int b = 3 but still the buttons are disabled.
Everything was working fine yesterday.
What should be the cause?
Possibles solutions and cause here.
The commands got disabled, probably from previous customization, (check General -> Keys) but I wouldn't think this can be the only reason to be cause of this issue.
Hope this helps you out.
I have met the same issue and fixed it. The following are the possible solutions:
Make sure that your skip all break point option is disabled
Reset your debug perspective in perspective options.
Make sure to restart eclipse after doing above things

how to fix eclipse close automatically when starting in debug mode

I use eclipse LUNA in that when I start debug mode the eclipse IDE will be closed. if any one can tell me why it happens and give the suggestion to solve it. And also tell me to start the template proposal because it won't start while entering ctrl+space,
you can probably raise a issue in Eclipse forum. If you dont have any specific requirements, you can probably go with Kepler as its more stable now.

Strange Error in Eclipse Indigo

Has anyone ever seen this kinf of error in Eclipse Indigo?
An internal error occurred during: "Label Job".
Illegal class name "com/sun+jdi/DoubleType" in class file com/sun/jdi/DoubleType
Version: Indigo Service Release 1
Build id: 20110916-0149
I've added a new Schreenshot.
Labebl Job is shown when i click on next step (F6, F8..)
JDI thread evaluation is shown when i drag the mouse on a variable for have informations.
I've never seen this strange error.
Since someone asked me to set an answer in order to mark this question as solved even if someone will probably still have this problem unsolved, but as you can see nobody solved it in different ways (since for the majority there are at least two solutions for problems), so i would mark this answer as best answer:
[My Solution] Delete your Eclipse "installation" and reinstall it to be clean from every errors. Re-install it until the problem is gone (and so there are no installation errors)
If someone is opposed to this answer as best answer, please write it down a real best answer, or make yourself agree with #Drumnbass (that "suggested" me to write the answer) to understand what is right and what is wrong.
I just faced the same issue. I was able to solve the issue by removing all the breakpoints by clicking the double cross button and then restarting the eclipse.

Testing my Java/Android app - is my setup wrong?

I just tried to test my first android app using the emulator, it crashed (as expected). So I load the debug view in Eclipse and now I'm not really sure what I'm looking for...
I see a tab that within the first thread I see a bunch of executions (i guess that's the right word) and they say: Source not found. and has a button that reads Edit Source Lookup Path...
Is there something wrong with my setup here?
No, there's nothing wrong with your setup. My advice is:
As you are still learning Android, use the logcat to catch know what causes your app to crash, instead of using the debugger.
Study how the eclipse debugger works and how to use it (you can learn that writting Java apps, no need of using android)

How do you debug a Rails application?

Is it possible to debug a Rails application in a similar way to a Java application - setting breakpoints and stepping into the code?
What are the best tools for this?
I have a hybrid Java/Ruby on Rails application which I can run in Eclipse or Netbeans.
I would like to step into some code in this app and try to figure out the cause of a problem I'm having.
In Eclipse if I set a breakpoint in my blog_controller and then choose the 'Debug' button, it seems to use the ruby-debug-ide gem to execute the code but I get this unhelpful output and no option to step into any source:
Fast Debugger (ruby-debug-ide 0.4.5) listens on localhost:56726
./war/WEB-INF/app/controllers/blog_controller.rb:1
C:/Ruby18/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.5/lib/ruby-debug.rb:101:in `debug_load'
C:/Ruby18/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.5/lib/ruby-debug.rb:101:in `debug_program'
C:/Ruby18/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.5/bin/rdebug-ide:82
C:/Ruby18/bin/rdebug-ide:19:in `load'
C:/Ruby18/bin/rdebug-ide:19
Uncaught exception: uninitialized constant ApplicationController
I'm not sure if I'm doing something wrong or if this is all I can expect.
The debugger I use the most is the ruby-debug gem, which is a gdb-esque command line debugger. Once you learn a few commands it is very quick and effective, and provides you with some handy features like being able to fire up irb in the context of your program and make on-the-fly changes.
And being command line based it comes in handy when you need to debug a on a remote server.
You can expect more. I have used Aptana's RadRails version of Eclipse to debug a Rails app as you describe--setting breakpoints and stepping through the code.
You may be doing something wrong. It looks as if it is trying to debug an individual controller file, rather than debugging the Rails app. When I try to execute a controller file from the command line, I get a similar message:
C:\workspace\myapp\app\controllers>ruby users_controller.rb
users_controller.rb:1: uninitialized constant ApplicationController (NameError)
In Aptana RadRails, I choose Run > Debug As > Ruby Application to debug the app.
For the vim users I strongly recomend looking into the vim-ruby-debugger, which fits in great with Tim Pope's rails.vim scripts.
It gives you a handy :Rdebugger command, allows you to set breakpoints and open a split window to display variable values.
maybe not relevant, but I wanted to post somewhere: got the error: "undefined method `run_init_script' for Debugger:Module" running the debugger in rails 2.3.2. Did a sudo gem install ruby-debug and the problem went away.
I'd recommend just setting up breakpoints (I actually just puts to console) for 99% of debugging with RoR - this method is simple and usable across any IDE, so you never need to learn how a new debugger works.
Actually, I had the same problem with Aptana. Run > Debug As > Ruby Application just doesn't work. I finally made the debugger work by going to the Servers tab, and then start the server in debug mode. After that, set some breakpoints and trigger the corresponding action. Hope this helps.
Debugging? That's just knowing where to look in the case of Ruby (and by extension, Rails) most of the time.
The problem in this case is that you probably still have your ApplicationController called application.rb where it should be renamed to application_controller.rb.
Debuggin in rails is simple if you know how to read the error stacktrace!! But if you need to explicitly watch out the values during the runtime then u can use the rails breakpointer.Below is the link to how-to on breakpointer ..hope this helps!!!
http://destiney.com/blog/rails-breakpointer
I can't speak for Eclipse (never worked well for me) or Aptana (not tried) but from experience I can say that both NetBeans and RubyMine will do what you want. I both cases you should probably make sure that the ruby-debug-base and ruby-debug-ide gems are up-to-date: RubyMine in particular didn't work for me until that was done.

Categories