Eclipse hanging when launching android application - android

I've been having this problem in eclipse whereby my project builds fine, but when I run the application, eclipse hangs and either freezes or throws up a launch error like below
[2012-11-02 14:17:31 - Unexpected error while launching logcat. Try reselecting the device.] device not found
com.android.ddmlib.AdbCommandRejectedException: device not found
at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:752)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373)
at com.android.ddmlib.Device.executeShellCommand(Device.java:462)
at com.android.ddmuilib.logcat.LogCatReceiver$1.run(LogCatReceiver.java:110)
at java.lang.Thread.run(Unknown Source)
I've also got this error file Picture of error file
I'm not sure how to pinpoint the source of this problem. I'm using android sdk 4.1.2(APK 16) and android ADT 21 (Preview) on eclipse indigo on a windows 64bit machine. I've also installed the latest available drivers for my device, nexus 7
The same issue occurs whether I try to run on a device or on an emulator so I'm a bit lost as to where to start the troubleshooting...

You might try to set higher memory limitations in your Eclipse.ini. The actual launch of your application requires more memory due to building the APK, where before that point of time only the Java compiler was involved.
Additionally you may try to work around your problem by starting the AVD manually from the Android AVD manager dialog (which can be reached via one of the toolbar buttons). Then launch your app only after the emulator has been fully started.

Related

Android Studio emulator appears in the task manager for 10 seconds and disappears. The emulator window is never displayed

It was working fine till I updated the Android SDK tools from the SDK Manager to version 24.1.2. However a virtual device was running at the time of the update and it asked me to close 3 processes in order for the update to continue. I thought the virtual device was interfering so I closed it and tried to proceed with the update,it gave me the same error. Therefore I cancelled the update and closed the studio. After restarting the studio,it gave an error saying the SDK could not be found and would not let me do anything else. I uninstalled the studio after deleting the SDK folder and reinstalled it. I downloaded the system images needed for the virtual devices and some other packages and created a new virtual device. When I tried to run the application,it gave me the dialogue box to chose the virtual device,I chose the newly created one and it gave the command to start the device. Yet no emulator window for the device appeared.
D:\sdk\tools\emulator.exe -netdelay none -netspeed full -avd MTK
emulator: device fd:5500
HAX is working and emulator runs in fast virt mode
HAXM is installed and it worked fine before. On checking the task manager upon launching the application,an emulator-x86.exe process appears briefly before disappearing. Nothing happens after that. Launching the program again gives the same result. If I try to launch the device from the AVD manager,I get the same result. I have tried using the arm images,varying the ram size,snapshot enabled/disabled,use HOST GPU enabled/disabled,system restarted,removal of /.android content,setting up the SDK in a different drive and deleting the ANDROID_SDK_HOME system variable and resetting it.
I have also tried with Genymotion. The virtual device window briefly appears and I can the see the android logo at startup but then it says "player.exe has encountered a problem and needs to close. We are sorry for the inconvenience." I have tried it using both the Genymotion Android SDK tools and the custom Android SDK tools to no avail. If I try to delete the device it says please stop the virtual device before deleting it even though it is not running.
I spent most of my day trying to solve exactly the same problem until one of my colleagues remembered he had exactly the same issue and that was related to Docker.
Docker uses Hypervisor Framework which is incompatible with the HAXM used by the Android emulator. Therefore if you try to run the Android emulator while Docker is running it will just quit without a warning. Quitting Docker will allow to use the simulator - Docker for Mac conflict with Android emulator
Sometimes it is because you are low on memory, or it might be an AVD specific glitch. I had many (20) devices saved in my AVD and was lower than normal on memory on my laptop. The native emulator folder would disappear right away but genymotion worked fine.
I removed the old devices and create a new one from scratch in AVD and the problem disappeared.

Unable to run Android Emulator

I have a Xamarin.Forms project in Visual Studio 2013 and when I try to run my Android application the emulator loads but then it doesn't load the app and different errors will occur.
When I try to run the Android Emulator depending on what settings I chosen it either pops up with
DWP handshake failed
or in the debug output it shows
Couldn't connect to logcat, GetProcessId returned: 0
All existing solutions I have found haven't worked so far, even though they have worked in the past.
I just wanted to list here all the things I have done to resolve this issue since it has happened to me a few times, with different reasons each time.
Release then Debug
Sometimes you need to run it in Release mode first to the emulator, then you can switch back to Debug mode and it works.
Fast Deployment
Go to the properties in your Android Project
Go to Android Options
Turn off Fast Deployment
If that doesn't work, you can also try
Turning off Shared Runtime
Settings the Linker to Don't Link
Check your logs
Open up the Android Device Logging, connect to your emulator and see what messages are coming back.
For me I saw an Out of Memory Exception. The emulator only had 323 MB of memory set for it. Open the emulator manager (the icon next to the device logging) and then edit your emulator. Increase the memory to 512 MB (that did it for me), and it all started working again.
If this doesn't resolve your error, more scenarios are updated at Debugging Xamarin Android Build and Deployment Errors.
deselect 'Use Shared Runtime' in Project Properties > Android Options > Packaging properties
This has been resolved but it didn't work for me.
If you are looking for an alternative solution:
I had to change the platform CPU from Any CPU to x86 for it to work on my pshycial device (Galaxy S6 edge +)
Use an android x86-based emulator not an ARM-based emulator. You can inherit from any of the default ones that ship with the Android SDK using the AVD Manager (preferably from inside Xamarin) and create your own targeting some Android API Level. Also ensure you have the latest Intel HAXM build installed and running; this is important for accelerating the performance of x86-based emulators.
Restarting VS works for me.
I'm using VS2015 community, Win10 Home 64, Android Player 64.
Right click on your App(Solution name)
Go to Properties => Open android option => at last you see Debugger
in dropdown you select microsoft its work for me after all of solution check

