Bug 52688 - _SetupApplicationJavaClass depends on _SetupInstantRun which causes a rogue adb.exe process to be invoked without opting into Instant Run
Summary: _SetupApplicationJavaClass depends on _SetupInstantRun which causes a rogue a...
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.1 (C9)
Hardware: PC Windows
: High normal
Target Milestone: ---
Assignee: dean.ellis
Depends on:
Reported: 2017-02-22 20:57 UTC by Jon Douglas [MSFT]
Modified: 2017-03-14 10:08 UTC (History)
3 users (show)

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

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 Jon Douglas [MSFT] 2017-02-22 20:57:12 UTC

This bug is primarily inspired by the following Forum post:


It seems that the _SetupApplicationJavaClass target depends on the _SetupInstantRun target in which this target will eventually invoke an `adb.exe` during the GetPrimaryCpuAbi Task. This seems slightly odd given that there is no "opt-in" into the Instant Run feature.

This can be seen in the following MSBuild Structured Log Viewer:


One observation I've made is this Task gets invoked regardless of if a device is plugged in. If a device is plugged in, you will see the Task use `adb.exe` to retrieve the Abi and SDKVersion.

Thus, is it expected that _SetupInstantRun runs regardless of a customer opt-ing into the feature via their project settings? I suspect that _CheckInstantRunCondition has an issue that defaults _InstantRunEnabled to true

The customer had noted that in Xamarin.Android this behavior is not present. This is mainly because this build is almost 9 months old, and there has been work towards _SetupInstantRun since that build.

*Version Information:

Xamarin (f42aa37)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (c9880f9)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.Android SDK (c9880f9)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS (20d957a)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS and Xamarin.Mac SDK (20d957a)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 1 cfahrenholz 2017-03-10 10:54:59 UTC
We are experiencing the same problem on our TFS 2015 Build VM.
Adb.exe holds a handle to our Xamarin android project´s source folder. So the TFS build stucks during cleaning the workspace before compilation.

We are using Xamarin.VS
Comment 2 dean.ellis 2017-03-10 22:22:05 UTC
I'll be taking a look at this first thing on Monday.
Comment 3 Jonathan Pryor 2017-03-13 19:32:35 UTC
I believe that this bug was already fixed in monodroid/e95facca and released as part of Cycle 9.

I would suggest that they upgrade to XamarinVS 4.3.x (C9).
Comment 4 dean.ellis 2017-03-14 10:08:08 UTC
For reference this is the bug from the initial report https://bugzilla.xamarin.com/show_bug.cgi?id=43880