Fast Deployment of App to Android Emulator Always Fails - android

I am attempting to Use Fast Deployment to quickly test my Android App in the emulator. I am doing this because, as you probably know, building and testing an app on the emulator is incredibly slow and quite frustrating so I need to speed this up.
PS: If you have any advice on how you can deploy and run an app on an emulator in under 30 seconds I'd greatly appreciate it. My app is tiny and simple so it shouldn't take bloody 1.5 mins to run on the emulator?
The deployment is failing and giving me the error:
Xamarin.AndroidTools.AndroidDeploymentException:
FastDevDirectoryCreationFailed at
Xamarin.AndroidTools.AndroidDeploySession.WaitForRemoteDirCreation(String
destinationPath, CancellationToken token) at
Xamarin.AndroidTools.AndroidDeploySession.InstallAssemblies(String
destinationPath, CancellationToken token) at
Xamarin.AndroidTools.AndroidDeploySession.FastDev(Boolean useExternal)
at Xamarin.AndroidTools.AndroidDeploySession.Run(CancellationToken
token) at
Xamarin.AndroidTools.AndroidDeploySession.RunLogged(CancellationToken
token) at
Xamarin.AndroidTools.AndroidDeploySession.Start(CancellationToken
token)
How I can fix this error? And successfully Use Fast Deployment and deploy it to the emulator? How you speed up Android emulator deployment and testing?
Relevant information:
On Windows 8.1 Surface Pro 2 (4gb ram)
Using VS2013 Professional
The Android emulator is a Nexus (API 21) CPU = Intel ATOM x86. I am using this because Xamarin suggests this to speed up deployment.
The project uses Xamarin and MVVM Cross
If I deploy to a different emulator using Use Fast Deployment I get no deployment error but when the app runs it crashes immediately with: Unfortunately 'app' has stopped

Though I don't know what fast deployment is, I can however suggest a very fast emulator - Genymotion. I use it for my app and it deploys in under 10 seconds. Below is the link. https://www.genymotion.com/

A few quick points, the document recommends using the Xamarin Android Player, so I would recommend using that too. If you don't really need to use a simulator, then deploying to device is also nice and quick too. That said, this scenario should work, is it possible to send over some more details on your issue to contact#xamarin.com and someone should be able to help (and mention I sent your issue this way?

If Genymotion doesnt work for you try Andy emulator. If both are still too slow for you try using xamarin studio with genymotion

Visual Studio Emulator for Android
also works very well. It uses hyper-V, so no need to install VirtualBox like GenyM, which can cause conflicts with hyper-V if you're doing windows developement at the same time.

For me, this error just randomly started appearing when trying to build from Visual Studio. It seems like something was wrong with the phone.
I cleared the phone's cache and I was able to install the app through Visual Studio again. To clear a phone's cache, you usually need to turn it off and then turn it back on in "Recovery booting". Usually this means holding some combination of volume button/power button/main button. Once booted in this mode, you should be able to see a "clear cache" option and then restart.

Related

Has anybody ever got the emulator working with a webcam?

a bit of a reverse question.... We're looking to develop apps using vs 2017 and Xamarin. However, we simply can't get the Android emulator to work with a usb webcam on a windows 10 PC.
We've just running the emulator, no visual studio code and using the camera app on the emulator. We've tried all the different version of the OS, all have the same result... If we set the front or back camera to emulate, we see the black and white checkerboard but if we set it to webcam(0), we get a could not connect to camera error msg.
We have also tried all the suggestions in similar questions, i.e. clear the memory, increasing sdcard.size etc.
Android studio's emulator has an error "can't connect to camera"
Android Emulator unable to open/connect with real webcam
Nothing seems to work...and none of the above answers have a positive answer (other than use a different emulator, which we are about to try)
So my question is "has anybody ever got this to work" or we hunting for a unicorn and it just doesn't work?
Well to be honest, the unicorn was there the first time I connected my cheap Genius USB camera from 2007 into my Windows 8.1 PC and configured the Back Camera as Webcam(0) in the Android emulator, to test a barcode scanning app made with Cordova 7.1.0 CLI.
I would suggest you to try with Android system images from different API levels (I think I used Android 5.1 or 6.0 for my tests) and also, why not, update the Android SDK tools. (I used the old SDK tools 24 at the time). If using the standalone SDK manager instead of Android Studio (like I do) follow these steps to update your SDK tools to version 27.
I hope this helps, anyway, you now know that the unicorn may be elusive but it can be found if you have the proper settings.

trying to run Xamarin Android app results in "Could not access the Package Manager"

