Bug 34635 - After update to El Capitan Android Binding project failed to build with error: Tool exited with code: 127; mono: not found;
Summary: After update to El Capitan Android Binding project failed to build with error...
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 5.1
Hardware: Macintosh Mac OS
: High blocker
Target Milestone: 6.0 (C6)
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-10-07 11:34 UTC by Seifer
Modified: 2015-11-17 12:49 UTC (History)
11 users (show)

Tags: BZCU
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:
Status:
VERIFIED FIXED

Description Seifer 2015-10-07 11:34:14 UTC
After update to El Capitan Android Binding project failed to build.
But simple Android project builds fine.

I've tried both mono runtimes: 4.0.4.4 and new 4.2.1 (for El Capitan) - nothing helps.

-----
Environment info:

Xamarin Studio
Version 5.9.7 (build 12)
Installation UUID: f18d3357-2272-4b26-b1fa-aff69df540e4
Runtime:
	Mono 4.2.1 (explicit/804ddbc)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010060

Apple Developer Tools
Xcode 7.0.1 (8228)
Build 7A1001

Xamarin.iOS
Version: 9.0.1.29 (Business Edition)
Hash: 1d27ac2
Branch: master
Build date: 2015-09-25 18:08:44-0400

Xamarin.Android
Version: 5.1.6.7 (Business Edition)
Android SDK: /Users/Seifer/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.2    (API level 17)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
Java SDK: /usr
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

Xamarin Android Player
Version: Unknown version
Location: /Applications/Xamarin Android Player.app

Xamarin.Mac
Not Installed

Build Information
Release ID: 509070012
Git revision: 2635bd7e508e5bc4c19438e45eefdd9a75232ecb
Build date: 2015-09-25 15:52:15-04
Xamarin addins: 6e0ed86be96e8bd589ba9bc0f50d7121c4dd0d30

Operating System
Mac OS X 10.11.0
Darwin Seifer-Book.local 15.0.0 Darwin Kernel Version 15.0.0
    Wed Aug 26 16:57:32 PDT 2015
    root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64
Comment 1 Seifer 2015-10-07 11:35:47 UTC
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Bindings.targets: Error: Tool exited with code: 127. Output: /Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/generator: line 6: exec: mono: not found
Comment 2 Atsushi Eno 2015-10-12 22:25:47 UTC
team/on OSX: I assume this is because El Capitan has imposed some access restrictions and that affected mono setup, and we likely need fix some parts for those too, isn't it?
Comment 3 Miguel de Icaza [MSFT] 2015-10-13 14:54:53 UTC
We need to replace regular uses of "mono" with the full path on OSX, there is no other way of fixing this reliably:

/Library/Frameworks/Mono.framework/Commands/mono
Comment 4 Jonathan Pryor 2015-10-13 17:24:44 UTC
> We need to replace regular uses of "mono" with the full path on OSX, there

This was done in monodroid/5cae13fd, and should be included in the current Cycle 6/6.0.0 alpha release.
Comment 5 Seifer 2015-10-13 17:39:07 UTC
Any workaround to apply fix locally without switching to alpha channel?
Comment 6 Arpit Jha 2015-10-15 05:26:01 UTC
I have checked this issue and able to reproduce this issue OSMDroid Binding sample.
with https://developer.xamarin.com/samples/monodroid/OsmDroidBindingExample/  

I am getting issue mentioned in bug description on building the Binding sample with build mono-android-5.1.6-7_58099c5358da3488b0e7fb0bb4af47aca7cc61d6 
Screencast: http://www.screencast.com/t/ixWO00qdtae
Build output: https://gist.github.com/Rajneesh360Logica/a379cd7ec1712d58b4b1

I have checked this issue with latest Cycle 6 build  mono-android-6.0.0-15_9cffc3983ea75731ae238b8f501e6631e6aa159a and observed that Binding sample build successfully

Build output: https://gist.github.com/Rajneesh360Logica/b1ba89b00757f53e4811
Screencast: http://www.screencast.com/t/4bVn0GGdrk

Environment Info:
=== Xamarin Studio ===