Android emulator crashing on Mac

When I try to launch Android emulator, it crashes on Mac OS X. It was working some time ago, but now it isn't and I don't have an idea why.
Crash log: http://pastebin.com/04MjCqaS
Terminal log in verbose mode: http://pastebin.com/L6y6rUr0
Same issue here, I'm running a mac mini with 8GB of RAM and MacOS Lion. It used to work with the old AVD with some random crashes every now and then but since the last update to APi 17 it's a pain in the neck.
The ADT bundle doesn't work at all. After tweaking the memory limits on eclipse.ini file it throws random memory errors. Also it's not been able to download and install the m2e (maven to eclipse) plugin.
I moved to IntelliJ and I'm able to launch AVD manager but none of the "old" created devices work. If I create a new one and I launch it it works until I close it, then I have to restart the Mac and create a new device. Also it randomly shows errors when I want to delete those old created virtual devices.
Also the DDMS fails to start. I launch it, shows its icon on the Dock but it doesn't respond until I force close.
What a Nightmare.
** EDIT **
I found at android dev bug tracker this issue when you're running 2 screens: here
This is happening to me with the android emulator. I solved it like this:
cd ~/.android/avd
ls *.avd
Now choose the emulator that is crashing and
cd name_of_the_emulator.avd
touch emulator-user.ini
vi emulator-user.ini
And now reset window.x, that's window.x=0
exit and run the emulator.
If you move and close the emulator to the secondary screen it will crash the next time you want to run it.
Kill your Docker process
One problem I have seen multiple time is with Docker. Android Emulator crashes when Docker is running on Mac.
I was following the PhoneGap "Getting Started" guide for Android, and when I got to "Deploy to Emulator," after I created a new AVD, my Mac would crash and reboot. I stumbled on this thread, but thought it worth mentioning that what actually solved the problem for me was an Intel patch for the Hardware Accelerated Execution Manager located here: http://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager
This is because Android SDK use some deprecated libraries of Mac OS X. I have the same problem (sometimes even kernel panic) before I start use android device. Maybe in future versions of Android SDK this problem will be fixed.
I just updated the Android SDK manager to the latest Android 4.2 (API 17) level updates, and now all my old AVD's crash. The newly created one using API 17 works, however.
I have the same issue. You can try to create a new AVD with the appropriate API level. I am able to run these the first time(s) after creating. That seems to be a memory error.
My AVDs are able to run the first time after reboot. After this they keeps crashing.
I had the same issue using mac 10.6 and 2 monitors one through a usb adapter to HDMI.
I have tried all of this suggestions and nothing did work.
I ended up creating a new user into my mac and with the same android sdk and same eclipse with a new workspace did work.
I'm not sure whether just creating a new workspace would do the tweak, I didn't try it.
for those who come across to this annoy issue worth to try it before switch to a new account.
You can delete your emulators from ~/.android/avd
Then create new emulators.

Android Emulator won't launch, no console output or errors

I am trying to run the Android emulator on a 64 bit Windows 7 machine. I have installed the Android SDK, JDK, Eclipse, and the Android plugins for Eclipse. From the SDK Manager, I have installed the Android SDK Tools, as well as all of the files for Android 4.1 (API 16).
From Eclipse, when I want to open the emulator I select the AVD Manager and click on a device that I have created. The AVD Manager says that the virtual device is a valid device. When I launch the machine, a box pops up that says "Starting Android Emulator," and there is a loading bar right below it. The bar will get to about 95%, and then the box will disappear and nothing will happen. There will be no errors and no messages in the console output box in Eclipse. I get similar behavior when I try to launch the emulator by running an app from Eclipse.
I have tried uninstalling and reinstalling the SDK to a new directory, as well as downloading a different version of Eclipse (I am currently using Eclipse Java EE, earlier I was using Eclipse Classic 4.2). I also tried downloading the API 15 platform and using that as a virtual device, and I still have the same issues.
I have checked my task manager, and the only new process that is ever created is adb.exe, and this only happens when I try to run my app, but not when I start the emulator on its own.
Any idea what might be causing this, or what methods I might use to troubleshoot this that will actually give me some kind of error message, rather than just disappearing and not doing anything? Thanks.
Edit: When I try to run the emulator from the AVD Manager directly, I get the same behavior as when running through Eclipse (loading box pops up, then disappears, then nothing).
Try to use BlueStacks emulator instead standart. It work much more faster and reliably. You can download it from http://bluestacks.com. After installing reboot the system. I think all be fine.
I had the same problem. Enabling Host GPU emulation worked for me.

Android 3.0 emulator launching issue

I am trying to test a simple status bar notification program on Android 3.0 emulator.
When I try to run my application from eclipse, sometimes either I see a message that apk can't be installed when I check the DDMS log, I see java outOfMemory error. Though my application is fairly simple just one java file.
Sometimes when I launches my emulator it shut down my windows completely. I tested this on Windows XP and Ubuntu as well. In Ubuntu too when emulator was about to launch completely and showing home page my OS crashes.
Any other version of Android works well on my PC like 2.2, 2.3. I see this issue only with 3.0 (honecomb) version. Any resolution to this?
Thanks
Manish
Well when making an AVD from the AVD Manager , assign it maybe 200 -500 mb and this issue will be resolved.
I have noticed the resource usage while running 3.0 is much more than 2.3 and below. The error you are getting refers to the emulator/eclipse needing more memory not your application. How much memory and CPU do you have?

Categories

Resources