none
Issues trying to use the Design view for a Xamarin Form in Visual Studio 2015

    Question

  • First time Xamarin user. I'm trying to create a cross-platform phone app for my senior project, but I keep running into issues with setting up Xamarin in Visual Studio 2015. Specifically, I cannot use the Design view for the projects, regardless of what type of app I try to create!

    When trying to create a Blank App (Native Portable), attempting to open up the Main.axml file in the Design View would return the error:

    Something went wrong
    The installed Android SDK is too old. Version 25.1.3 or newer is required. Please update to the latest version.
    Actions:Open Android SDK

    However, I have version 25.2.2 installed, and the "Open Android SDK" hyperlink does nothing. Attempting to run SDK Manager.exe simply opens a command prompt for a split second and immediately closes it. I was informed to open my android.bat file in a text editor like Notepad++ and modify instances of "set java_exe=" and "set javaw_exe=" to point towards my java.exe installation, but that didn't change anything; running android.bat simply verifies that I have Android SDK Tools revision 25.2.2 installed, and that there are no updates for Platform-tools or Build-tools.

    So I decided to start over and move on to a Xamarin.Form instead. However, starting a new Xamarin.Form presents the following pop-up:

    A problem was encountered creating the sub project '[projectname].Windows'. The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\8.1\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on the disk.
    C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\8.1\Microsoft.Windows.UI.Xaml.CSharp.targets

    Further, there is no Main.axml file for the [projectname].Droid or Main.storyboard for the [projectname].iOS folder - so I can't create a UI, much less access a Design View.

    Please help me to begin work on at least one of these!

    P.S. A problem shared in all instances is that my home has no Mac computers for the Xamarin Mac Agent to detect. Will I be able to develop for iOS devices without this?

    Thursday, November 3, 2016 5:50 AM

All replies

  • Hi John,

    Welcome to the MSDN forum.

    Refer to your description, I tried to open the Main.axml file in a new Xamarin project like yours which works fine, it looks like this issue is more related to your VS itself.

    >> The installed Android SDK is too old. Version 25.1.3 or newer is required. Please update to the latest version.

    For the error message, please have a look at this similar issue and I found some workarounds as below, you can have a try to troubleshot this issue:

    1. Go to Tools > Options > Xamarin > Android Settings to verify that the correct locations are pointed to for the JDK, Android SDK, and Android NDK.
    2. Upgrade the Xamarin to the latest version: Tools—Options-Xamarin-Other and click the “Check Now”, if there is any stable version, please install it.
    3. Check the installed Android SDK versions: Tools-Android-Android SDK Manager and it looks like the latest version of Android 25.2.2.
    4. Install JDK 1.8: Xamarin.Android 7.0 requires JDK 1.8 to use the Android Nougat (API 24) APIs.
    5. Install all Android SDK from API 14(android 4.0) to the latest versions: Tools-Android-Android SDK Manager and install those Android SDK versions.

    >> A problem was encountered creating the sub project '[projectname].Windows'. The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\8.1\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on the disk.
    C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\8.1\Microsoft.Windows.UI.Xaml.CSharp.targets

    Please see this similar issue and the solutions from Damien_The_Unbeliever and Jarek Kardas looks reasonable.

    Jarek Kardas: Try to copy 8.0 and 8.1 directories from C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0 to C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0 (notice version number at the end).

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 4, 2016 3:13 AM
    Moderator