Version 5.10 (build 819)
Installation UUID: 0b7eaebc-a0ed-4b58-81df-91e378cad28c
Runtime:
	Mono 4.2.1 (explicit/b50293b)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010075

=== Xamarin.Profiler ===

Version: 0.0.0.0
Location: /Applications/XamarinProfiler.Mac.app/Contents/MacOS/XamarinProfiler.Mac

=== Apple Developer Tools ===

Xcode 7.0 (8227)
Build 7A220

=== Xamarin.Mac ===

Not Installed

=== Xamarin.iOS ===

Not Installed

=== Xamarin.Android ===

Version: 6.0.0.15 (Business Edition)
Android SDK: /Android SDK/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)

SDK Tools Version: 23.0.2
SDK Platform Tools Version: 20
SDK Build Tools Version: 20

Java SDK: /usr
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

=== Xamarin Android Player ===

Version: 0.6.1
Location: /Applications/Xamarin Android Player.app

=== Build Information ===

Release ID: 510000819
Git revision: 5ff1ae603fa924d778f86cc13c7b2ff2ddea3d28
Build date: 2015-10-13 00:22:52-04
Xamarin addins: 76c1fa1d57172a447864737b91880c89b8d52a82
Build lane: monodevelop-lion-cycle6

=== Operating System ===

Mac OS X 10.11.0
Darwin Admin-Macs-Mac-mini.local 15.0.0 Darwin Kernel Version 15.0.0
    Wed Aug 26 16:57:32 PDT 2015
    root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64
Comment 7 Seifer 2015-10-15 05:28:12 UTC
Is it possible to make changes into Xamarin.Android.Bindings.targets (or something) to avoid switching to alpha channel?
Comment 8 Jonathan Pryor 2015-10-15 12:15:37 UTC
@Seifer:
> Is it possible to make changes into Xamarin.Android.Bindings.targets (or
> something) to avoid switching to alpha channel?

Yes; it should be safe to go to /Library/Frameworks/Xamarin.Android.framework/Commands and update all scripts to use the correct mono.

$ grep -l '#!/bin/sh' *
generator
javadoc-to-mdoc
logcat-parse
mcw-gen
mdoc
smcs

For example, generator has:

exec mono $MONO_OPTIONS "$MANDROID_DIR/generator.exe" "$@"

Update it to use:

exec /Library/Frameworks/Mono.framework/Commands/mono $MONO_OPTIONS "$MANDROID_DIR/generator.exe" "$@"

Repeat for all scripts, and that should allow Xamarin.Android to work on El Capitan.

What isn't addressed is anything in the Xamarin Studio side of things; that's outside my wheelhouse.
Comment 9 Tajinder Singh 2015-10-21 08:59:20 UTC
I have checked this issue and its working fine with C5SR5 build.

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

Environment info:

=== Xamarin Studio ===

Version 5.9.7 (build 63)
Installation UUID: 0922fe35-7ea3-4736-b7b6-9eddaf47d514
Runtime:
	Mono 4.0.5 ((detached/1d8d582)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400050001

=== Xamarin.Android ===

Version: 5.1.9.0 (Enterprise Edition)
Android SDK: /Users/360logica/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		6.0    (API level 23)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 7.1 (9077)
Build 7B85

=== Xamarin.iOS ===

Version: 9.0.1.31 (Enterprise Edition)
Hash: de3c24f
Branch: master
Build date: 2015-10-16 19:13:32-0400

=== Xamarin.Mac ===

Version: 2.5.0.177 (Enterprise Edition)

=== Build Information ===

Release ID: 509070063
Git revision: 42569d8b5eff3cfa5320279df55f0ddcd3176b65
Build date: 2015-10-16 11:11:53-04
Xamarin addins: d77f191bd7d3451adf837b85b38f2b7c60004400

=== Operating System ===

Mac OS X 10.11.0
Darwin 360Logicas-MacBook-Pro.local 15.0.0 Darwin Kernel Version 15.0.0
    Wed Aug 26 16:57:32 PDT 2015
    root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64