Could not locate Andriod SDK

on mac os

directory in preferences in populated and checked green (note I had to manually install the andriod sdk 4.6)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Could not locate Android SDK. Please set via /p:AndroidSdkDirectory. (HelloA)

Posts

  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    I had to manually install the andriod sdk 4.6

    I don't know how to interpret this; there is no such thing as an Android SDK 4.6; the Android SDK version numbers are date stamps (e.g. adt-bundle-mac-x86_64-20130219.zip) or non-dotted "revision" number (e.g. android-sdk_r21.1-macosx.zip). Meanwhile, Android itself is only up to version 4..2.

    I don't know what "4.6" could refer to other than a Xamarin.Android version number.

    directory in preferences in populated and checked green

    What directory is listed there?

    image

    Does that directory contain a platform-tools/adb command which is executable? For example, given the above settings does /opt/android/sdk/platform-tools/adb exist?

  • IanBenolielIanBenoliel USMember

    You are correct. It is version 4.2
    the Android SDk did not get installed when Xamarin was installed.
    I installed it manually.
    I attach the screen shots you requested.

  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    Does /Developer/android-sdk-macosx/platform-tools/adb exist and is it executable?

    $ ls -l /Developer/android-sdk-macosx/platform-tools/adb
    

    Related: what are the contents of your $HOME/.config/xbuild/monodroid-config.xml file?

  • IanBenolielIanBenoliel USMember
    edited April 2013

    sorry but I am a Mac novice.

    when I type ls -l /Developer/android-sdk-macosx/platform-tools/adb in Terminal I get

    that command generates the following

    -rwxr-xr-x  1 numbercruncher  wheel  1256228 Apr 27 15:29 /Developer/android-sdk-macosx/platform-tools/adb
    

    Here is the contents of the file

    <?xml version="1.0" encoding="utf-8"?>
    <monodroid>
      <android-sdk path="/Developer/android-sdk-macosx" />
      <java-sdk path="/usr" />
      <android-ndk />
    </monodroid>
    
  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    Could you please try restarting Xamarin Studio?

  • IanBenolielIanBenoliel USMember

    Rebooted, tried to run, got this error.

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Could not find android.jar for API Level 8. This means the Android SDK platform for API Level 8 is not installed. Either install it in the Android SDK Manager, or change your Mono for Android project to target an API version that is installed. (/Developer/android-sdk-macosx/platforms/android-8/android.jar missing.) (HelloA)

  • JonathanPryorJonathanPryor USXamarin Team Xamurai
    Error: Could not find android.jar for API Level 8
    

    That, at least, is a more reasonable error. It means that your app has a $(TargetFrameworkVersion) of Android v2.2, which is API level 8, but you don't have the API level 8 SDK installed.

    There are two fixes:

    1. Change your $(TargetFrameworkVersion) by clicking Project > Project Name options. In the left-hand tree click Build > General. In the right-hand panel change the Target framework.

      I don't know what you should change the Target framework to; that depends on what you've installed.

    2. Install the API level 8 files by running /Developer/android-sdk-macosx/tools/android to start the Android SDK Manager. Within the Android SDK Manager click the checkbox next to Android 2.2 (API 8) > SDK Platform, then click Install X packages...

  • IanBenolielIanBenoliel USMember

    That was it. Thank you.

  • IanBenolielIanBenoliel USMember

    One final issue I hope.

    I am running Tasky. I changed the target sdk for the core and app. When I click the axml file i get the attached.

  • IanBenolielIanBenoliel USMember

    could also have to do with these 2 warnings

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Warning: Reference 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' not resolved (TestAndriod)

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Warning: Reference 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' not resolved (TestAndriod)

  • StevenTheEvenStevenTheEven SEMember ✭✭✭

    And you have the SDK you changed to installed this time?

  • IanBenolielIanBenoliel USMember

    Yes. There are no errors as before just those 2 warnings.

    The Tasky application runs although there are no buttons on it to create a task.

  • LluisSanchezLluisSanchez ESXamarin Team Xamurai

    Which API levels do you have installed in the Android SDK?

  • IanBenolielIanBenoliel USMember

    As a follow up. I created a new blank android project and left the target platform at 2.2. I was able to see the axml in file within the designer and run the project. click me worked. SO it appears the issue was when I selected a different target (4.2) in the project options under build.

    Still got these 2 warnings

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Warning: Reference 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' not resolved (AndroidHello2)

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Warning: Reference 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' not resolved (AndroidHello2)

  • rmaciasrmacias USBeta, University ✭✭✭✭✭

    Using the SDK manager, I usually download all the Android SDKs (along with their Google APIs) from API 8 and above. Causes less headaches for me, especially opening different projects or download samples, examples, etc. You never know which API level a project is being compiled to.

  • RituRajPandeyRituRajPandey USMember

    Hi All Please Resolve This Error Any One

    Error 1 Could not find android.jar for API Level 8. This means the Android SDK platform for API Level 8 is not installed. Either install it in the Android SDK Manager, or change your Mono for Android project to target an API version that is installed. (C:\Users\ritu\AppData\Local\Android\android-sdk\platforms\android-8\android.jar missing.) C:\Program Files\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 274 2 AndroidApplication1

    Thanks in advace

  • StevenTheEvenStevenTheEven SEMember ✭✭✭

    Sorry, but can you send your computer to me in Sweden so i can install the SDK for you? Because i will not travel to you to do it for you.

  • PANKAJSHARMAPANKAJSHARMA INMember

    I have same issue can any one help me.

  • rmaciasrmacias USBeta, University ✭✭✭✭✭

    Error 1 Could not find android.jar for API Level 8. This means the Android SDK platform for API Level 8 is not installed. Either install it in the Android SDK Manager, or change your Mono for Android project to target an API version that is installed. (C:\Users\ritu\AppData\Local\Android\android-sdk\platforms\android-8\android.jar missing.) C:\Program Files\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 274 2 AndroidApplication1

    I'll give you a hint:

    This means the Android SDK platform for API Level 8 is not installed. Either install it in the Android SDK Manager, or change your Mono for Android project to target an API version that is installed.

    Open the Android SDK manager and download the necessary APIs. In your case, API Level 8.

  • Refer to JonathanPryor's post abv; if you are using Xamarin Studio -> right-click on your project --> go into options --> navigate to Build-General --> and change your target framework to the SDK platform that you have downloaded; else download the API LEVEL 8/ Android 2.2

  • KraigBrockschmidt-MSFTKraigBrockschmidt-MSFT USMember, University ✭✭

    I came across this forum thread when searching for info on the /p:AndroidSdkDirectory error message. In my case I saw this when trying to set up a TFS build server to work with Xamarin, and the problem was that the Android SDK and NDK were installed in my user account and therefore inaccessible to the build agent account. Because this present thread comes up second in search results on the /p switch, I wanted to make this note. I also blogged the details here if others come across the same issues with TFS.

  • sirisha.6876sirisha.6876 USMember

    Preparing to install archives
    Downloading Android SDK Tools, revision 24.3.1
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\tools_r24.3.1-windows.zip (Access is denied)
    Downloading Android SDK Platform-tools, revision 22
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-tools_r22-windows.zip (Access is denied)
    Downloading SDK Platform Android 5.1.1, API 22, revision 2
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\android-22_r02.zip (Access is denied)
    Downloading SDK Platform Android 4.4.2, API 19, revision 4
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\android-19_r04.zip (Access is denied)
    Downloading SDK Platform Android 2.3.3, API 10, revision 2
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\android-2.3.3_r02-linux.zip (Access is denied)
    Downloading Samples for SDK API 22, revision 6
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\samples-22_r06.zip (Access is denied)
    Downloading Samples for SDK API 19, revision 6
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\samples-19_r06.zip (Access is denied)
    Downloading Samples for SDK API 10, revision 1
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\samples-2.3.3_r01-linux.zip (Access is denied)
    Downloading Sources for Android SDK, API 22, revision 1
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\sources-22_r01.zip (Access is denied)
    Downloading Android Support Library, revision 22.2
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\support_r22.2.zip (Access is denied)
    Downloading Google USB Driver, revision 11
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\usb_driver_r11-windows.zip (Access is denied)
    Skipping 'Android TV ARM EABI v7a System Image, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Android TV Intel x86 Atom System Image, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Android Wear ARM EABI v7a System Image, Android API 22, revision 2'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Android Wear Intel x86 Atom System Image, Android API 22, revision 2'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'ARM EABI v7a System Image, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Intel x86 Atom_64 System Image, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Intel x86 Atom System Image, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Google APIs, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Google APIs ARM EABI v7a System Image, Google Inc. API 22, revision 1'; it depends on 'Google APIs, Android API 22, revision 1' which was not installed.
    Skipping 'Google APIs Intel x86 Atom_64 System Image, Google Inc. API 22, revision 1'; it depends on 'Google APIs, Android API 22, revision 1' which was not installed.
    Skipping 'Google APIs Intel x86 Atom System Image, Google Inc. API 22, revision 1'; it depends on 'Google APIs, Android API 22, revision 1' which was not installed.
    Done. Nothing was installed.
    Preparing to install archives
    Downloading Android SDK Tools, revision 24.3.1
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\tools_r24.3.1-windows.zip (Access is denied)
    Downloading Android SDK Platform-tools, revision 22
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\platform-tools_r22-windows.zip (Access is denied)
    Downloading SDK Platform Android 5.1.1, API 22, revision 2
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\android-22_r02.zip (Access is denied)
    Downloading SDK Platform Android 4.4.2, API 19, revision 4
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\android-19_r04.zip (Access is denied)
    Downloading SDK Platform Android 2.3.3, API 10, revision 2
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\android-2.3.3_r02-linux.zip (Access is denied)
    Downloading Samples for SDK API 22, revision 6
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\samples-22_r06.zip (Access is denied)
    Downloading Samples for SDK API 19, revision 6
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\samples-19_r06.zip (Access is denied)
    Downloading Samples for SDK API 10, revision 1
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\samples-2.3.3_r01-linux.zip (Access is denied)
    Downloading Sources for Android SDK, API 22, revision 1
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\sources-22_r01.zip (Access is denied)
    Downloading Android Support Library, revision 22.2
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\support_r22.2.zip (Access is denied)
    Downloading Google USB Driver, revision 11
    URL not found: C:\Program Files (x86)\Android\android-sdk\temp\usb_driver_r11-windows.zip (Access is denied)
    Skipping 'Android TV ARM EABI v7a System Image, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Android TV Intel x86 Atom System Image, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Android Wear ARM EABI v7a System Image, Android API 22, revision 2'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Android Wear Intel x86 Atom System Image, Android API 22, revision 2'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'ARM EABI v7a System Image, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Intel x86 Atom_64 System Image, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Intel x86 Atom System Image, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Google APIs, Android API 22, revision 1'; it depends on 'SDK Platform Android 5.1.1, API 22, revision 2' which was not installed.
    Skipping 'Google APIs ARM EABI v7a System Image, Google Inc. API 22, revision 1'; it depends on 'Google APIs, Android API 22, revision 1' which was not installed.
    Skipping 'Google APIs Intel x86 Atom_64 System Image, Google Inc. API 22, revision 1'; it depends on 'Google APIs, Android API 22, revision 1' which was not installed.
    Skipping 'Google APIs Intel x86 Atom System Image, Google Inc. API 22, revision 1'; it depends on 'Google APIs, Android API 22, revision 1' which was not installed.
    Done. Nothing was installed.

    can anyone help me out.. am not able to install the above

Sign In or Register to comment.