My android emulator doesnt launch - android

I installed the Android Development Tool and created my first app but when I run the app, the emulator doesnt launch.The console reads:
[2013-06-18 14:36:57 - MyFirstApp] Android Launch!
[2013-06-18 14:36:57 - MyFirstApp] adb is running normally.
[2013-06-18 14:36:57 - MyFirstApp] Performing com.example.myfirstapp.MainActivity activity launch
[2013-06-18 14:37:19 - MyFirstApp] Launching a new emulator with Virtual Device 'AVD'
Unfortunately, it never launches. The following is what I have tried to do to solve the problem:
I created AVD both by graphical user interface and command line but it didnt run.
I tried to open task manager and stop the adb.exe process then run it again but no.
I tried to kill the adb server and restart it by command line but again no, didnt run.
I finally tried to launch the emulator on command line and this is what it says (directly translated): "a problem interrupted the program, trouble-free operation. Windows will close the program and notify you if a solution to the problem is available."
Please help.

After a long struggle, I decided to install a new Operating System. The emulator can now launch.

Related

The connection to adb is down

I am trying to run an android application I build in the android emulator using eclipse , but every time I try I get the following error:
[2013-11-30 14:14:12 - MyFirstApp] The connection to adb is down, and a severe error has occured.
[2013-11-30 14:14:12 - MyFirstApp] You must restart adb and Eclipse.
[2013-11-30 14:14:12 - MyFirstApp] Please ensure that adb is correctly located at 'C:\<sdk directory>' and can be executed.
I tried adb kill-server and adb start-server, searched Stack Overflow , found this
and this, tried everything , but still can't get to start the application.
The AVD starts but the app doesn't start on AVD.
Then after some waiting,
[2013-11-30 14:26:54 - MyFirstApp] Failed to install MyFirstApp.apk on device 'emulator-5554!
Your error it self saying :You must restart adb and Eclipse.
Try this once:
Step1. Go to DDMS perspective
Step2. Click on emulator opened at Devices tab
Step3. Click view Menu on reset adb as shown bellow image
Step4. Restart Eclipse.
May it helps you.
Just restart your Eclipse and device or emulator which you are using for testing apps and go to task manager find adb.exe -> End Task.
You will not find any error after that.

After change some code, should i restart the Android Emulator?

I have opened the Android Emulator for my first set of code change. Then later i change some of my code. Should i want to close the emulator and relaunch (re-run) the code to reflect my new changes? or else simply pressing run key in eclipse will reflect the changes?
Please clarify.
PS : Till now, i wont close and relaunch the emulator for every code change. But today i faced the error in console like "Application already running, uninstall the application and try". That's why i have doubt on this.
You do not need to relaunch the emulator, pressing the Run button in Eclipse will work.
When you receive a message similar to this one:
Re-installation failed due to different application signatures.
You must perform a full uninstall of the application. WARNING: ...This will remove the application data!
Please execute 'adb uninstall com.antew.code' in a shell.
Open a command prompt and use:
adb uninstall <package name>
e.g.
adb uninstall com.antew.code
Then relaunch the application from Eclipse to install it again. The adb exe is in the /platform-tools/ folder of the SDK.
no need to close the emulator at all .............
the message is due to as some time application is in front (running) emulator denys to re-run . For this just simply close the app by back button and run from eclipse
There is no need to restart the emulator for a code change -- simply "Run"ning it from Eclipse does the trick. I think the reason you're getting that error is that you're trying to run it with no code changes.
Don't restart your emulator for every changes made. Just deploy your application on the emulator.
If you won't face the Application already running, uninstall the application and trybe sure that your application is not started in the emulator.
If it is,just switch to another ativity and then try deploy your application.
There is no need to restart the emulator!!!
You simply need to run youe application again from eclipse(Ctrl + F11). If you have done any changes in code(and saved them all) then on running the application you will get output something like below
[2013-06-19 13:19:12 - MyFirstApp] ------------------------------
[2013-06-19 13:19:12 - MyFirstApp] Android Launch!
[2013-06-19 13:19:12 - MyFirstApp] adb is running normally.
[2013-06-19 13:19:12 - MyFirstApp] Performing com.example.myfirstapp.MainActivity activity launch
[2013-06-19 13:19:12 - MyFirstApp] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'Micromax_A_68'
[2013-06-19 13:19:12 - MyFirstApp] Uploading MyFirstApp.apk onto device 'emulator-5554'
[2013-06-19 13:19:14 - MyFirstApp] Installing MyFirstApp.apk...
[2013-06-19 13:19:26 - MyFirstApp] Success!
[2013-06-19 13:19:26 - MyFirstApp] Starting activity com.example.myfirstapp.MainActivity on device emulator-5554
[2013-06-19 13:19:28 - MyFirstApp] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.myfirstapp/.MainActivity
Above logs are specific to my app but you get the point... If you have no changes saved then you will get some additional output lines as follows
...
[2013-06-19 13:22:10 - MyFirstApp] Application already deployed. No need to reinstall.
...

