Bug 42566 - Xamarin can't find NDK 12b because ndk-stack.exe is now ndk-stack.cmd
Summary: Xamarin can't find NDK 12b because ndk-stack.exe is now ndk-stack.cmd
Alias: None
Product: Android
Classification: Xamarin
Component: Tools and Addins ()
Version: unspecified
Hardware: PC Windows
: High normal
Target Milestone: 7.0 (C8)
Assignee: dean.ellis
Depends on:
Reported: 2016-07-14 19:06 UTC by Jeremy Kolb
Modified: 2016-09-06 19:17 UTC (History)
11 users (show)

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 Jeremy Kolb 2016-07-14 19:06:17 UTC
Can't set the NDK in Visual Studio to android-ndk-r12b.  Xamarin looks for ndk-stack.exe in the root folder but that has now changed to ndk-stack.cmd.
Comment 1 Jonathan Pryor 2016-07-25 19:49:56 UTC
Dean: We might want to consider reviewing "path checking code" to check for $PATHEXT values, which is a ';'-separated list of executable filename extensions:

> echo %PATHEXT%

(Though this should probably be split on System.IO.Path.PathSeparator.)
Comment 2 Jonathan Pryor 2016-07-28 19:05:04 UTC
Fixed in androidtools/426e2516, monodroid/master/8a9927fe, and monodroid/cycle8/bbe88ff7.
Comment 4 dean.ellis 2016-08-02 13:56:28 UTC
Jonp we will need to bump xamarin-android on master and cycle8 as well (if they haven't been already) since there was a fix xamarin-android/master/2a0a5cb6 in there as well.
Comment 5 dean.ellis 2016-08-04 16:13:45 UTC
should be fixed on monodroid/master/c9923a90

I will post when this fix has been applied to cycle8.
Comment 6 Jonathan Pryor 2016-08-08 14:29:17 UTC
Fixed in monodroid/cycle8/bbe88ff7.
Comment 8 dean.ellis 2016-08-09 15:21:56 UTC
Fixed in monodroid/cycle8/b695378e

XVS will need to be bumped too.
Comment 9 Jose Gallardo 2016-08-11 13:33:15 UTC
Bumped, in XVS commit:

This fix will be included in XVS
Comment 10 Naqeeb 2016-08-11 18:28:54 UTC
I have checked this issue with latest cycle 8 build i.e. XVS and still getting same behavior on both VS and XS.

Hence reopen this issue.
Comment 11 dean.ellis 2016-08-12 09:00:13 UTC
Naqeeb can you post the full diagnostic build output of the issue please. It might be we missed a commit.
Comment 12 Naqeeb 2016-08-12 18:51:00 UTC
I have checked this issue with latest C8 build i.e. c6ee6cc81397cbee440348fdf28e0a9b256bc4e2/Xamarin.VisualStudio_4.2.0.490.msi and still getting same issue. Below is the screencast for the same.

Screencast: http://www.screencast.com/t/ysjRWkBciqyp

@Dean, I am not sure why are you asking for diagnostic build output as I am unable to set NDK 12b in VS as well as XS. Please let me know if I am not getting you correctly.


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

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

Xamarin.iOS (40db5d1)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 13 Jonathan Pryor 2016-08-16 00:27:20 UTC
@Naqeeb: Thank you for the screencast.

The problem is that we have (at least?) two different places which use `ndk-stack.exe`. We fixed one, in xamarin-android, but had overlooked another, in androidtools, and it's the latter which is shared with Visual Studio/Xamarin Studio and responsible for your error message.
Comment 14 Jonathan Pryor 2016-08-16 01:47:44 UTC
androidtools/426e2516 was on master. The fix has also been applied as androidtools/cycle8/7dcee743.

Visual Studio and Xamarin Studio need to bump their androidtools commit to androidtools/cycle8/7dcee743 or later to fix the IDE side of this bug.
Comment 15 Jonathan Pryor 2016-08-17 15:01:41 UTC
Fixed in md-addins/cycle8/695f42de, XamarinVS/cycle8/0fb68efa, monodevelop/cycle8/fc3ab7c0.
Comment 16 Sachin Saini 2016-08-23 11:32:02 UTC
I have checked this issue with latest cycle8[XS] and builds mentions in comment15[XS] following by the step given in comment3 and observed that this issue still coming.

Latest Cycle8 Environment info:-
Latest Cycle8 Screencast:-
VS:- http://www.screencast.com/t/boTlHRiF2

Build environment info mention in comment 15:-
VS:- Not able to download XVS build because its status was ignore on wrench.

Hence, I am reopening this issue.
Comment 17 softlion 2016-08-25 09:04:34 UTC
+1 issue here, now that VS2015 update 3 is out, it automatically updates the NDK.
Comment 18 softlion 2016-08-25 09:09:09 UTC
Note that you could check a couple of month before a new NDK is released that Xamarin is stable with a new NDK version by testing your product on beta versions available there https://github.com/android-ndk/ndk/wiki
Comment 20 Jonathan Pryor 2016-08-25 21:25:30 UTC
@abhi: Does a project using Android NDK r12b build *without* the IDE, using `xbuild` or `MSBuild` on the command line?

@greg: The video in Comment #19 shows that XS isn't able to find the NDK. I'm out of ideas. Could you please investigate?
Comment 21 Jonathan Pryor 2016-08-25 22:01:37 UTC
@Dean: Looks like the `$PATHEXT`-related fix codepath isn't used on Windows, so it looks like this bug was never fixed on Windows.

For example, xamarin-android/master/2a0a5cb6 (Comment #4) only alters `AndroidSdkBase.FindExecutableInPath()`, but `FindExecutableInPath()` is only invoked from `AndroidSdkUnix.cs`, *not* `AndroidSdkWindows.cs`.
Comment 22 dean.ellis 2016-08-30 16:14:49 UTC
Fixed on monodroid/master/0fbaf24d

will need to be bumped for XVS master. 
Once confirmed we can then cp to c8
Comment 23 Naqeeb 2016-08-31 11:42:43 UTC
I have checked this issue with build xamarin.android-7.0.99-49 and observed that it is working fine. Here is the screencast for the same: http://www.screencast.com/t/jDEL8xSlVdcR

Environment info: https://gist.github.com/NaqeebAnsari/de89faf0319e8b483ef7a8df175ddd86

I will verify again if fix for XVS.
Comment 24 Naqeeb 2016-08-31 15:05:51 UTC
I am changing its status again in Resolved/Fixed and will verify Verify/Close this issue once it will get fixed in master XVS and C8 builds(XA and XVS).

While working with master XVS I got a new issue : https://bugzilla.xamarin.com/show_bug.cgi?id=43901 i.e Unable to set sdk and ndk path in VS with master XVS.
Comment 25 dean.ellis 2016-08-31 15:57:31 UTC
Cherry-picked to 

Comment 26 Akhilesh kumar 2016-09-06 19:17:40 UTC
I have checked this issue with latest C8 builds and now this issue no longer exist. I am successfully able to set set NDK 12b path in XS and VS.

Screencast: http://www.screencast.com/t/XazpItxc8t

So I am closing this issue.

C8: Xamarin.VisualStudio_4.2.0.654_2de3dea4cf6d89f9cbc73fe73ef40e7c086c55b8

Microsoft Visual Studio Enterprise 2015
Version 14.0.25425.01 Update 3
Microsoft .NET Framework
Version 4.6.01055

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

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

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


=== Xamarin Studio Enterprise ===

Version 6.1 (build 5418)
Installation UUID: 56d71809-da7f-4350-923d-8bf412047138
	Microsoft .NET 4.0.30319.42000
	GTK+ 2.24.26 (Light theme)
	GTK# 2.12.38

=== NuGet ===


=== Xamarin.Profiler ===

Not Installed

=== Xamarin.Android ===

Version: (Xamarin Enterprise)
Android SDK: E:\AndroidSDK\android-sdk
	Supported Android versions:
		2.3    (API level 10)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)
		7.0    (API level 24)

SDK Tools Version: 25.1.7
SDK Platform Tools Version: 24.0.1
SDK Build Tools Version: 23.0.3

Java SDK: C:\Program Files\Java\jdk1.8.0_77
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

Android Designer EPL code available here:

=== Xamarin Android Player ===

Not Installed

=== Build Information ===

Release ID: 601005418
Git revision: 32221a6fcbd0de078bc4309085aeb513ab4f9b1f
Build date: 2016-09-06 11:53:59-04
Xamarin addins: 0ba6065b10733d21107b4e97dc93ee3afe53c766
Build lane: monodevelop-windows-cycle8

=== Operating System ===

Windows 10.0.10240.0 (64-bit)

=== Enabled user installed addins ===

Gist Ide Information 1.0.2