Pregunta

Recently, I took an interest in Xamarin, a system used for running C# code on both mobile and stationary devices. After setting up my Android environment using the Xamarin Studio ( a modified version of the popular IDE MonoDevelop), I had a few problems which I managed to fix, this being one that I've spent some time working on to no avail.

Problem

After creating an application, and opening the Main.axml file where the Layout of the app is stored, I get this message instead.

http://i.stack.imgur.com/7cjsN.png

Here is the XML code associated with the form.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <Button
        android:id="@+id/myButton"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" />
</LinearLayout>

Obviously, this is a problem, as I can't design Android forms with this message. One notable thing is that it says 'Android 4.4 (v10) on the top panel. I am using the most recent SDK from the Android site (http://developer.android.com/sdk/index.html), so I am confused as to why it is telling me that the Android Version is not installed.

A few things I've tried

When designing forms in Xamarin, it gives you a sample emulated system to build your forms off of, in order to determine the size of the screen and other possible associated variables. It gives you the option between various Nexus devices where you can build your forms. I tried switching devices, but I still receive the error message.

I've re-installed the SDK and also done a fresh install of Xamarin itself. These solutions helped with a few of my other problems, but this one has been persistent.

Conclusion

Why is Xamarin giving me this message? What is the problem? Please let me know if you need any other information.

¿Fue útil?

Solución

So, this was weird to figure out. Here's what I did.

The Fix

I was using the Android 4.4 (KitKat) SDK because that was the most recent SDK. After searching around for a bit, I finally found a conclusion, mainly through trial-and-error and a the help of a few people. As of this point, I guess that Xamarin Studio is not compatible/doesn't run well with Android 4.4. All I had to do to fix it was re-install packages from Android 4.3 (Jelly Bean) and then use the SDK with 4.3 packages instead of the new 4.4 packages (You can find an explanation on how to do this here). I'm sure this isn't a lasting bug, as eventually Xamarin Studio will be compatible with Android 4.4.

If anybody is ever having problems with this in the future, the solution here is fairly simple. Simply use an SDK from a previous version.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top