Application Forced Close in Emulator - Java for Android App Development

I am developing my first app using tutorials given on android website.When i run app on emulator it gives me message "Application has closed unexpectedly Forced Close".How to fix it

Please post your code and logcat here.

Logs and src please
sachin261 said:
I am developing my first app using tutorials given on android website.When i run app on emulator it gives me message "Application has closed unexpectedly Forced Close".How to fix it
Click to expand...
Click to collapse
frenziboy is rigth man we cant do anything without it also mention which tutorial you're on i guess its the first message one????
Eclipse will give the logs you can even type adb logcat for logs if in the android-sdk/platform-tools directory

sachin261 said:
I am developing my first app using tutorials given on android website.When i run app on emulator it gives me message "Application has closed unexpectedly Forced Close".How to fix it
Click to expand...
Click to collapse
seeing how you're probably new to android development you may not know what the logcat is. It should be one of the tabs below where you put code in eclipse. you'll see the tabs 'problems, console, logcat, ..., ...' click on the logcat and that will show you what caused the app to crash in red.
if its not there, at the top click Window>Show View>Other>Android>logcat and it will open
like the others said we would need to see your logcat before we could be certain what caused the crash.

@frenzyboi @sak-venom1997 @Acela1230 I am also trying to develop a simple calculator but getting fc. Please help me on how to post logcat here http://forum.xda-developers.com/showthread.php?t=2245339

Related

Can't compile, always errors (any script, caused by IDE)

No matter what I do or use, (Aptana or Eclipse) errors always show in the XML files and I can never get anything to run.
I've done google searches and I can't find answers...I also can't seem to force ignore the errors in the IDE.
The other day I almost broke my keyboard, it's driving me crazy because it's such a stupid issues I can't seem to fix.
PLEASE, I just want it to work...xda is my last resort, I don't want to bug you guys about this, but I just want answers.
*** BUMP ***
without the files and errors no one here can help you.
http://pastebin.com
nenn said:
without the files and errors no one here can help you.
http://pastebin.com
Click to expand...
Click to collapse
You want me to upload the entire eclipse/aptana setup I have?
This is not unique to the sources, this happens with any code...this has something to do with my IDE setup.
Same thing happens on my workstation and my desktop at home.
in the spirit of understanding the problem, how far along developing are you? have you tried compiling the sample code thats out there already?
without information on what you know how can anyone help you solve your problem?
nenn said:
in the spirit of understanding the problem, how far along developing are you? have you tried compiling the sample code thats out there already?
without information on what you know how can anyone help you solve your problem?
Click to expand...
Click to collapse
Yes, can't compile anything...it always tells me an XML error.
I'm not at a point where I can give you the exact error, but I probably can tomorrow.
Start Eclipse and delete all Errors in the Problems View.
Then try to recompile.
Sometimes it solve the problems
Post the xml manifest and errors.
It is a pain to get started. Take a break and try again.
I would recommend un-installing Eclipse and any Android SDK stuff and start from scratch re-installing everything. If you haven't already, use the Android developer section walkthrough to set Eclipse up properly. They indicate which versions of Eclipse and the JDK to download. Maybe you installed the wrong versions of Eclipse or JDK?
Just something to try.
PM Kingklick he's the best at compiling Android.

Market won't stop force closing! - PLEASE HELP!

