Eclipse ADT virtual machine won't start - android

Please note this is not a duplicate. I have found no thread that solves my issue.
I opened up fresh install of eclipse adt with hello world example and opened Android Virtual Device Manager. Here, I added several devices with different configuration and hit start on each of them but all I got is starting virtual device then .. nothing happens. No log, no alert, nothing.
Things, I have tried:
Wait 10 mins after run, nothing happend.
Changed priority on adb.exe to real time
Killed adb.exe (here, console started showing up Connection attempts: 1..2..3 ... nothing more)
Changed perspective to DDMS. Here, no devices are found. Hitted "reset adb" (here, console shows An existing connection was forcibly closed by the remote host)
In Window->Preferences->Android checked SDK location (no spaces)
Run emulator.exe -avd test2 from command line (emulator-arm.exe stop working)
Installed different API. I had API 17 and I installed API 16 (all sub-things)
Run configuration Lauch as ... (not Launch Def. Activity)
Deleting avd's content in userdata fold and creating new
Run as admin
Check stackoverflow for all possible solutions
Minor restarting, creating new AVD, different settings, ram size and stuff..
notes:
- I have new PC, there are no performance issues possible
- I am using Adt bundle windows x86_64 - 2013 02 19 build 21.1.0-569685
- UAC and all those stuff disabled
- Windows 7 64-bit
- Again, Never made it to lock screen, no log available

Related

Unable to attach debugger to Android process in Android Studio 2.3.3

I have searched the internet and tried everything I have come across, but I cannot figure out what I am doing wrong. I cannot attach the debugger to my Android process in Android Studio.
I have built an app in Android Studio 2.3.3 on a virtual machine using VirtualBox and running Ubuntu 16.04.2. I have installed the app on my device, a Getac Data Logger, and have noticed that my app opens for a couple of seconds, displaying a blank white screen, and then crashes. So, I have attempted to debug the app on my device to find the problem. When I click on the "Attach debugger to Android process" icon, I can see my device as an option, however, when I select my device the OK button is grayed out. There is no way for me to move forward with this process. Sometimes the warning "debug info can be unavailable, please close other application using ADB: Monitor, DDMS, Eclipse" pops up, but not every time.
Does anyone have any ideas as to what I am missing? Does it have something to do with the limitations of working on a virtual machine?
Things I have tried:
Making sure I have allowed USB debugging on my device
Selecting all kinds of combinations of show all processes/auto/java/etc
Commands: adb kill-server, then adb start-server; adb kill-server, then adb -P 5038 start-server
Waiting to plug in my device until I launch the debugger attachment
Building debug variant
Adding android: debuggable="true" to my application in my AndroidManifest.xml, then noticing it was not necessary after building the debug variant and taking it back out
Disabling and re-enabling the ADB integration through Tools/Android/Enable ADB integration
Closing Android Studio and then opening it again
Changing the adb port
Invalidating cache/restart
Uninstalling the app, clean build, reinstalling the app
Installing the MTP using the command: apt-get install mtpfs. It says that mtpfs is already the newest version, but the Ubuntu error "Unable to open MTP device '[usb:001,021]'" does persist, just not always.
Revoking USB debugging authorizations, exiting out of Android Studio and my VirtualBox, rebooting everything, and setting it all up again.
PLEASE NOTE:
I am brand new to development (a little over a year experience in web development), brand new to app development (this is the very first app I am creating), brand new to Android Studio (again, very first app).
My device is showing up in the debugger as an option. It is just that the OK button is grayed out, no way to move forward.
I do NOT have Eclipse or Monitor (and therefore not DDMS either) running.
EDIT: I have noticed that "#com.android.ddmlib - Adb rejected connection to client '[numbers]': closed" is showing up in my terminal several times with several different number combinations. Not sure what this means. Perhaps I am running DDMS? I thought that was something that runs through Monitor?
Unplug your phone from your PC. Then plug it back in. On the pop-up, make sure you set it to “Media Sync (MTP)”.
I had intellij Idea IDE and Android Studio 4 Canary were open with Android projects at the same time, after closing both the IDEs and opening only android studio, I was able to attach the debugger to the app process.

Maven Sample Android App deploy fails constantly after one successful run

