I have a script that installs an apk file, launches it, and deinstalls it afterwards (using adb) on the android emulator. I repeat this for several apk files.
But when I launch the android emulator, several minutes to several hours later, the emulator is not responding anymore. The spinning pinwheel appears, the only way to quit is to kill it via the terminal (using kill -9).
I have tried to change the two possible CPU/ABI Settings of an AVD to (ARM and Intelx86), but both settings result in the same problems. I have also tried different API levels (19 and 21), but also no luck there.
As I am running the emulator on a Mac, I thought the problem may be related to my OS, so I performed the same thing on a computer running Ubuntu. The same problem appears on both devices.
I have also captured the logcat files, but there are no similar error messages across these files.
These are the parameters that I am using:
Android SDK / AVD Manager on
Mac OSX10.10 (64 bit)
Java version 1.7.0_65
and
Ubuntu 14.04 (64 bit)
Java version 1.8_0.25
Any idea (why or) how to figure why the emulator is not responding anymore?
Any help would be appreciated.
Related
Today I downloaded Android Studio for my Debian Testing system. I wanted to run a HelloWorld application but weren't able to run it. With adb I can install it without having any problems.
However, if I try to do it with Android Studio, it gets stuck on 'Installing APKs'. The same happens when I try to start it in an emulator (gets stuck on 'Waiting for target device to come online').
My device is a Samsung Galaxy S3 with LineageOS (Android 7.1.2) and root permissions. Android Studio recognizes my phone properly.
What I've already done:
installed openjdk
set android_home
installed all the SDK-platforms since Android 4.3 and Android Emulator from SDK tools
enabled USB-debugging
tried with MTP and PTP
tried another emulated phone
installed lib32stdc++6
restarted my computer
and probably much more
I tried to do it the whole evening and couldn't find a solution. Is there something Debian-specific because I can only find instructions for Ubuntu? I have never experienced anything close to this on other systems.
Thank you in advance.
EDIT: I am now able to use my phone to run the android application by using USB 2.0 instead of USB 3.0! Is that a normal behavior since it works with native adb? I mean, if I buy a new PC after some years which has got only USB 3.0 ports, will I not be able to use phone debugging with Android Studio or is this just an issue? It is still known since 2014 (https://stackoverflow.com/a/9548311/8292104).
However, I still cannot get the app running on an AVD. I changed graphics to software, now it shows the phone but the screen remains black and the phone won't start. What can I do to fix it?
Try to completely delete and install Android Studio again, I think that it will solve the problem
Another possible solution that worked for me is to, in the application, go to
app - build - intermediates - split-apk - debug - slices
and then delete all of the contents within this folder. Then again, this only worked for me, so I would duplicate the document in case of corruption.
Since I read the news about Xamarin now being "free", I immediately installed Visual Studio 2015 Update 2 and the Android tooling (NDKs, SDKs for 19-23, Visual Studio Emulator for Android dated January 2016) to start working on an Android application.
Excited I launched the emulator from Tools -> Visual Studio Emulator for Android and installed the profile that is the best match for my own phone. Since my phone is on Android 6, I decided to get a profile for API Level 23 / Android 6.
Since I had already enabled Hyper-V a few months ago, the installation for the profile only had to add me to the Administrators group and create 2 network adapters.
So far, so good.
Upon starting the emulator, it would stay at "OS is starting...". I figured I'd wait a while. I figured I'd wait a while longer too. After that, I gave up the possibility of it going to work and started investigating.
I also tried other profiles, a few others from API Level 23, one from 22 and one from 19. Only the ones from API Level 23 did not work.
The following steps are what I came up with so far by Googling etc. I tried them in all sorts of combinations:
Rebooting
Disabling / enabling Hyper-V
Removing vEthernet adapters (through the Hyper-V Manager).
Running XDECleanup
Allowing XDE through my Windows Firewall as application (incoming)
Restoring the emulator software in Programs and Features
Enabling / disabling "Processor Compatibility" in Hyper-V Manager.
This is the data I've gathered so far:
A screenshot of the error message that the emulator gives after waiting a long time (10 - 15 minutes, maybe a little longer)
A screenshot of the last part of the log when being connected to the Android 6 VM:
A screenshot of the last part of the log of a working VM (this one's from an Android 4.4 VM):
Responses I've got so far from Microsoft:
-Those errors are normal
-And the only step I've tryed which they told me to, and I don't see here, it's this one:
On Hyper-V Manager, check the option for compatibility under CPU section
Besides from this, just make sure that on Hyper-V you get only 2 switches, the one you use to connect to the internet and the one that the VS Emulator for Android creates, I haven't got any results, but if you try, maybe you will.
In my case, I was mucking around with the VS emulator's virtual switches and had the network adapters in the wrong order.
After I moved the Windows Phone Emulator Internal Switch (Created when first running the VS Emulator) to the first Network Adapter slot in my settings, the emulator started up just fine. Apparently, order matters.
Had the same problem but got mine to work after trying a lot of things from different threads.
In the end I think this did the trick for me:
I added "c:\Program Files (x86)\Microsoft XDE\10.0.10586.0\xde.exe" as an exception in the firewall.
(i also switched of the firewall, but was probably unnecessary)
Temporarly disabled the WiFi device
Uninstalled VirtualBox
Removed all Virtual Switches in Hyper-V
Executed XdeCleanup.exe
Started the emulator again and it started up successfully!
Swiched of the emulator and enabled Firewall, Wifi device.
The emulator still starts successfully every time!
Thanks to all for sharing!
If you're using Xamarin, it's recommended that you use Xamarin Player. It's not Xamarin exclusive, it's just a much faster Android emulator. I use Android Studio, and the Xamarin Player is still faster on boot and launch than the default. This is just my recommendation to you, I have no clue how to fix your Visual Studio emulator, sorry.
I've played a lot with this and realized that I have had manually configured paging file on Windows. After restoring it to default all worked perfectly without messing with the virtual switches or adapters.
Just make sure that you have all Windows memory etc. settings set to default.
Regards, Mladen
My problem was that the system image was missing for the emulator.
When I opened the android virtual device manager it had an exclamation mark next to actions(i had to download the system image via the download link).
I had the same error message. The solution for me was:
Uninstall all emulators in the Visual Studio Emulator for Android
Check in Hyper-V-Manager if there also no instances
Unistall Visual Studio Emulator for Android
Run xdecleanup.exe (C:\Program Files (x86)\Microsoft XDE)
Uninstall Hyper-V from Windows features
Removed virtual ethernet adapters through uninstalling in Device Manager
(be sure to display disabled devices too)
Install Hyper-V from Windows features
Install Visual Studo Emulator for Android again
Download and install your emulator/profile
Run the emulator and have fun :-)
It seems there was a problem with the virtual switches and Hyper-V. The correct settings for the adapter looks like these:
Hyper-V-Manager:
Device Manager:
Network adapter:
Ethernet:
vEthernet (Virtueller Switch: Intel(R) Ethernet Connection (2) I219-LM #2):
vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch):
Emulator network settings:
I have a new machine running Win 8.1 x64, fully patched, with the latest Android SDK and Java JDK. I installed the latest Intel HAXM package as well. Everything fired up and worked great. The emulator would boot in about 30 seconds and each time I'd run an app from Android studio it would start up over there pretty quickly. But then I closed the emulator window (the UI itself showing the virtual phone). After that, I could never get it to come up again unless I rebooted. After a reboot it again works fine the first time, but never again after I close it. I have tried the following:
Running automatically from Android studio as well as launching manually from the command prompt using Intel's recommended options. Same problem either way.
Killing the emulator-x86.exe process, closing Android studio, unloading the Intel HAXM driver and then restarting all of that. No luck.
Running adb kill-server. No luck.
When creating the AVD I tried both the x86 and x86_64 versions, same result either way.
And yes, I have several real devices that work fine to test with. This is just perplexing that everything works perfectly the first time, yet something is hanging around messing up any further launches until a reboot occurs.
Any ideas on what is causing this or how to go about debugging it further?
-JT
I wanted to try my hand at programming android devices, so I followed the directions from the android website, installed the sdk, the java sdk, and eclipse. My computer is Windows 7 64-Bit, but I have the 32-bit Java SDK and Eclipse installed since hearing that there are issues with the 64-bit versions.
I am running the most recent version of the Android sdk, 4.0 R15.
I believe followed all of the instructions for installation, but when I load up a sample (Lunar Lander in this case), it loads the emulator, but will not install the app to it. ADB does not show the emulator listed when I use "adb devices", the DDMS perspective in eclipse does not detect any device either. In the emulator I have activated the USB debug setting in the developer area.
I have tried restarting the adb server, and have reinstalled a few times.
I even copied what one guy did on a youtube tutorial for a hello world program, and it still would not load to the device.
Does anybody have any idea how to get the emulator and eclipse talking so I can actually run and debug programs?
Try to adb kill-server and then do adb command like adb devices which will start adb again.
It helps in my case.
Best solution I found is this:
Open DDMS(Window->Open Perspective->DDMS)
In DDMS in the left side there is a Devices tab, a little below there is a list of items, choose little triangle called View Menu, under it find Reset adb and launch it.
After that I get my emulator detected.
Create new AVD following Window->AVD Manager->New (Give a name to your device & select the target) -> Create AVD.
Select the AVD that you created and Click Start to launch the devie.
Only on launching, the device is displayed under adb devices.
For starters, I think you can try the 64 bit versions of Java and Eclipse for Windows. I've Windows 7 64-bit edition, 64-bit java and eclipse versions and all work very well, without any glitches. I however have a question. Where exactly have you installed Android? I mean, using the installer that's available in the Android Developer website. If you've installed it in C:\Program Files, then try re-installing it in C:\ directly instead of Program Files directory. I had faced issues when the directory was C:\Program Files and then I changed it to C:\ .
I noticed that if you allocate a lot of memory to the device it can "freeze" when starting, if frozen for a sufficient period it disappears from the adb devices list. Try reduce the memory footprint of the application?
I've posted a similar question with a similar problem but on windows XP. So i installed ubuntu 11 and this>
sun-jdk 6, sun-jre 6, eclipse galileo, adt plugin and the android sdk.
Not even the 1.5 android target device works. Just loads forever, reaching the flashing android word screen and it goes on and on. I let it load for a hour and nothing changes.
What's the checklist to make this run? I am very dissapointed with this situation.
Specs> Athlon 64x2 3600+, ram = 1.5 Gb
I made the default 1.5 target device, another one with 2.3.3 and 256 ram, and another one with 2.1 and defaults.
What error do you get in console when you launch eclipse by hand and launch adt ?
What is the jre/jdk used to launch eclipse ? (ps fax | grep eclipse)
Stéphane
Once the animation comes up you should be able to get an adb connection to the emulator and use the adb shell or adb logcat output, this will let you know if it's still doing setup tasks such as dexopting packages, if it's dead, or if the android runtime is stuck in a crash and restart loop.
Just reinstalled the jvm and it worked.