Hi all,
Last night, out of the blue, every time I tried to download an app from the Marketplace I got the error "process com.android.vending has stopped unexpectedly" and a force close. I have no idea what would have caused this as everything was working fine up until last night, I can't think of any strange updates or anything.
Anyway, after some Googling I cleared the market cache and data as recommended but now I can't even open the Market app at all - well it opens, but force closes straight off the bat (I see the Android TOS in the background). I now get the process com.android.vending has stopped unexpectedly error on boot and whenever launching the market.
I've attempted to install a newer market.apk (current one is 1.82) but Android won't allow me.
The only other recommendations people have given on here to those experiencing this issue on dedicated Droid handsets is to either do a full format/install or to flash something via recovery (doesn't look like I can do this on my SD build)
A couple of months ago I was getting force closes on the calender app and someone sent me a droid.zip file which had a fsck.exe inside it which allowed me to repair my data.img which in turn fixed the problem. I've formatted my PC since than and lost the files and can't find them via Google, at least not one that'll run under Windows command prompt with "fsck.exe data.img" after placing the data.img in the same directory. Can anyone point me in the right direction? Or better still provide an alternative method for fixing this issue?
Using Darkstone's SuperRAM 1.5 Froyo build.
Many thanks!!
maybe you should try an other android rom ?
The best and quickest way to fix this is to use market.app from same build what u got.
So its mean u need to extract this particular app from the ROM and copy it to the /system/app
Or if u dont know how to extract it just ask in your ROM thread so someone whos know how to extract it and than can post it for download.
SMS92 said:
Hi all,
Last night, out of the blue, every time I tried to download an app from the Marketplace I got the error "process com.android.vending has stopped unexpectedly" and a force close. I have no idea what would have caused this as everything was working fine up until last night, I can't think of any strange updates or anything.
Anyway, after some Googling I cleared the market cache and data as recommended but now I can't even open the Market app at all - well it opens, but force closes straight off the bat (I see the Android TOS in the background). I now get the process com.android.vending has stopped unexpectedly error on boot and whenever launching the market.
I've attempted to install a newer market.apk (current one is 1.82) but Android won't allow me.
The only other recommendations people have given on here to those experiencing this issue on dedicated Droid handsets is to either do a full format/install or to flash something via recovery (doesn't look like I can do this on my SD build)
A couple of months ago I was getting force closes on the calender app and someone sent me a droid.zip file which had a fsck.exe inside it which allowed me to repair my data.img which in turn fixed the problem. I've formatted my PC since than and lost the files and can't find them via Google, at least not one that'll run under Windows command prompt with "fsck.exe data.img" after placing the data.img in the same directory. Can anyone point me in the right direction? Or better still provide an alternative method for fixing this issue?
Using Darkstone's SuperRAM 1.5 Froyo build.
Many thanks!!
Click to expand...
Click to collapse
yz.hd said:
maybe you should try an other android rom ?
Click to expand...
Click to collapse
Not really an option - The build I use is the most stable and one of the most widely used here on XDA (outside the Nand forum) and has been nigh-on perfect up until now (in daily use since before Christmas). I can't replicate how and why this happened so there's just as much chance of it happening on another ROM. Google suggests it's a common problem with the fix (for non rooted/savvy) people to factory reset their devices.
There's got to be a better way and I'm sure the crew here will find it!
The best and quickest way to fix this is to use market.app from same build what u got.
So its mean u need to extract this particular app from the ROM and copy it to the /system/app
Or if u dont know how to extract it just ask in your ROM thread so someone whos know how to extract it and than can post it for download.
Click to expand...
Click to collapse
Thanks - I'll look into doing it now. I've had no luck installing various Market apks though (with the default market disabled / cleared, etc.) so I'm unsure of the results!
SMS92 said:
Not really an option - The build I use is the most stable and one of the most widely used here on XDA (outside the Nand forum) and has been nigh-on perfect up until now (in daily use since before Christmas). I can't replicate how and why this happened so there's just as much chance of it happening on another ROM. Google suggests it's a common problem with the fix (for non rooted/savvy) people to factory reset their devices.
There's got to be a better way and I'm sure the crew here will find it!
Thanks - I'll look into doing it now. I've had no luck installing various Market apks though (with the default market disabled / cleared, etc.) so I'm unsure of the results!
Click to expand...
Click to collapse
This should help cos if u do it this way u actually not installing/reinstalling the app. u actually repleace the sys market.app for the original one from the ROM. So there is no way it will not work again if it was working before after u flashed the ROM.
I'm pretty sure it will do the trick, but also I may be wrong .
I had some issue on my ROM with cam.app and this proced. helped me.
Hey,
you can try this (very simple):
1. Open terminal emulator
2. type "su" (without quotes) and hit enter
3. type "fix_permissions" (without quotes) and hit enter
4. wait until process is done and exit terminal
5. maybe reboot, but should be fine without reboot
This is a common way to fix force closes, so maybe this helps in oyur case too.
Greetz Dom
FIXED! [Edit: not]
Here's what I did.
Downloaded THIS
Extract it to C:\Droid
Boot into Win Mobile and move your data.img in \Android\ into the \Droid\ folder on your PC.
Start > Run > CMD
type "cd c:\droid" (without quotes) to get into the directory you've created.
Type "e2fsck -f data.img" (without quotes) and say 'y' (yes) to all the errors you encounter. There will be dozens. When done you'll be notified the modified data.img has been saved.
Copy the newly modified data.img from \Droid\ to \Android\ on your device.
Boot into Android - things might be a bit slower/laggy at first.
All should be well!
Edit: This fix seems to have really slowed my phone down. It takes at least 2x as long to run stable on boot (i.e. stop lagging, load all background apps etc). I've imported my previous data.img over and will be trying the fix by Dom (above).
Edit2: And I'm now getting com.android.media force closes with the modded data.img! Music app won't work. Jesus!
ricola7 said:
Hey,
you can try this (very simple):
1. Open terminal emulator
2. type "su" (without quotes) and hit enter
3. type "fix_permissions" (without quotes) and hit enter
4. wait until process is done and exit terminal
5. maybe reboot, but should be fine without reboot
This is a common way to fix force closes, so maybe this helps in oyur case too.
Greetz Dom
Click to expand...
Click to collapse
Thanks for that Dom, I'll keep that in mind for next time! Great tip!
ricola7 said:
Hey,
you can try this (very simple):
1. Open terminal emulator
2. type "su" (without quotes) and hit enter
3. type "fix_permissions" (without quotes) and hit enter
4. wait until process is done and exit terminal
5. maybe reboot, but should be fine without reboot
This is a common way to fix force closes, so maybe this helps in oyur case too.
Greetz Dom
Click to expand...
Click to collapse
Hey Dom, terminal tells me "fix_permissions: not found" when I run fix_permissions. Am I missing something? (I've su'd before hand) Guess Darkstone hasn't included this script in his rom?
Same here ...?
SMS92 said:
Hey Dom, terminal tells me "fix_permissions: not found" when I run fix_permissions. Am I missing something? (I've su'd before hand) Guess Darkstone hasn't included this script in his rom?
Click to expand...
Click to collapse
Sent from my HD2 Jaws-MIUI
Did fix_permissions via the app ROM Manager and the Market force close still remains
How about getting a fresh copy of the ROM, and just keeping your data.img. It may not work, but it's surely worth a go.
SMS92 said:
Hey Dom, terminal tells me "fix_permissions: not found" when I run fix_permissions. Am I missing something? (I've su'd before hand) Guess Darkstone hasn't included this script in his rom?
Click to expand...
Click to collapse
rikardo1979 said:
Same here ...?
Sent from my HD2 Jaws-MIUI
Click to expand...
Click to collapse
Hmm, it seems that this script isn't inluded in your roms. But for you SMS92 it seems that it is another problem anyway.
If you wanna try sth. else see this:
http://all-google-android.com/google-android-forums/t-mobile-g1-modders/fix-permissions/
This is an "improved" fix permission tutorial which goes further than the command I posted above...quote from the link above: "fix_permissions is only intended for correcting ownership issues. It does not modify permissions, as is being requested."
In this post is a downloadlink for the advanced script so it doesnt matter if its already included in the rom...
@ricardo: see here if you still wanna try it: http://modmymobile.com/forums/567-motorola-backflip-general/556261-fix_permissions-script.html
Greetz Dom
johncmolyneux said:
How about getting a fresh copy of the ROM, and just keeping your data.img. It may not work, but it's surely worth a go.
Click to expand...
Click to collapse
It's a no-go I'm afraid.
So far the only thing that's worked is running the repairs on my 2gb data.img using e2fsck on my PC, but this in turn created a load more problems (com.process.media started force closing and the rom seemed to be much slower)
Will try some more suggestions tonight.
if your running gingerbread make sure the app is installed on the phone not the sd
I'm also suffering from this issue it started for me when an automatic update downloaded (which I didn't install) I will see if any of the above fixes work for me & if not I will start with a fresh copy of the ROM. Have to admit I have barely used winmo since I started using this build!
I have the same problem using froyo 2.2
I've had the same problem, just did a totally fresh install, ok now
Sent from my HTC Desire using XDA Premium App
robdee102 said:
I've had the same problem, just did a totally fresh install, ok now
Sent from my HTC Desire using XDA Premium App
Click to expand...
Click to collapse
Any chance you could walk me through the steps you took for a fresh install? I am at my wits end with the FCs and a mount/partition error. Here is my setup:
HTC Hd2 Leo
HTC Desire
Android 2.2.1
Mod darkstone SuperRAM FroYo v1.5
Build FRG8
I am up for a new ROM or whatever to get my phone back in order. Thanks so much!
BOYPPC-SHIFTPDA v.37 Market Force Closes
BOYPPC-SHIFTPDA v.37 Market Force Closes
Please Help my Market is constantly force closing on me the error is:
Sorry!
The application Market
(process com.android.vending)
has stopped unexpectedly.
Please try again.
then it has a force close button.
I would really like to install some apps with the market but
every time I try and use the market I get this error,
I am running the BOYPPC-SHIFTPDA v.37 ROM
Please Help Me

[Q] NY Times App Crashes

According to play.google.com, the NY Times app is compatible with my rooted NST. It downloads and installs, but crashes when I try to open it. Does anyone have any ideas for getting the NY Times app to work?
I have a NST with firmware 1.21 that was rooted with NookManager (http://forum.xda-developers.com/showthread.php?t=2040351) and further updated with NTGappsAttack (http://forum.xda-developers.com/showthread.php?t=2086582).
What does logcat say when it crashes?
DK what logcat is
Renate NST said:
What does logcat say when it crashes?
Click to expand...
Click to collapse
I am mostly a newbie with rooting. I don't know what logcat is or how to find it.
You need to learn about ADB.
There is tons of stuff about it on XDA and on this forum.
Here is one such source: http://forum.xda-developers.com/showthread.php?t=879701
Once you have an ADB shell, type logcat.
Then start your NY Times.
Look at all the junk it spits out and copy and drop it somewhere.
If you can edit it down to just the interesting parts you can post it here.
Renate NST said:
You need to learn about ADB.
There is tons of stuff about it on XDA and on this forum.
Here is one such source: http://forum.xda-developers.com/showthread.php?t=879701
Once you have an ADB shell, type logcat.
Then start your NY Times.
Look at all the junk it spits out and copy and drop it somewhere.
If you can edit it down to just the interesting parts you can post it here.
Click to expand...
Click to collapse
If you don't hate GUI, you can use monitor (C:\android-sdk-windows\tools\monitor.bat) from android-sdk-windows. You can filter logcat messages nice and easy...
ApokrifX said:
If you don't hate GUI...
Click to expand...
Click to collapse
You can even use tools\ddms.bat
Renate NST said:
You can even use tools\ddms.bat
Click to expand...
Click to collapse
Yep. Same thing from logcat perspective.

How to diagnose a Settings error ...

Hi - I was wondering if I could get some assistance in an issue I'm experiencing please.
I'm trying to diagnose a particular "Unfortunately, Settings has stopped" error message and why I'm getting it - and I'm trying to use this as a stepping stone into getting back into Android programming.
I've had a look at the logcat logs and can't see anything that particularly matches that particular string, but I see a section that starts with
"[ 02-27 23:55:51.509 28773:29176 E/AndroidRuntime ]
FATAL EXCEPTION: pool-1-thread-1
java.lang.OutOfMemoryError"
Could someone tell me if this is indicative of that "Settings has stopped" error please ?
If so, then I do not see a line that gives a "Caused by" reason - is there any further diagnostics that I can do without having to resort to a full system restore ?
Thanks in advance.
downrange914 said:
Hi - I was wondering if I could get some assistance in an issue I'm experiencing please.
I'm trying to diagnose a particular "Unfortunately, Settings has stopped" error message and why I'm getting it - and I'm trying to use this as a stepping stone into getting back into Android programming.
I've had a look at the logcat logs and can't see anything that particularly matches that particular string, but I see a section that starts with
"[ 02-27 23:55:51.509 28773:29176 E/AndroidRuntime ]
FATAL EXCEPTION: pool-1-thread-1
java.lang.OutOfMemoryError"
Could someone tell me if this is indicative of that "Settings has stopped" error please ?
If so, then I do not see a line that gives a "Caused by" reason - is there any further diagnostics that I can do without having to resort to a full system restore ?
Thanks in advance.
Click to expand...
Click to collapse
Well an Out of memory error will cause a force close, so it should be the cause for the message you see. Out of memory means your app is trying to get more ram that it is allowed by the system. Most of the time this happens when dealing with large bitmaps (perhaps forgot to recycle them?) or in an infinite loop.
You'll have to manually debug the thread to see where the problem is.
SimplicityApks said:
Well an Out of memory error will cause a force close, so it should be the cause for the message you see. Out of memory means your app is trying to get more ram that it is allowed by the system. Most of the time this happens when dealing with large bitmaps (perhaps forgot to recycle them?) or in an infinite loop.
You'll have to manually debug the thread to see where the problem is.
Click to expand...
Click to collapse
Hi - many thanks for responding.
I'm sort of cheating a bit as I'm trying to diagnose a bug not of my own making - i.e. I haven't actually written an application - I've downloaded a few apps from the Google Play store and one (or more !) is causing them to crash with the aforementioned error when I go into Settings->Apps and I'm trying to localise which application it is.
As it was really bugging me I've since factory reset my phone, and the problem appeared when I installed the latest version of the Shazam app. More worrying is that I've uninstalled the app and carried out a power cycle of the phone and the issue is still appearing - which means either that :
a) Shazam has somehow corrupted the OS and the phone requires another rebuild
b) It's not Shazam
Unfortunately I have no idea on how to take this further

