Random error on application run - android

alright, weird problem here.
Cant figure out how to solve it...
My app has been running awesome until it randomly said there was an error while running. Like, it will be fine but as soon as i hit run, it will stop and say the project contains errors. But it doesn't. I have even cleaned and closed the project. See pic below...
Any ideas!?!?

Check your error log. It should be in one of the tabs where LogCat is. It should tell you exactly where the problem is.
Alternatively, expend your projects folders until you locate the file that has the red X box on it, that file contains an error if it's

Related

IntelliJ IDEA editor does not open my XML layout files

I tried finding a similar topic, but could not find one.
IntelliJ IDEA crashed (along with my PC) and when I got it back and running, I saw that I can not preview any XML files. I could before the crash, of course.
All I get is what you can see in the screenshot : I can not even chose target API, none of the options do anything, and I tried stretching the view, but nothing happens.
Here's the screenshot :
http://tinypic.com/r/10ct1g3/9
The error I got was :
Exception in plugin Android Support. 5 minutes ago. Occured once since the last clear. Unread.
Error message :
null
I really don't have a clue what to do.
If you have this issue than normally it already helps if you click Build -> Clean Project and then Build -> Rebuild Project.
After that it should work. If during that process an error message pops up then that is the reason why the preview doesn't work.

Cleaning my project in Eclipse caused errors

So I've been working on projects for my class and I had a small error in an extra instance I was calling. I hit clean to see if it would clear it out and instead it created errors on all of my buttons and all of my toasts. It now says they all cannot be resolved or are not fields. They were all working fine until I had hit clean as I had tested everything right before doing so. Has anyone else had this occur?
I know it sounds weird, but this occurs when there is an error in one of the .XML layouts, no matter Eclipse is not detecting it. Please check any recent changes in XMLs and clean again.

MyEclipse: Changing Android codes takes no effect

I know this is a rare question. Even if there are people using MyEclipse for Android development is doubted :(
The annoying thing is that after I modified my Android project (like an Activity class of a xml file), the project remained the same as it was when I imported it.
I thought there is an important feature that demonstrates this error: When I run my Android project and the console reported that "Activity not started, its current task has been brought to the front". This line occurs because the project didnt changed while as a matter of fact I did change the project and saved it.
Is there anyone has the same problem like me?
-------------add in Oct. 28-------------------
This was what I did: first, I modified one of my activities by commenting out the Toast functions; and then, I ran it however the Toast line still showed on my Genymotion emulator

Not launching from Eclipse to debug

I need help...I don't have much hair left to pull out.
I use Eclipse and I use the "Project Explorer"...
I am no longer able to launch my app. It now tells me it is having errors but not marking anything with a red X other than title. It calculates up to Launching App name 100% then says there are errors. any time I change anything and save it the x on the disappears, so I attempt to run it and comes back with the red X and error that there are errors, but I have no clue. I even deleted everything I added to put it back to the last launchable version and even that isn't working.
I have no clue how to read the log cat or the error log.
I tried cleaning the project but the same thing as above happens.
This makes no sense...there is even an R.java file. I have no clue where to even look for an error or how to find it...
Please help...I'm sure this something simple that I am overlooking.
Do you have the Problems view open and visible? It will list all build/compile errors.

Source code hiding in plain sight or disappearing into a cloak of invisibility

The last time I ran my app, it moved from the first/primary Activity to the next one, as it should
have, when I selected a button to perform that Intent.
Now, however, the debugger opens up and I get a slew of messages in the Debug tab. The first one,
representative of the rest, says, "ActivityThread.performResumeActivity(IBinder, boolean) line: 2120"
???
It says, "Source not found" with an "Edit Source Lookup Path" button below it in Debug view which opens when I try to move to the next Activity from the main one. As stated, it worked just fine the last time I worked on this app (a few days ago), and the location of the source hasn't moved, so how could that be the case...???
When I then switch back from Debug perspective to Java perspective in Eclipse, I get:
"The app has stopped unexpectedly. Force close?"
Have you tried cleaning the project? mine was force closing out of nowhere before, and once I cleaned it, it stopped. Try that.
First of all try cleaning the project. Secondly I have came across the same errors,Android has a great framework to work in. However, it is in its infancy and debugging my code has been a very big problem for me. Whenever something goes wrong in the code, I always get "source not found" error. It doesn't tell me I have a nullPointer exception , or string is incomplete. No matter what's wrong with the code, I always get "source not found" error. The reason that happens is Android doesn't pack the source along with the application it sends to the emulator (maybe they should do that for a debugging run). After searching the net for a while, I came across this solution - wrap your code in a try and catch block and then log the exception to console. By doing so you will exactly know from where the error is getting generated.
"Source Not Found" just means the line of code that generated the exception is in a binary file. It does exist, Eclipse just can't show it to you.
It turns out that my declaring a SharedPreferences object:
SharedPreferences KITPrefs;
...but then failing to instantiate it was the culprit. Now that I've added:
KITPrefs = getPreferences(Activity.MODE_PRIVATE);
...it works fine now.

Categories

Resources