I downloaded the examples from simpligility.github.io/android-maven-plugin and did a mvn clean package android:deploy on the helloflashlight example.
After setting adbConnectionTimeout to 15000 everything went fine for one run. I deployed the app sucessfully - the app started on my device and I was able to push the color buttons.
After that I ran mvn android:undeploy to clean the device. Now I am not able to deploy this test app again. Maven says FAILURE "E/Device: Error during Sync: Eine vorhandene Verbindung wurde vom Remotehost geschlossen" Which means an open connection was closed by remote host(?).
I googled and found out that the problem may be 2 processes of adb.exe starting during deploy. So I entered adb kill-server and shut the adb down.
Still on each deploy 2 adb.exe are starting, one is shutting down immediatly, the other stays open. Searching for adb.exe at my computer only finds one adb.exe.
Does anybody have some hints for me?
My system setup:
I installed Eclipse with current ADT (Android Deploment Tools).
I used the Android SDK Manager to download and install android sdk and tools into C:\users\me\android-sdk. I added a samsung device to the device list which is displayed when I enter adb devices
After that I configured Maven for android - setting ANDROID_HOME and added %ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools to my PATH.
I am working with Windows 7 64-bit.
It seemed to be a problem with the device. I switch to another device of same type... no problems any more.

OSX: Android Emulator Crashes

I've just reinstalled eclipse indigo (32bit) and the latest Android SDK. The Android Emulator crashes immediately after it is launched.
Here are my steps:
Create a new Adroid project. Target is Android 4.0, SDK 14.
Press the Run button in Eclipse.
See the Emulator launch and crash about 2 seconds later
Output of crash window:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
The Eclipse console complains about the following:
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.
goldfish_fb_load: framebuffer dimensions mismatch
savevm: unable to load section goldfish_fb
emulator-5554 disconnected!
Cancelling 'com.sparky1.HelloAnrdroidActivity activity launch'!
Any thoughts about how to get emulator to behave?
This has already been reported as a Bug: http://code.google.com/p/android/issues/detail?id=724
There are some workarounds presented in this post, too. But at this point, there seams to be no actual fix.
It looks like this happens when an external monitor is connected. Try disconnecting your external monitor and then start emulator. You can attach it back after the emulator starts.
I've seen this problem too. I've found that running emulator from command line and disabling snapshots help a lot.
I'm running:
$ emulator -no-snapshot-load #avd
If disable snapshot when create device, ok. Do not enable snapshot.
If enable snapshot, it's ok to check "save to snapshot" when launch device.
But check "launch from snapshot" is not ok. If already save snapshot, it will cause emulator-arm crash.
After emulator-arm crash by "launch from snapshot", disable snapshot with AVD manager does not work. But run config > target > additional command line option(-no-snapshot-load) works.
I had all these crashes as well and found this in my crash logs:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.CoreFoundation 0x97585bc1 CFStringGetLength + 17
1 com.apple.CoreFoundation 0x9759df63 CFStringCompareWithOptionsAndLocale + 35
2 com.apple.CoreFoundation 0x9759df2c CFStringCompare + 60
3 com.b-l-a-c-k-o-p.CamCamX5 0x03ff3b44 CoreBundleyes::IsMainMember() const + 48
4 com.b-l-a-c-k-o-p.CamCamX5 0x03ff11cc QVDigBaseClass::ClassFactory(ComponentInstanceRecord*) + 50
5 com.b-l-a-c-k-o-p.CamCamX5 0x03ff317b QVDIG_DATA_Open + 23
After spending only a couple of hours :-( on the net I found a tip to remove
/Library/Quicktime/CamCamX5.component
After that no more crashes :-)
An alternative is to switch to using AndroVM in Virtual Box which is an X86 Android image. The big advantage is that it is lightning fast compared to the ARM one. It boots in 2-3 secs. The downside is that you have to manually do the ADB connection and the capturing of the mouse by virtual box is a pain. Not all applications will run on the x86 as well.
To use it you have to configure the first Ethernet adapter as Host Only, run the androVM configuration utility to get the emulator's IP address, then use adb connect ip-address
Another tip is that if the screen times out you need to hit F1 to wake it up.

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

Android Emulator won't run application started from eclipse