S7 EDGE reboot everytime µTorrent is launched

Hi Guys,
I have a weird problem with my S7 Edge, everytime I launch µTorrent my phone reboots few minutes after
Can anyone help please
Thanks in advance
Logcat maybe?
But thinking logically, if its a reboot, does it have some Permission issues and is causing the device to crash?
Your asking abit of a needle in a haystack unless this is a common issue, If you can post the Logcat we can get an idea why its crashing / rebooting
dave7802 said:
Logcat maybe?
But thinking logically, if its a reboot, does it have some Permission issues and is causing the device to crash?
Your asking abit of a needle in a haystack unless this is a common issue, If you can post the Logcat we can get an idea why its crashing / rebooting
Click to expand...
Click to collapse
Thanks Dave
What's a Logcat please? please show me how to do and I will share it
The_Warchitect said:
Thanks Dave
What's a Logcat please? please show me how to do and I will share it
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1726238
Or google how to extract Logcat android
(The System Log file)
There is alot of Apps on the Play-store that will also extract this for you.
Just search google play "Logcat"
Ideally you want to capture the log straight after a boot when the crash / reboot occurred.
Will do that immediately
Here it is
I launched it again and my phone rebooted a second time log attached
I'm no expert but there's something with the install of AppCompat.
CrEaTiiOn_187 said:
I'm no expert but there's something with the install of AppCompat.
Click to expand...
Click to collapse
What's AppCompat please? is there a way to fix this?
The_Warchitect said:
What's AppCompat please? is there a way to fix this?
Click to expand...
Click to collapse
As i said i'm no expert but it seems that that is your problem. It tries to install it but it can't 'cause there's already a factory one. Don't know what it is though.
dave7802 said:
http://forum.xda-developers.com/showthread.php?t=1726238
Or google how to extract Logcat android
(The System Log file)
There is alot of Apps on the Play-store that will also extract this for you.
Just search google play "Logcat"
Ideally you want to capture the log straight after a boot when the crash / reboot occurred.
Click to expand...
Click to collapse
I just upload to logs
Can you help please
Many thanks in advance
Here is another one

Categories

Resources