Bug 12836 - Deployment stalling at "Installing shared runtime"
Summary: Deployment stalling at "Installing shared runtime"
Alias: None
Product: Android
Classification: Xamarin
Component: Tools and Addins ()
Version: 4.6.x
Hardware: PC Windows
: Low normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2013-06-23 11:47 UTC by Paul Gedeon
Modified: 2017-06-27 15:21 UTC (History)
9 users (show)

Is this bug a regression?: ---
Last known good build:

Logfiles for Installing runtime stall issue (14.18 KB, application/zip)
2013-07-02 06:38 UTC, Jens W.

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Paul Gedeon 2013-06-23 11:47:37 UTC

I am using Xamarin Studio for Android (Starter). I tried all channels and they all have the same bug. When I try deploying on device, it stalls forever in "Installing shared runtime". I activated USB debugging on the device and installed all there is to install through the SDK Manager. I have a Samsung Galaxy SIII with Jellybeans (4.1). I never managed to upload an app to the device, it always stalls. I didn't file this as Deployment since the component description said "Linux Deployment"

Comment 1 Paul Gedeon 2013-06-28 08:48:21 UTC
Sadly, I can not use Xamarin Studio as long as this is not fixed.
Comment 2 Jonathan Pryor 2013-06-28 12:41:39 UTC
You may need to enable Developer Mode or sideloading or whatever...


The `adb devices` command needs to return your device for anything to work. `adb` is part of the Android SDK: http://developer.android.com/tools/help/adb.html
Comment 3 Mikayla Hutchinson [MSFT] 2013-06-28 16:20:14 UTC
Can you please attach the AndroidTools log from AppData\Local\XamarinStudio-4.0\Logs?
Comment 4 Jens W. 2013-07-02 06:37:32 UTC

I am facing the same issue and I followed all links and suggestions above. I zipped the Logs folder of today's logs... I hope you have any advise on how to solve this.

Thanks + Regards,
Comment 5 Jens W. 2013-07-02 06:38:27 UTC
Created attachment 4252 [details]
Logfiles for Installing runtime stall issue

The latest logfiles from my PC which have been created during the "Installing runtime" stall issue.
Comment 6 Paul Gedeon 2013-07-07 12:27:47 UTC
I didn't find how to add an attachment, but here's the requested file on pastebin: 
Comment 7 Paul Gedeon 2013-07-07 12:31:13 UTC
Is it a problem with my NDK?
Comment 8 Mikayla Hutchinson [MSFT] 2013-07-10 13:02:20 UTC
In both cases, the last command run against the emulator seems to be:
rm "/data/local/tmp/Mono.Android.DebugRuntime-armeabi-v7a.apk"

Perhaps this command is not returning. What emulator are you using?

Could you please try running the command manually after a failed deployment and see whether it works?

Use "adb -e shell" to get a shell on the emulator, and then run the command "rm /data/local/tmp/Mono.Android.DebugRuntime-armeabi-v7a.apk".
Comment 9 Paul Gedeon 2013-07-10 13:06:01 UTC
I use Start Without Debugging directly in Xamarin Studio on my Galaxy SIII. I don't think I chose an emulator for running on device. I will look into deploying with commands, but I don't think I will be able to do it before this week-end when I head back home. Maybe Jens W. can be more help until then.
Comment 10 Mikayla Hutchinson [MSFT] 2013-07-10 14:21:25 UTC
The androidtools log from Jens definitely shows it deploying on an emulator, and being cancelled right after that rm command.

Paul, yours shows a device, but it does not show at what point it was cancelled. The last operation is uninstalling a previous version of the shared runtime,
Comment 11 Paul Gedeon 2013-07-10 14:25:13 UTC
I did not cancel it, it stalls indefinitely with nothing happening.
Comment 12 Mikayla Hutchinson [MSFT] 2013-07-10 14:35:54 UTC
Okay, so in your trace the last command is the one that stalls.

pm uninstall "Mono.Android.DebugRuntime"