I have followed the "Hello World" example from Google's Android developer's guide. When I try to run the application in the SDK emulator, nothing happens. The emulator startd up nicely, but after that nothing happens. I can't even see the application in the app tray.
I am using Eclipse with the Android add-on installed.
Had the same problem, the console log stalled after:
Launching a new emulator with Virtual Device
and the emulator never showed the HelloAndroid application. I finally figured it out!
In Eclipse go to
Run --> Run Configurations
Then change the Launch Action for your application (e.g. HelloAndroid) from "Launch Default Activity" to "Launch:" and then select your application from the pull-down menu. This did the trick for me.
HTH,
Sven
Same here; emulator loads fine but apk doesn't get installed. Problem is only with the emulator. All works fine if physically connecting a device with USB debugging turned on.
NB This suddenly started happening for no apparent reason. All used to work fine.
I've tried uninstalling and reinstalling the ADT Plugin and I've updated the Android SDK and AVD Manager to the latest available. (Tools revision 7) but the problem continues.
Eclipse: Helios Service Release 1
Build id: 20100917-0705
Running on Windows XP SP2
Just as others have posted, the console log shows
[2010-10-14 11:39:33 - uad-MediaPlayerExample] ------------------------------
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Android Launch!
[2010-10-14 11:39:33 - uad-MediaPlayerExample] adb is running normally.
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Performing com.msi.manning.chapter10.MediaPlayerExample.MediaPlayerActvity activity launch
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Automatic Target Mode: launching new emulator with compatible AVD '1.6-hvga'
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Launching a new emulator with Virtual Device '1.6-hvga'
LogCat remains empty/blank.
And if I then try to re-run the same app, the console shows:
[2010-10-14 11:39:33 - Emulator] emulator: ERROR: the user data image is used by another emulator. aborting
POSSIBLE ANSWER???
One solution seems to be to kill the adb.exe process in Windows Task Manager (while the emulator is still running).
(from http://vikashazrati.wordpress.com/2008/01/01/quicktip-android-does-not-load-my-application-in-the-emulator/)
The console suddenly shows lots of errors:
[2010-10-14 12:12:00 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:01 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:01 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:02 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:02 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:03 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:03 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:04 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:04 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:05 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:05 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:06 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:06 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
but the app starts in the emulator. !!!
(as expected the LogCat also suddenly starts to display lots of messages)
All works fine - i.e. you can work on your code and re-run the app in the same emulator and it reinstalls as expected...
BUT if you close the emulator, you see the following console error:
[2010-10-14 12:15:05 - DeviceMonitor]Sending jdwp tracking request failed!
And the same problem reoccurs - a new emulator appears but the apk isn't installed. So you need to go back to Windows Task Manager and once again kill the adb.exe process.
NB I find that adb.exe doesn't reappear in the Task Manager unless I restart Eclipse, so after closing an emulator you have to restart Eclipse, try Run (which fails to display the app) then go back to the Task Manager where adb.exe is once again listed and kill the process for the app to start.
Would be great if someone could provide an explanation for this and a permanent fix...
I have the similar problem. I suggest the following workaround:
close eclipse, in the Task Manager, kill all adb and emulator* processes.
start eclipse, run your application, wait untill the emulator starts. If you have the problem, your application won't be started, there will be the bare emulator.
In eclipse, select Window->Open Perspective->Other->DDMS. Switch to DDMS perspective. If you have the problem, the list of the devices will be empty.
In the Devices tab, in the drop-down box, select "reset adb". In a short while, the emulator must appear in the devices list.
Following that, switch back to your Java perspective and run your app. Everything must work fine for the rest of the session.
Actually, if you are using Windows, the problem might be that the User Account Control in your Windows is preventing Eclipse to load the apk in the emulator (Eclipse doesn't have right to do so).
To turn off the User Account Control, go to the Control Panel, click User Accounts and Family Safety, and then click User Accounts. Once there, click the option 'Turn User Account Control on or off'.
Depending on your computer it can takes several minutes to load the emulator and the app. Open Logcat view to see the progress of loading.
Same problem. Killing adb from task manager didn't help. Also tried restarting the AVD using android create avd --target 2 --name my_avd --force, no good. Tried the different launch method in Eclipse, nada.
What eventually helped is: I started (from the start menu, not command line) the Android SDK Tools > SDK Manager, found the my_avd under virtual devices, and simply clicked the Start... button. That did it - the emulator started, I ran from Eclipse, and it immediately showed the app on the emulator.
One solution is go to android sdk/tools directory and start ddms.bat for Dalvik Debug Monitor, then select Actions->Reset adb. That seem to fix the problem
In my case the problem occurs because of the simple thing: i do not select the project that i want to run. Click on it in solution folder, then press run and enjoy. Hope it will help someone.
The Android emulator takes approximately 1 to 2 mins to load. Check the console tab in the eclipse IDE for evaluating the progress of loading the emulator and installing the application in the emulator.
I used to face this problem a lot. There is workaround for this,
End the "adb.exe" process from the Task Manager and try again.
It should work.
and instead of running from eclipse i use following batch files in my project directory to install and uninstall the apk. Those work great.
Install.bat
cd bin
adb install *.apk
Uninstall.bat
adb uninstall this.is.package.name
STEPS TO FOLLOW:
Go to Command Prompt
type adb kill-server
enter
Now it should work fine
For me the solution was to choose "app" instead of "RSSReader" (my project name) in the dropdown next to the AVD tray. When I choose "RSSReader", the AVD is greyed out and unusable.
This leads me to wonder if my project is setup wrong or if "app" is the correct state.

Categories

Resources