I decided to give Xamarin a try. So I followed the various articles at https://developer.xamarin.com/guides/cross-platform/getting_started/ to install Xamarin, then build an Android app. That was pretty easy, especially since I already have Visual Studio 2017 installed. The code compiled fine. I set up an Android Virtual Device and tried to debug/run the app in that AVD. Everything I've tried results in:
Build succeeded.
Unexpected install output: Error: Could not access the Package Manager. Is the system running?
Deploy failed on ...[AVD device here]
I have VS 2017 running on Windows 10.
The development experience was encouraging, since I've been using VS/C# for such a long time now, but getting past this emulator issue has, so far, been a complete roadblock. Any help would be appreciated.
Could not access the Package Manager. Is the system running?
Are you using ARM based emulator ? They are extremely slow and take lots of time to boot up. As Anubhav Ranjan said, just wait until emulator be loaded completely, once it finished it should work.
Try using an x86 based emulator, and use the Hardware Acceleration. Those run much faster, still a little on the slow side, but bearable.

Android emulator crash linux with error?

Basically, I've been using Ubuntu with Android Studio, I have a very simple App which I am attempting to run on an emulator.
Now, the app actually starts inside the emulator just fine but the issue arises when the on-screen keyboard shows up. Once it has shown up, and you click a key, the emulator crashes with this error:
emulator64-arm: ../../sdk/emulator/opengl//host/libs/Translator/include/GLcommon/GLutils.h:48: unsigned int SafeUIntFromPointer(const void*): Assertion `(uintptr_t)(ptr) == (unsigned int)(uintptr_t)(ptr)' failed.
I have tried engaging the keyboard outside the App, and the issue is still there so I think it is safe to assume it isn't the app that is causing it.
Other things I've tried are:
noaudio (Started the emulator without audio, as I found a few posts suggesting it can cause freezing. This of course didn't help)
Unticked 'use host GPU' (This actually caused the emulator to black-screen)
Anyone aware of any work-around?
This issue was fixed in the Android Open Source Project (AOSP) repo but hasn't been ported to 4.0.3 yet so you will notice this issue when using emulators built with API 15.
The workaround is to turn off "Use Host GPU"
if you're using android studio, then this option is here:
Of course, this really slows down the emulator but it's better to have a slow emulator than one that is unusable because it constantly crashes. As of Dec 11, 2014, the latest update is:
we are going to release updates for older system image, stay tuned...
An Update to #gmale's answer,
I am using linux ubuntu.
Now you have an option called Emulated Performance, and it was set to Automatic for me
setting it to Software - GLES 2.0 fixed it for me

Android Emulator is not running

Hi I am new in android and started to learn
I have Windows 7 PC, with 2.33GHz Intel Core I3.
I am using Eclipse SDK
Version: 4.2.2
Build id: M20130204-1200
Android Development Toolkit
Version: 22.6.2.v201403212031-1085508
I have tried to run simple hello world program and don't know but emulator is showing just
android----- android, it's not even starting it's main windows
can anybody help me how to resolve that issue
I personally suggest you instead of use of Android Emulator use
GenyMotion or BlueStacks in both of them
for just android application development and testing Genymotion is the best best and the best
first time emulator start takes soo long, i mean first time ever, and first time in day.
however, you can check the Logcat and see what is going on,
you can view logcat (if not already appearing) by going to
Window -> Show View -> Logcat
if does not appear in the list, click other, and search for logcat.
once emulator started it will show log in logcat window.
it might be useful.
You should try the x86 version of the emulator, with HAXM enabled (if your computer supports Intel VT) it will be much faster than the ARM version.
Then, when creating a new device, choose the Intel Atom (x86) option for its CPU.
This is the guide I followed, looks like things haven't changed much since then.
You just wait..It takes a lot of time for the emulator to start..Make sure that snapshot is checked while creating the new avd and next time when you launch the avd make sure the Launch from snapshot checkbox is checked..
Android Emulators are very slow and buggy try GenyMotion it is fastest Emulator !
Every Android Developer should have.

Why does my Android emulator hang so often?

My Android emulator beachballs on startup almost every time I try to use it. I'm currently using Android Studio 0.2.0 build 130.737825 on OSX 10.8.4. It seems like it will launch into Android once or twice, then if I close and reopen, it hangs on the black screen before the Android splash screen. At this very moment, it's been hung for about 15 minutes. I don't see anything useful happening in Console. And Android Studio is fine. It's just the emulator that hangs.
The android emulator is pretty much unusably slow. I recommend using genymotion instead of the emulator. Genymotion runs the android device as a virtual machine, so it's basically like having a real device running. And it's super fast.
Android's emulator is slower than Apple's simulator. you can refer to here to know why. But you can actually enhance the virtual device(x86 not ARM) performance, if you install Intel x86 Emulator Accelerator(HAXM) which can be found in Android SDK Manager.

Categories

Resources