在xamarin中找不到AndroidSdk

时间:2016-04-18 08:00:43

标签: xamarin sdk visual-studio-2015 xamarin.android java-6

我是c#和Xamarin的初学者。 我安装了Visual studion和Xamarin,但是当我尝试使用Xamarin创建一个新项目时,它会在输出窗口中显示以下错误。

 [I:sdk]:                  Looking for Android SDK..
    [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory not found.
    [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
        Path does not contain adb.exe in \platform-tools (C:\android-sdk-windows).
    [I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\MonoAndroid\PrivateAndroidSdkPath not found.
    [I:sdk]:                    Key HKCU\SOFTWARE\Android SDK Tools\Path not found.
    [I:sdk]:                    Key HKLM\SOFTWARE\Android SDK Tools\Path found:
        Path does not contain adb.exe in \platform-tools (C:\Program Files (x86)\Android\android-sdk).
    [I:sdk]:                  Looking for Android NDK..
    [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory not found.
    [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory not found.
    [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory not found.
    [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory not found.
    [I:sdk]:                  Looking for Java 6 SDK..
    [I:sdk]:                    Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion found.
    [I:sdk]:                    Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.6\JavaHome not found.
    [I:sdk]:                    Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.7\JavaHome found:
        Path contains jarsigner.exe in \bin (C:\Program Files (x86)\Java\jdk1.7.0_55).
    [I:Unknown]:              Did not find Android SDK
    [I:sdk]:                  Looking for Android SDK..
    [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory not found.
    [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
        Path does not contain adb.exe in \platform-tools (C:\android-sdk-windows).
    [I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\MonoAndroid\PrivateAndroidSdkPath not found.
    [I:sdk]:                    Key HKCU\SOFTWARE\Android SDK Tools\Path not found.
    [I:sdk]:                    Key HKLM\SOFTWARE\Android SDK Tools\Path found:
        Path does not contain adb.exe in \platform-tools (C:\Program Files (x86)\Android\android-sdk).
    [I:sdk]:                  Looking for Android NDK..
    [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory found:
        Path contains ndk-stack.exe in \. (C:\ProgramData\Microsoft\AndroidNDK\android-ndk-r10e\).
    [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory not found.
    [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory not found.
    [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory not found.
    [I:sdk]:                  Looking for Java 6 SDK..
    [I:sdk]:                    Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion found.
    [I:sdk]:                    Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.6\JavaHome not found.
    [I:sdk]:                    Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.7\JavaHome found:
        Path contains jarsigner.exe in \bin (C:\Program Files (x86)\Java\jdk1.7.0_55).
    [I:Unknown]:              Did not find Android SDK
    [I:Unknown]:              Found Xamarin.Android 6.0.3

但我无法在C:\Program Files (x86)C:\Users\sony\AppData\Local下找到Android文件夹。

1 个答案:

答案 0 :(得分:14)

如果您确定未安装Android SDK,则必须下载Android SDK并初始安装。以下是link到Android SDK窗口安装程序。

安装Android SDK后,您需要将Visual Studio指向SDK文件夹。点击工具'在顶部的工具栏中,然后点击'选项'。如果未自动检测到Android SDK位置,请点击'更改'并选择位置。

之后您可能需要重新启动Visual Studio。

Options Window