Kofi Kotga
Kofi Kotga

Reputation: 3

"Could not find mandroid!" VS Community xamarin

I Just downloaded VS Community which includes Xamarin 4.0.3214 , and when I create an empty android project then trying to build it I got the following errors and warning :

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

and other like errors.

I tried to remove xamarin and install it again but invain.

Update :

when i checked log as suggested i found some errors :

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

Upvotes: 0

Views: 1557

Answers (1)

Brendan Zagaeski
Brendan Zagaeski

Reputation: 2882

Could not find mandroid!

  1. Please check that all of the following files exist on your system:

    • %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. If any of those files are missing, you can try a clean uninstall and reinstall:

    • Uninstall the "Xamarin" package from the "Programs and Features" Control Panel.
    • Manually delete the following 2 folders (if either one still exists):

      • %ProgramFiles(x86)%\MSBuild\Xamarin\Android
      • %ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\MonoAndroid
    • Reinstall Xamarin.
  3. If any of the files from step 1 are still missing after the clean uninstall, reinstall, and reboot, it might be a good idea to check any virus protection software you have running to see if it might have quarantined the missing files.

  4. As one other possible workaround, you could try manually extracting the missing files from the Xamarin.VisualStudio .msi file. In particular, you could extract the .msi to a temporary folder using the msiexec command with the TARGETDIR property (see https://stackoverflow.com/a/8841965), and then copy the files from that temporary folder to their proper install locations. If you don't have a copy of the .msi, you can download it from your account page as illustrated under "Download Links" on https://kb.xamarin.com/customer/portal/articles/1699777.

The referenced component 'System.Core' could not be found.
The referenced component 'System.Xml.Linq' could not be found.

These messages can sometimes appear as separate warnings that are unrelated to the "Could not find mandroid!" error/warning. One of the most common reasons for these messages is if the Android SDK or Java SDK cannot be found. To help rule out that possibility, ensure that both paths appear with green check marks under Tools > Options > Xamarin > Android Settings.

Other steps to try

If none of the above steps help (for example if all of the expected files are present but you still get the "Could not find mandroid!" message), you can check the log files for possible additional clues:

  1. Select Help > Xamarin > Open Logs... in Visual Studio.

  2. Check the most recent *Ide.log and monodroid*.log files.

Upvotes: 3

Related Questions