Unable to Launch the Android Emulator

I created a Hello-Android Application and made all the required configurations as told in the developer.android.com site. When i ran the application the emulator was not launched.
In the console the following message was displayed.
"[2011-07-08 10:44:04 - HelloAndroid] Android Launch!
[2011-07-08 10:44:04 - HelloAndroid] adb is running normally.
[2011-07-08 10:44:04 - HelloAndroid] Performing com.HelloAndroid.HelloAndroidActivity activity launch
[2011-07-08 10:44:04 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'AVD'
[2011-07-08 10:44:04 - HelloAndroid] Launching a new emulator with Virtual Device 'AVD'".
Then a pop up message came which showed the following.
"An Unhandled win32 exception occured in emulator-arm.exe[3656].
Just-In_time debugging this exception failed with the following error:
No installed debugger has Just-In-Time debugging Enabled.
In Visual Studio,Just-In_time debugging can be enabled from
Tools/Options/Debugging/Just-In_time.
Check the documentation index for 'Just-in-time debugging, errors'
for more information."
Please help me out so that I can launch the emulator.
Start the Android SDK Manager
In the SDK Manager, go to the "Virtual devices" page and click "New" to create a new device.
Make sure you create a "Target" API that is within the range of the API's that your app supports.
Once the Android Virtual Device (AVD) is created click "Start" to start it.
Wait until the AVD is fully started, then goto Eclipse
In Eclipse create a "Run configuration" for your app (if you do not have it already). In the run configuration
make sure you select the device you've just created.
Run your "run configuration".
Here are few instrucitons before running the Android applicaiton.
Make sure when you are launching the emulator for the first time for running this specific app you have not checked following check boxes.
. Launching from snapshots
because first time you don't have any snapshot existed before as you are running this application for the first time.
2 Make sure that you have selected small resolution emulator because larger resolutions does not perform good.

Android-Hello World

I'm currently learning how to create android applications so I started with the basic "Hello World" tutorial over at the Android Developers home page. The code is quite simple but when I run it(I'm using Eclipse and a AVD v2.2), it only shows "Android." It does not go to the Home Screen. I updated everything and I still get the same problem. Is there something I did not or
New errors:
[2010-09-29 09:35:04 - DeviceMonitor]Sending jdwp tracking request failed!
[2010-09-29 09:41:50 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2010-09-29 10:16:23 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
[2010-09-29 10:16:28 - HelloAndroid] Installing HelloAndroid.apk...
[2010-09-29 10:20:27 - HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554!
[2010-09-29 10:20:27 - HelloAndroid] (null)
[2010-09-29 10:20:29 - HelloAndroid] Launch canceled!
I assume you are using the emulator. You have to be patient; it takes a very long time to start up (several minutes.) You can start the emulator manually by going to the Window menu in Eclipse, selecting "the Android SDK and ADB manager," clicking on the emulator you created and then clicking on the Start button. Wait until you see the home screen. If necessary, unlock it by clicking and dragging the mouse down over the screen until it's unlocked.
If you have access to a physical phone and USB cable, you will have a much better (faster) experience overall.
Good luck!
I had the same problem and was bugged by it for two days. but this is what worked for me. one you get this error. try running your project (APP) again. it did the trick for me.
I had done everything. digged the web, installed and re-installed everything 4-5 times including the JDK as well. m not sure if it will help in the long run, but it seems to have worked for me.
As for me, I had the same problem and it helped to increase SD volume and max VM app heap size. (Android SDK and AVD manager - Virtual device - Edit) What is interesting, the back change of SD and heap to the previous values is OK, too. That means, that any change of emulator parameters and its rebuilding is enough. (Simple restart won't help)
Definitely, it is cheaper, than total reinstalling. :-)
unlock the screen from the emulator. That did the trick for me.
go to the run configurations and select target tab. under this tab you can see your targets. then select automatically radio button and select a check box of AVD. then try to run, most probably your issue will be solved.
I had the same problem and this is how I resolved.
if you run
adb devices
I had nothing on the list. So did.
adb kill-server
and
adb start-server
Now if you run the emulator again, the Activity oncreate event will hook properly.
Not sure if this is intended but on the first run on the emulator does not work.
And someone confirm on this?
Thanks.
I had the same problem I was running Android 3.1 Java 1.6 on Eclipse. Just rerun the build process and it kicks in the second time.
I also encountered error when followed instructions, so i ran "adb logcat" which showed that it is not able to find the class.
In the instructions(tutorial) - : It has been said that (during create new project or class)application name set to Hello World and activity name became HelloWorldActivity.
So if you maintain both CreateActivity name and application name both same, then it might work.
I have increased the AVD RAM size to 1024 and VM application to 36 0r 48 or 24.
If anyone getting following error,
[2010-09-29 09:35:04 - DeviceMonitor]Sending jdwp tracking request failed!
[2010-09-29 09:41:50 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2010-09-29 10:16:23 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
[2010-09-29 10:16:28 - HelloAndroid] Installing HelloAndroid.apk...
[2010-09-29 10:20:27 - HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554!
[2010-09-29 10:20:27 - HelloAndroid] (null)
[2010-09-29 10:20:29 - HelloAndroid] Launch canceled!
Simply restart your application.
Wait for some time.Bcaz it take some time.
when you will get screen with "Data-time-charging-lock",
click on lock .There will be some animation.Again click on same lock.
AND Your Are DONE.You will get output..........
this kept happening to me ... how i solved it was to use " adb install " in a command prompt ...search for adb.exe if its not in your path. Make sure the emulator is running by going to run configuration and hitting run. This starts the emulator without installing your apk file. After the emulator starts up run the command prompt stuff listed above.
I restarted my virtual device with the option Wipe User Data checked and then reran my app. That finally worked for me.
Note that in response to the other comments, I also tried the following:
Simply restarting the device
Restarting the device after changing the VM heap size
Restarting my computer
You might want to try out using Android Studio's AVD. That AVD seems to work better for me.

Issue with 'Hello Android' tutorial

I am brand new to Eclipse and Android, but somewhat familiar with Java. That having been said, I tried to follow the 'Hello Android' tutorial from the developer site using the latest Eclipse (Galieo) and the 2.1 Android SDK, I am on a Macintosh running Snow Leopard (OS X 10.6). I have a default virtual device (though my target is actually for phones like my own HTC Incredible which has the snapdragon processor and of course all the latest accoutrement in smart phones).
Everything seemed to go okay until I went to RUN>RUN and then selected 'Android Application'. My computer spins its wheels for a while and then I see two errors. I have pasted the output from Eclipse below:
[2010-05-04 01:53:46 - HelloAndroid] ------------------------------
[2010-05-04 01:53:46 - HelloAndroid] Android Launch!
[2010-05-04 01:53:46 - HelloAndroid] adb is running normally.
[2010-05-04 01:53:46 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2010-05-04 01:53:46 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'myAVD'
[2010-05-04 01:53:46 - HelloAndroid] Launching a new emulator with Virtual Device 'myAVD'
[2010-05-04 01:53:58 - HelloAndroid] New emulator found: emulator-5554
[2010-05-04 01:53:58 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2010-05-04 01:53:59 - Emulator] 2010-05-04 01:53:59.501 emulator[10398:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2010-05-04 01:54:23 - HelloAndroid] emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!
I never do see the text in the emulator and the emulator crashes with a message about it quitting unexpectedly.
The crash report states:
Process: emulator [10472]
Path: /Applications/android-sdk-mac_86/tools/emulator
Identifier: emulator
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: eclipse [10468]
Date/Time: 2010-05-04 02:25:41.153 -0500
OS Version: Mac OS X 10.6.3 (10D573)
Report Version: 6
Interval Since Last Report: 2558914 sec
Crashes Since Last Report: 4
Per-App Crashes Since Last Report: 2
Anonymous UUID: C5F178C1-5290-4CA9-AD6E-E9C4F5582754
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000001fd2f000
Crashed Thread: 3
NOTE: Running the emulator from the command line with:
iainnitro-Mac:tools iainnitro$ ./emulator -avd myAVD
2010-05-04 02:49:23.011 emulator[10556:903] Warning once: This application, or a library it
uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw
and move to Quartz.
Segmentation fault
iainnitro-Mac:tools iainnitro$
yields a segmentation fault(as noted above from the terminal output). So the emulator is dying on its own before anything can be shown.
I have tried restarting the ADB processes.
The actual code is line by line from the tutorial and I have never been able to get to the XML part yet.
I am not sure what is wrong with my environment setup or if it is just an incompatibility with Snow Leopard? I would REALLY appreciate any help in resolving this as I am very interested in developing on this platform.
Thank-you,
Mike N Lawrence, Kansas
No direct experience, but this seems to be a recurrent issue:
This thread suggests:
You haven't let the emulator boot all the way up. Start it then wait until you see a desktop, just like on a real phone.
This one mentions (I suspect point 1. is not a concern for you):
Get more RAM. I was running on 256 MB (which I believe is below minimum requirements), just upgraded today to 1024 MB (long time coming), application now starts fine. Although I still do see some error messages in the emulator, they don't seem to actually do anything.
Install from command line. This is a bit laborius, but you can launch an emulator from the command line (assuming <android sdk path>\tools is added to your PATH variable) just type emulator, then browse to the location of your_app_here.apk, and execute
adb install your_app_here.apk
If you launch the emulator from Eclipse, execute adb kill-service and then adb start-service first (or kill-server / start-server. not sure the exact commands). Then your app will be installed on the emulator.
Also (a bit old but might still be relevant)
Maybe the emulator is running so slow, and the adb server, or another component like "DDMS" is a little "desperate" because seems it's waiting to the emulator to iniatialize the some HOME aplication.
But the emulator is running slow, the console in Eclipse send a message: emulator-5554
disconnected! Cancelling 'com.android.hello.HelloAndroid' launch!; and the emulator continues running normally and boot it's system, but don't run application that I build.
So for that problem I run program, and when the emulator is opened, I go back to eclipse in DDMS Perspective and in the Device tab y press a button "restart adb server" before the console shows me the message of "emulator-5554 disconnected!".
I do it several times until the emulator finally boot the OS.
After booted the OS on the emulator, eclipse don't send that disconnect error, and "sends" the app that I've built, also the console shows messages about this.
Then finally appears on the mobile "Hello, Android".
There has been a discussion on this with two proposed solutions
http://code.google.com/p/android/issues/detail?id=724
Comment 17 by zachrcrowe, Jan 06, 2010
FYI - I had to change a line in the Hello Android example to read
this.setContentView(tv); in order for it to work. As mentioned above, the deprecation
warning shouldn't affect the functionality of the emulator.
Comment 18 by mfrony, Jan 14, 2010
I had the same problem when I ran the Hello Android example. The way I solved it and
could run my first Android code was by changing the Project Build Target from 1.1 to 1.5.
This seems to be a timing issue. For some reason Eclipse attempts to load the application on to the emulator before it is "ready". I'm not sure why this occurs but I did find a work around: just start the emulator from the command line before you run the application.
Start clean by closing Eclipse (maybe the OP didn't exit Eclipse before he tried to run via the command line?)
Start the emulator via Terminal by navigating to the android-sdk-mac_86/tools directory and typing:
./emulator -avd my_avd
Open Eclipse and attempt to run the tutorial again using the same steps as before
A dialog box should open asking whether you would like to start a new AVD or use the one that is already running--choose to use the one that is already running.
what i did was to move the circle that appears when the AVD launches to the unlock position, and there it was 'Hello, Android'!
I had this same problem when I tried to run the emulator using a 4.0 AVD. It used to crash at the bootup screen and show 'Segmentation fault' in the console. I was able to fix it by increasing the SD card size of the AVD to 1GB from 32MB.
For whatever reason, I stopped getting the segmentation fault when I added:
this.setContentView(tv);
the 'this' seemingly solved the issue. The seg fault happens if you try to run the emulator without any .apk file I assume. (I was getting that from the command line as well). I hope the tutorial will be updated.
See Related post
Another related post
This worked on Linux for me:
Run Emulator (Wait for the home screen of the Emulator to load)
Click Window > Open Perspective > DDMS
In Devices Panel, click on drop down menu > Reset adb
Run project

Categories

Resources