locked
Error building helloworld android app on MAC OSX 10.9.2 RRS feed

  • Question

  • User39430 posted

    I am using xamarin studio on MAC (alpha channel) and am running into the following error when I do a build. Hello world IOS works fine, also have no issues with the same project on a PC. This worked a few days ago, could this relate to any OSX updates that I recently installed. (OSX 10.9.2)

    Error details

    Target CoreCompile:
        Tool /Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/smcs execution started with arguments: /noconfig /debug:full /debug+ /optimize- /out:obj/Debug/testAndroid101Xamarin.dll MainActivity.cs Resources/Resource.designer.cs Properties/AssemblyInfo.cs obj/Debug/MonoAndroid,Version=v4.4.AssemblyAttribute.cs /target:library /define:"DEBUG;__MOBILE__;__ANDROID__;__MOBILE__;__ANDROID__;__ANDROID_1__;__ANDROID_2__;__ANDROID_3__;__ANDROID_4__;__ANDROID_5__;__ANDROID_6__;__ANDROID_7__;__ANDROID_8__;__ANDROID_9__;__ANDROID_10__;__ANDROID_11__;__ANDROID_12__;__ANDROID_13__;__ANDROID_14__;__ANDROID_15__;__ANDROID_16__;__ANDROID_17__;__ANDROID_18__;__ANDROID_19__" /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/System.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/System.Xml.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v4.4/Mono.Android.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/System.Core.dll /warn:4
        /Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/smcs: **line 6: exec: mcs: not found
    

    /Library/Frameworks/Mono.framework/Versions/3.2.7/lib/mono/4.5/Microsoft.CSharp.Targets: error : Compiler crashed with code: 127.** Task "Csc" execution -- FAILED Done building target "CoreCompile" in project "/Users/xxx/testAndroid101Xamarin/testAndroid101Xamarin/testAndroid101Xamarin.csproj".-- FAILED

    Done building project "/Users/xxx/testAndroid101Xamarin/testAndroid101Xamarin/testAndroid101Xamarin.csproj".-- FAILED

    This is the list of XAMARIN software I have installed on my MAC

    === Xamarin Studio ===

    Version 4.3.3 (build 2) Installation UUID: 1edd5c30-cf73-468e-a74c-461e5017a474 Runtime: Mono 3.2.7 ((no/40f92d5) GTK+ 2.24.23 (Raleigh theme)

    Package version: 302070000
    

    === Xamarin.Android ===

    Version: 4.12.0 (Trial Edition) Android SDK: /Users/molinaetg/Library/Developer/Xamarin/android-sdk-macx86 Supported Android versions: 2.1 (API level 7) 2.2 (API level 8) 2.3 (API level 10) 3.1 (API level 12) 4.0 (API level 14) 4.0.3 (API level 15) 4.3 (API level 18) 4.4 (API level 19) Java SDK: /usr java version "1.6.065" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

    === Apple Developer Tools ===

    Xcode 5.0.2 (3335.32) Build 5A3005

    === Xamarin.Mac ===

    Xamarin.Mac: Not Installed

    === Xamarin.iOS ===

    Version: 7.0.6.168 (Trial Edition) Hash: 2ed9bc9 Branch: Build date: 2014-21-01 06:33:05-0500

    === Build Information ===

    Release ID: 403030002 Git revision: 89301538d2f1e41888247489294fdb08a6888119 Build date: 2014-02-23 23:26:23-05 Xamarin addins: 21512f84ba13e6f7264bb24d505927e2b302c81c

    === Operating System ===

    Mac OS X 10.9.2 Darwin molinas-mbp.home 13.1.0 Darwin Kernel Version 13.1.0 Thu Jan 16 19:40:37 PST 2014 root:xnu-2422.90.20~2/RELEASEX8664 x86_64

    Monday, March 10, 2014 10:02 PM

All replies

  • User13824 posted

    It sounds like maybe a file link, permission, or environment variable was changed in some small but problematic way. Hopefully reinstalling the Mono framework (that contains mcs), and Xamarin.Android will solve the problem.

    You can find the latest version of the Mono MDK on:
    http://www.go-mono.com/mono-downloads/download.html

    ... and the latest version of the Xamarin.Android installer on:
    https://store.xamarin.com/account/my/subscription/downloads

    The individual installer packages on store.xamarin.com are available via the drop down menus after clicking the "Show all versions" / "Hide all versions" link. (See http://forums.xamarin.com/discussion/10132/howto-install-older-versions-of-xamarin-software)


    If this doesn't solve the problem, you can take a look at the following information, and reply back with what you find.

    1. In Terminal.app run:

      ls -l /usr/bin/mcs

      For me this shows:

      lrwxr-xr-x 1 root wheel 47 Dec 6 20:26 /usr/bin/mcs -> /Library/Frameworks/Mono.framework/Commands/mcs

    2. In Terminal.app run:

      ls -l /Library/Frameworks/Mono.framework/Commands/mcs

      For me this shows:

      -rwxr-xr-x 1 root admin 460 Jan 16 18:04 /Library/Frameworks/Mono.framework/Commands/mcs

    3. In Terminal.app run:

      echo "$PATH"

      For me, the output includes:

      /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

    Wednesday, March 12, 2014 2:41 AM
  • User40391 posted

    Thanks brendan, will give that a shot.

    Wednesday, March 12, 2014 5:45 PM
  • User43183 posted

    I ran into this issue as well today... I tried just that first step of re-installing the mdk from the link Brendan suggested, and now I am indeed able to compile and run.

    Thanks for the help!

    Jon

    Thursday, March 13, 2014 1:08 AM
  • User587 posted

    Reinstalling the MDK worked for me as well!

    Wednesday, April 2, 2014 2:16 PM
  • User14393 posted

    Reinstalling the MDK worked for me as well! Thanks

    Thursday, April 3, 2014 9:25 PM
  • User48778 posted

    I just upgraded to Mavericks and am having the same frustration. I'm unable to instal l the MDK from the above links because OS X says it must come from the app store to allow. I'm kind of new to this and frustrated. Please point me to something that might get a newbie moving again. (I wish I hadn't updated from Lion now)

    Monday, April 21, 2014 11:19 PM
  • User48778 posted

    A complete uninstall and download reinstall seemed to fix the problem. However, it took the follow terminal commands to force the uninstall to truly be gone and accept the re-install: sudo rm -rf /Developer/MonoAndroid sudo rm -rf /Library/Frameworks/Mono.framework sudo rm -rf /Library/Frameworks/Xamarin.Android.framework

    (Solution came from jenniferRM on http://forums.xamarin.com/discussion/2189/uninstalling)

    Monday, April 21, 2014 11:33 PM
  • User872 posted

    Reinstalling the MDK did the trick. Thanks a million Brendan!

    Tuesday, April 29, 2014 7:07 AM
  • User11931 posted

    I had the same issue after updating the OS to Mavericks, and I fixed installing the MonoFramework again. I found the installers here: http://sourceforge.net/projects/mono.mirror/files/

    Saturday, May 17, 2014 2:11 PM
  • User64394 posted

    I also hit this after upgrading to OS X Mavericks (https://forums.xamarin.com/discussion/14067/compiler-crashed-with-code-127)

    Fixed it by symlinking back /usr/bin/mcs as it was missing, like @BrendanZagaeski shows above

    $ ls /usr/bin/mcs ls: /usr/bin/mcs: No such file or directory

    $ ls /Library/Frameworks/Mono.framework/Commands/mcs /Library/Frameworks/Mono.framework/Commands/mcs

    $ sudo ln -s /Library/Frameworks/Mono.framework/Commands/mcs /usr/bin/mcs

    Friday, July 18, 2014 8:48 AM
  • User61212 posted

    I just upgraded to OS X 10.9.4 and started getting the same error message. I also had to reinstall the Mono MDK.

    Wednesday, July 23, 2014 3:42 PM
  • User45757 posted

    for me helped https://forums.developer.apple.com/thread/3981

    and command in repair mode to disable rootless mode -# csrutil disable and after reboot $ sudo ln -s /Library/Frameworks/Mono.framework/Commands/mcs /usr/bin/mcs

    but it's not safe and I don't recommend this way!

    Wednesday, October 7, 2015 2:56 PM