I have the latest SDK/Eclipse installed.
When I create an application and I run it under the emulator it runs fine.
When I re-run the application from the Eclipse IDE I get a warning message
that the process is already running and it will be brought to the front or something.
The solution I have is to close the emulator and then rerun the build.
Problem is that it takes a long time for the EMU to boot.
On my friends PC his system re runs the process without the error.
(It actually terminates the current process in the emulator and re runs it)
Does anyone know how I can solve this?
Thanks
[2011-07-07 22:05:28 - delme] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=x.y.z/.DelmeActivity }
[2011-07-07 22:05:28 - delme] ActivityManager: Warning: Activity not started, its current task has been brought to the front
It happens sometimes, when Eclipse for some esoteric reason does not install the app but just tries to launch it. I don't know how to solve it as it happens randomly, but you could try to uninstall the app instead of relaunching the emulator.
Here is a quicker way to work around this problem:
Go to the home screen
Press the menu button
Choose Manage apps
Choose the All tab
Scroll down the list to find your app and tap it
Tap the Force stop button
Now try to run the app from Eclipse again and it should install and launch properly.
Related
I am trying to end my app gracefully on an Android emulator without causing a crash or killing the app.
Having read numerous posts on how to terminate or crash an app on Android, here's what I've tried:
Switched the emulator to another app
Clicked the Hang up on call button and Make a call button on the emulator
Added finish(); System.exit(0); to my onPause event in the app
Clicked on the root of my program in the Debug perspective in Eclipse and clicked the red square on the menu icon row to terminate, did same and disconnected as well.
Each time I start up the app after any of the above, the tracking code is considering the above chosen method a crash.
So I'm trying to figure out how to gracefully end my app and restart it without incurring a 'crash'.
Any ideas?
Big thanks
I have launched an app on Google Market, but when people open it directly from the Market App after installing, everything crashes. The market app force-closes and you are dropped back to the main screen.
But when my app is started from the main screen, everything works fine.
I cannot find a solution to this, neither find anything i have been doing wrong.
Is there anyone that has seen this before?
Update: ANR keyDispatchingTimedOut
https://stackoverflow.com/a/5513623/413127 your getting an ANR the logs from Google Play aren't going to help you.
What do you do in the launcher activity of your app. Do you create a database / download some stuff from the internet?
It sounds like it doesn't crash on your local device because this has already been done and so your activity doesn't do whatever long winded code is running on your UI thread.
To attempt to recreate the problem, go into the menu on your emulator and uninstall your application manually (pressing clear data) would also work, alternatively you can use adb:
./adb uninstall com.your.package
Now install the APK that you submitted to the Google Play using ADB something like:
./adb install /folder/to/YourLiveApp.apk
open the app and 9 times out of 10 you should get your ANR error.
My app is no longer starting up automatically when I F11 it in Eclipse; the Emulator starts up, but I then have to go and find my app among the applications list/array to invoke it.
Then, when I get to the place in my app where I've set a breakpoint, instead of hitting the breakpoint (Eclipse is not even going into Debug Perspective), my app suddenly "expires" and the Emulator pops up the dialog:
~~~~~~~~~~~~~~~~~~~~~~~~~
Sorry!
The application FifeOrTheDinosaur (process.com.aXX3AndSpace.FifeOrTheDinosaur_Package) has stopped unexpectedly. Please try again.
Force close
~~~~~~~~~~~~~~~~~~~~~~~~~
But then when I click "Force Close," that dialog goes away, and my app starts up again, from its opening Activity...?!?
It's almost as if my app is not the one being debugged by Eclipse -- Eclipse has lost its connection to it or...???
And every time it crashed, I hit the "Force Close" button, whereupon my app starts up all over again. What could have disconnected my app from the Debugging system, so that it:
1) Doesn't run automatically when I run it; rather, I have to "force" it to start up, and when it enters a breakpoint, Eclipse's Debug Perspective is not invoked
2) Continually starts up my app after it has failed...???
I put a breakpoint on a button click handler prior to that one that is working fine, and it does not drop me into the Eclipse debugger, either...???
Update:
The console says:
1) ] Failed to install .apk on device 'emulator-5554': timeout
2) Launch canceled!
Updated 3/30/2012:
If I run the app from Eclipse and immediately shut it down just as the Emulator is starting to initialize, it flashes up three "command window"-type screens, one right after the other, too fast to read what text they contain. Normally the Emulator window simply goes away, so I don't know if this is a clue for anybody as to what might be happening...
That sounds like the normal behavior of android Apps. If one activity crashes you can still go back to the activity the App started with. And if the breakpoints aren't hit then the error might occure before the code line you want to stop at.
Maybe you could set a breakpoint before you change the activity and then debug from there on.
You could also provide your Log output. Errors like that can always happen if you forgot to declare permissions or activities in your Android Manifest.
I have developed and android application which is called after phone boot is completed. Now, for testing it I am using my android phone and every time I have to switch on and off my phone to test it.
Is there any command on for android emulator which switch offs and switch on it. I want to test it on android emulator. Let me know how can I do it.
I wrote such a boot service. Just close the emulator window, and reopen it to test the boot service.
But it's tricky: When you start the emulator window again, be carefull not to use the run button. If you use the run button, the application will be installed again, and the boot service is not active right after installation.
So you need to install the application, close the emulator, and then to open the emulator using the green button in the toolbar. If you can't find this button, just start any other Android project.
Your boot service will now be executed.
Everytime I start the emulator from eclipse, I get the following error in my console.
[2010-09-13 17:04:51 - DeviceMonitor]Sending jdwp tracking request failed!
[2010-09-13 17:18:49 - DeviceMonitor]Sending jdwp tracking request failed!
The application works fine, but I am concerned as to why I see this error. Please help
I believe this is coming from the Usage Stats option. I just installed ADT, did a test run and got this error, as well. I went to Window >> Preferences >> Android >> Usage Stats then checked it on. Tried another test and voila! No error!
Kind of annoying, I can imagine...
This is caused after the emulator is closed while eclipse is still running.
When you first run the emulator after starting eclipse, a connection is established between it and eclipse. This connection is used to send messages back and forth between the two programs, and so eclipse can track the progress of the emulator.
When the emulator is closed, the connection is lost, and any attempt by eclipse to send a message results in the error messages you describe.
As Koby said this message comes if you close the emulator after running an application. First of all between successive application running on emulator you don't need to close the emulator. First before running the application you start the emulator by clicking window-->Android SDK and AVD Manager and click on the emulator you want to launch and click on 'start' button and then click on 'Launch' to launch the emulator. After the emulator launches unlock the emulator and keep that emulator minimized. And if you want to run an application go for 'run as android app' and you can see that on the emulator when maximized. After running that application if you want to make some changes in the application you don't need to close the emulator. you press the home button after running the application and keep the emulator minimized. Make the changes on the code and again go for running the application. Thus you can avoid that error message and save time for launching the emulator. if you got that error message then also the application will work properly but you cannot see the messages like uploading app-->installing .apk-->and the success messages. But these will be happening on the background. One way to overcome this is to restart the eclipse.