“找不到曼陀罗!” VS社区xamarin

时间:2016-04-24 14:32:05

标签: xamarin visual-studio-2015 xamarin.android xamarin.forms

我刚刚下载了包含Xamarin 4.0.3214的VS社区,当我创建一个空的android项目然后尝试构建它时,我收到以下错误并发出警告:

Could not find mandroid!
The referenced component 'System.Core' could not be found.
The referenced component 'System.Xml.Linq' could not be found.

和其他类似的错误。

我尝试删除xamarin并重新安装但是重新启动。

更新:

当我按照建议检查日志时发现了一些错误:

MonoDroidLog Information: 0 : [2016-05-03 01:09:28.0141] [I:sdk]:                  Looking for Android SDK..
MonoDroidLog Information: 0 : [2016-05-03 01:09:28.0161] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
    Path contains adb.exe in \platform-tools (C:\Users\lenovo\AppData\Local\Android\android-sdk).
MonoDroidLog Information: 0 : [2016-05-03 01:09:28.0161] [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
    Path does not contain adb.exe in \platform-tools (C:\android-sdk-windows).
MonoDroidLog Information: 0 : [2016-05-03 01:09:28.0171] [I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\MonoAndroid\PrivateAndroidSdkPath not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:28.0191] [I:sdk]:                    Key HKCU\SOFTWARE\Android SDK Tools\Path not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:28.0201] [I:sdk]:                    Key HKLM\SOFTWARE\Android SDK Tools\Path found:
    Path contains adb.exe in \platform-tools (C:\Users\lenovo\AppData\Local\Android\android-sdk).
MonoDroidLog Information: 0 : [2016-05-03 01:09:28.0211] [I:sdk]:                  Looking for Android NDK..
MonoDroidLog Information: 0 : [2016-05-03 01:09:28.0231] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory found:
    Path contains ndk-stack.exe in \. (C:\Users\lenovo\Documents\Android\ndk\android-ndk-r10d).
MonoDroidLog Information: 0 : [2016-05-03 01:09:28.0251] [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:28.0251] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory found:
    Path contains jarsigner.exe in \bin (C:\Program Files (x86)\Java\jdk1.7.0_71).
MonoDroidLog Information: 0 : [2016-05-03 01:09:28.0261] [I:Unknown]:              Found Android SDK. API levels: (none)
MonoDroidLog Information: 0 : [2016-05-03 01:09:28.0271] [I:Unknown]:              Did not find Xamarin.Android
MonoDroidLog Information: 0 : [2016-05-03 01:09:31.0123] [I:]:                     Tracking android devices started
MonoDroidLog Information: 0 : [2016-05-03 01:09:31.0423] [D:]:                     Tracking avd started
MonoDroidLog Information: 0 : [2016-05-03 01:09:31.0433] [D:]:                     avd watcher *.ini path: 'C:\Users\lenovo\.android\avd'
MonoDroidLog Information: 0 : [2016-05-03 01:09:31.0443] [D:]:                     avd watcher android path: 'C:\Users\lenovo\AppData\Local\Android\ANDROI~1\tools\android.bat'
MonoDroidLog Information: 0 : [2016-05-03 01:09:31.0553] [D:]:                     TrackDeviceTask got: 
MonoDroidLog Information: 0 : [2016-05-03 01:09:31.0583] [I:]:                     Got new device list from adb with 0 devices
MonoDroidLog Information: 0 : [2016-05-03 01:09:32.9514] [D:]:                     avd watcher: got device list from avd with 2 devices
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0717] [I:sdk]:                  Looking for Android SDK..
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0727] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
    Path contains adb.exe in \platform-tools (C:\Users\lenovo\AppData\Local\Android\android-sdk).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0737] [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
    Path does not contain adb.exe in \platform-tools (C:\android-sdk-windows).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0737] [I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\MonoAndroid\PrivateAndroidSdkPath not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0747] [I:sdk]:                    Key HKCU\SOFTWARE\Android SDK Tools\Path not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0757] [I:sdk]:                    Key HKLM\SOFTWARE\Android SDK Tools\Path found:
    Path contains adb.exe in \platform-tools (C:\Users\lenovo\AppData\Local\Android\android-sdk).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0767] [I:sdk]:                  Looking for Android NDK..
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0767] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory found:
    Path contains ndk-stack.exe in \. (C:\Users\lenovo\Documents\Android\ndk\android-ndk-r10d).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0777] [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0787] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory found:
    Path contains jarsigner.exe in \bin (C:\Program Files (x86)\Java\jdk1.7.0_71).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0787] [I:Unknown]:              Found Android SDK. API levels: (none)
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0797] [I:Unknown]:              Did not find Xamarin.Android
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0827] [I:sdk]:                  Looking for Android SDK..
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0827] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
    Path contains adb.exe in \platform-tools (C:\Users\lenovo\AppData\Local\Android\android-sdk).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0837] [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
    Path does not contain adb.exe in \platform-tools (C:\android-sdk-windows).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0847] [I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\MonoAndroid\PrivateAndroidSdkPath not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0847] [I:sdk]:                    Key HKCU\SOFTWARE\Android SDK Tools\Path not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0857] [I:sdk]:                    Key HKLM\SOFTWARE\Android SDK Tools\Path found:
    Path contains adb.exe in \platform-tools (C:\Users\lenovo\AppData\Local\Android\android-sdk).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0867] [I:sdk]:                  Looking for Android NDK..
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0877] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory found:
    Path contains ndk-stack.exe in \. (C:\Users\lenovo\Documents\Android\ndk\android-ndk-r10d).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0877] [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0887] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory found:
    Path contains jarsigner.exe in \bin (C:\Program Files (x86)\Java\jdk1.7.0_71).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0897] [I:Unknown]:              Found Android SDK. API levels: (none)
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0897] [I:Unknown]:              Did not find Xamarin.Android
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0927] [I:sdk]:                  Looking for Android SDK..
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0937] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
    Path contains adb.exe in \platform-tools (C:\Users\lenovo\AppData\Local\Android\android-sdk).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0937] [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
    Path does not contain adb.exe in \platform-tools (C:\android-sdk-windows).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0947] [I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\MonoAndroid\PrivateAndroidSdkPath not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0957] [I:sdk]:                    Key HKCU\SOFTWARE\Android SDK Tools\Path not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0957] [I:sdk]:                    Key HKLM\SOFTWARE\Android SDK Tools\Path found:
    Path contains adb.exe in \platform-tools (C:\Users\lenovo\AppData\Local\Android\android-sdk).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0967] [I:sdk]:                  Looking for Android NDK..
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0977] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory found:
    Path contains ndk-stack.exe in \. (C:\Users\lenovo\Documents\Android\ndk\android-ndk-r10d).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0987] [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.0997] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory found:
    Path contains jarsigner.exe in \bin (C:\Program Files (x86)\Java\jdk1.7.0_71).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1077] [I:Unknown]:              Found Android SDK. API levels: (none)
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1087] [I:Unknown]:              Did not find Xamarin.Android
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1107] [I:sdk]:                  Looking for Android SDK..
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1117] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
    Path contains adb.exe in \platform-tools (C:\Users\lenovo\AppData\Local\Android\android-sdk).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1117] [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found:
    Path does not contain adb.exe in \platform-tools (C:\android-sdk-windows).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1127] [I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\MonoAndroid\PrivateAndroidSdkPath not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1137] [I:sdk]:                    Key HKCU\SOFTWARE\Android SDK Tools\Path not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1147] [I:sdk]:                    Key HKLM\SOFTWARE\Android SDK Tools\Path found:
    Path contains adb.exe in \platform-tools (C:\Users\lenovo\AppData\Local\Android\android-sdk).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1157] [I:sdk]:                  Looking for Android NDK..
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1157] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory found:
    Path contains ndk-stack.exe in \. (C:\Users\lenovo\Documents\Android\ndk\android-ndk-r10d).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1167] [I:sdk]:                    Key HKLM\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory not found.
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1167] [I:sdk]:                    Key HKCU\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory found:
    Path contains jarsigner.exe in \bin (C:\Program Files (x86)\Java\jdk1.7.0_71).
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1177] [I:Unknown]:              Found Android SDK. API levels: (none)
MonoDroidLog Information: 0 : [2016-05-03 01:09:39.1187] [I:Unknown]:              Did not find Xamarin.Android