If you run this command on a shell, does it stall and/or give any output?

What versions of Xamarin.Android and Xamarin Studio are you using?
Comment 13 Jens W. 2013-07-10 16:02:09 UTC

sorry for answering a bit late. Yes it is true I ran it on an emulator with API_15 setup (standard, no modifications despite of hooking Unknown sources, USB debugging etc etc).

Here are my findings (adb -e shell was run):

- rm runs as follows:

# rm /data/local/tmp/Mono.Android.DebugRuntime-armeabi-v7a.apk
rm /data/local/tmp/Mono.Android.DebugRuntime-armeabi-v7a.apk

No special issues or failure output

- pm uninstall "Mono.Android.DebugRuntime" failed, but I guess this is correct since it can't be there. So I tried to run pm install "Mono.Android.DebugRuntime" and this was the output:

# pm install "Mono.Android.DebugRuntime"
pm install "Mono.Android.DebugRuntime"
        pkg: Mono.Android.DebugRuntime

Now I tried to run it again (start Xamarin Studio, start the deployment) and this time it stalled at 

[2013-07-10 21:45:56.9] DEBUG: RunShellCommand: emulator-5554 cat /data/system/packages.xml

but when I run the command cat on the shell it works and returns the XML.

So now there is another interesting aspect: since every action stalled I tried to push the APK via adb to the emulator and this stalls, too ! There is no progress or anything else that gives me a hint something is in progress :(

I hope that gives you some more insights, but I will try to get some more information about this.

Thanks + Regards,
Comment 14 Jonathan Pryor 2013-07-10 16:57:42 UTC
@Jens: Your target device appears hosed: I know of no reason why everything would be stalling for you. Please try creating and running a new emulator instance.
Comment 15 Jens W. 2013-07-12 14:30:03 UTC
@Jonathan: I did a setup from scratch for an emulator but it did not solve the stall issue. I don't know why it is stalling since on my PC at my workplace it runs directly without problems. I will now try to uninstall and re-install Xamarin...
Comment 17 Michael Evenson 2013-09-18 15:19:01 UTC
I have the same issue using the ASUS TF700T device. I try to deploy to the device and it hangs at:

1>Installing shared runtime
1>Target device is armeabi-v7a.
1>Installing the Mono shared runtime (armeabi-v7a - 1375296268)...

I purchased another TF700T and did a factory reset on it then tried to deploy to it and it works. 

Why would one machine work and another not. 

Here's a clue - The device that I cannot deploy to is running Android 4.2.1 and the one I can deploy to is running version 4.0.3.
Comment 18 Jonathan Pryor 2013-09-18 16:55:47 UTC
Random thought: this could be due to enabling stdout redirection:


Please run the following command:

    adb shell getprop log.redirect-stdio

If it returns "true", you must execute:

    adb shell setprop log.redirect-stdio ''
    adb shell stop
    adb shell start

Our toolchain _requires_ that stdout and stderr NOT be redirected to logcat. The reason why is that, unlike what the above Android documentation states, stdout and stderr are NOT always redirected to /dev/null. Instead, they are contextual.

Start an app on the device (e.g. within your app), and stdout/stderr will be /dev/null.

Start an app _from adb_, and stdout/stderr will be from `adb`.

For example:

    adb shell ls /

When stdout is NOT redirected (the default), the above will list the files and directories to the shell you entered the above command into.

When stdout IS redirected, the above will print NOTHING to the shell you entered the above command into. Instead, the output of `ls /` will be written to `adb logcat`.

This means that when stdout is redirected, there is NO WAY to view the output of `adb` commands, as all output is written to logcat (which is not at all helpful).
Comment 19 Jonathan Pryor 2014-07-28 17:02:48 UTC
Is this still a problem.
Comment 20 Jeroen 2014-10-06 06:56:55 UTC
This problem can also occur when you disable "Google play store" on your device.
Comment 21 Chris Hardy [MSFT] 2017-06-27 15:21:36 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Android. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.