Forum Xamarin.Android

Deploy hangs on 'Detecting installed packages...'

PaulSinnemaPaulSinnema NLMember ✭✭✭

I've been at this all day and still no solution. This morning I was asked to test if we could install a package from a download link on our website. That worked fine on the phone I normally do my debugging and testing. After that I tried to normally deploy my app to the phone again (after deleting the installed package) but the build started hanging here:

Detecting installed packages...
1>DEBUG RunShellCommand 1015faeb8a312a02 am broadcast -a "" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_25,nl.natuurnetwerk.notifier" -n "Mono.Android.DebugRuntime/"

After an hour I gave up and started using my wifes phone to debug and test. This phone has no problems and I can deploy to it just fine but I want my own phone to work again. I have no clue what has broken. I've deleted all leftover files from the ad-hoc install (using ES File Manager and Master Clean) on my phone. I disabled and enabled USB debugging. I got the question for allowing adb to connect again and allowed it 'always from this computer'.

The command above hangs but just before that command the 'getprop' is executed and succeeds without any problems.

1>DEBUG RunShellCommand 1015faeb8a312a02 getprop
1>TASK: GetProperties getprop completed?:[audioflinger.bootsnd]: [0]
1>[boot.sfbootcomplete]: [0]
1>[dalvik.vm.appimageformat]: [lz4]
1>[BEGIN] Detecting installed packages
1>[MESSAGE] Detecting installed packages...
1>Detecting installed packages...
1>DEBUG RunShellCommand 1015faeb8a312a02 am broadcast -a "" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_25,nl.natuurnetwerk.notifier" -n "Mono.Android.DebugRuntime/"


  • LucaPanellaLucaPanella USMember ✭✭

    Same problem here with Visual Studio for Mac v7.0.1 (build 24).

    I restored the phone but after a couple of hours of work the issue appears again :(

    Any solution? It's very very annoying... I can't reset the phone every two hours!!!

  • PaulSinnemaPaulSinnema NLMember ✭✭✭
    edited June 2017

    This issue has been fixed. Take a look here: I don't know if it solves it for the Mac version too.

  • LucaPanellaLucaPanella USMember ✭✭
    edited June 2017

    I still have the issue... i cannot work anymore on my device... i'm developing an app that uses bluetooth so i cannot work anymore... anyone with the same problem?

  • BryanPhillipsBryanPhillips USUniversity
    edited June 2017

    I also have this issue. I too am working on an app that uses bluetooth. I have to restart my device and even then it is not consistent in actually working after I do that. I've tried reinstalling visual studio for mac but that did not help. I have better luck on my mac then on my windows machine. On my windows machine I usually have to restart everything and even then it doesn't always work.

    Edit: Added spot on deploy where it gets hung up.

    Detecting installed packages
    DEBUG RunShellCommand LGH8209a93efb6 am broadcast -a "" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_23,com.sample.myapp" -n "Mono.Android.DebugRuntime/"

  • AlbertKAlbertK MYMember ✭✭✭✭

    Try this,

    VS 2105 Menu -> Tools -> Android -> Android ADB command prompt

    type in

    adb uninstall -k com.sample.myapp

    in error log your app name is "com.sample.myapp" so replace this with the real name if it is different. Redeploy again.

  • BryanPhillipsBryanPhillips USUniversity
    edited June 2017

    @AlbertK said:
    Try this,

    VS 2105 Menu -> Tools -> Android -> Android ADB command prompt

    type in

    adb uninstall -k com.sample.myapp

    in error log your app name is "com.sample.myapp" so replace this with the real name if it is different. Redeploy again.

    That did not seem to make a difference.
    The most frustrating part is I can deploy from android studio without any problems, even on my windows machine.

  • PaulSinnemaPaulSinnema NLMember ✭✭✭

    Maybe you can request a fix via the provided link?

  • EdHubbellEdHubbell USMember ✭✭
    edited July 2017

    I've got the same issue here. I was playing around with some bluetooth libraries. Rolled back to an earlier version with no bluetooth integration, and I still have the same problem.

    I've tried every solution suggested. Turned off Fast Deploy, restart phone, uninstall app, etc... Absolutely no love. 'Detecting installed packages' forever. Seems like there is something on my phone now that is left over from a previous install. I did forget to enable bluetooth in my initial AndroidManifest, but I don't think that would cause this level of difficulty.

    FWIW - using latest stable Mac version of Visual Studio.

  • EdHubbellEdHubbell USMember ✭✭

    Visual Studio hangs for a while when I try to turn on 'Use Shared Runtime'. Usually, you can make a change and click OK and the screen goes away. Mine just stays there until I manually close it.

    Even after it is closed, Visual Studio is still trying to save something.

    Things I have tried:

    • turn on/off Fast Assembly Deployment
    • turn on/off Use Shared Mono Runtime
    • uninstall anything Xamarin from the phone (Google Pixel) for all users.
    • restart phone
    • change applications
    • ritual of animal sacrifice

    Nothing that I can find seems to address the problem, except to use a different device to test on.

    Luckily, I have an extra Pixel here.

    So it all ('it all' being Android deployment) works on the other Pixel.

    This is a device based problem. Something is on the one phone that isn't on the other one. Not sure what the screwy bit is on the one phone. Also not sure how long I'll be able to continue to develop on the extra phone before the same thing starts happening on the spare phone.

  • jbedardjbedard CAMember

    I have the same issue using Visual Studio 2017 on Windows. I am also working with BLE in my app. This is affecting only my Nexus 6P. Working fine on a Samsung S5. Xamarin support, please consider this as a bug. From the forums, it seems to be a regular on & off issue in the past few years.

    It seems to be an abnormal response delay to the adb shell am broadcast command to retreive the installed package versions. Maybe adding some sort of timeout would then allow to a full redeploy if this happen. That would be longer but we would be able to debug on our phones!


    Key components version info below:

    Microsoft Visual Studio Enterprise 2017
    Version 15.2 (26430.14) Release
    Xamarin (fec6f88)

    Xamarin.Android SDK (9dbc4c5)

    Xamarin.iOS and Xamarin.Mac SDK (ad35de4)

  • jbedardjbedard CAMember

    Ok I may have found a (unpleasant) workaround. Based on this post:

    I've forced Google App shutdown on my phone. Suddently, the Xamarin app deployment is rolling again and I am able to deploy & debug. I got to do this almost each time but it is better than having to reboot the phone and clean the solution each time!

    Please try it out!

  • EdHubbellEdHubbell USMember ✭✭

    Thanks, @jbedard ! Thanks to you, I finally got something to install on Android from Xamarin again.

    My steps:

    • Start deploy in Xamarin Studio. Observe it freeze as usual at the 'Detecting Installed Packages' stage.
    • On the phone, navigate to Settings...Apps... Scroll down to 'Google' (between GMail and Google Connectivity Services' on my Pixel).
    • Select Google and then tap on 'Force Stop'.
    • Observe the messages in the Deploying to Device log in Visual Studio progress on.
    • Do a happy dance (music TBD). Or just be productive the rest of the day.

    Haven't been able to run on this phone for days. Very happy to be able to use it again.

    I've got another thread started with the same complaint - I'll post this solution there as well. Nice work, @jbedard - And thanks again.


  • EdHubbellEdHubbell USMember ✭✭

    For what this is worth - If you've got a Pixel, upgrading to Android 'o' seems to fix the problem. At least, for now.

  • AnnuAnnu Member ✭✭

    I finally was able to deploy it to device .
    My Steps

    • Uninstalled already installed support packages from Device
    • Uninstalled MonosharedRuntime package from Device
Sign In or Register to comment.