1 个答案:

答案 0 :(得分:3)

  

找不到mandroid!

  1. 请检查系统中是否存在以下所有文件:

    • %ProgramFiles(x86)%\MSBuild\Xamarin\Android\Mono.Android.DebugRuntime-debug.apk
    • %ProgramFiles(x86)%\MSBuild\Xamarin\Android\Ionic.Zip.dll
    • %ProgramFiles(x86)%\MSBuild\Xamarin\Android\mandroid.exe
    • %ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll
  2. 如果缺少任何这些文件,您可以尝试干净卸载并重新安装:

    • 卸载" Xamarin"来自"程序和功能"控制面板。
    • 手动删除以下2个文件夹(如果其中任何一个仍然存在):

      • %ProgramFiles(x86)%\MSBuild\Xamarin\Android
      • %ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\MonoAndroid
    • 重新安装Xamarin。
  3. 如果在清除卸载,重新安装和重新启动后,步骤1中的任何文件仍然缺失,那么检查您运行的任何病毒防护软件可能是个好主意。看看它是否可能隔离了丢失的文件。

  4. 作为另一种可能的解决方法,您可以尝试从Xamarin.VisualStudio .msi文件中手动提取丢失的文件。特别是,您可以使用带有.msi属性的msiexec命令将TARGETDIR解压缩到临时文件夹(请参阅https://stackoverflow.com/a/8841965),然后从该临时文件夹中复制文件到他们正确的安装位置。如果您没有.msi的副本,则可以从your account page下载,如#34;下载链接"在https://kb.xamarin.com/customer/portal/articles/1699777

  5.   

    引用的组件' System.Core'无法找到。
      引用的组件' System.Xml.Linq'无法找到。

    这些消息有时可能显示为与"无法找到mandroid无关的单独警告!"错误/警告。这些消息的最常见原因之一是无法找到Android SDK或Java SDK。为了帮助排除这种可能性,请确保在工具>下的两个路径都带有绿色复选标记。选项> Xamarin> Android设置

    尝试

    的其他步骤

    如果以上步骤都没有帮助(例如,如果所有预期的文件都存在但你仍然得到"找不到mandroid!"消息),那么你可以检查日志文件以获取可能的其他线索:

    1. 选择帮助> Xamarin>在Visual Studio中打开日志...

    2. 检查最新的*Ide.logmonodroid*.log个文件。