Xamarin Build FAILED Error: Unsupported major.minor version 52.0

Asked

Viewed 103 times

0

I’m using Xamarin Visual Studio Comunti 2015 After compiling a project, I get the following err:

Exception in thread "main" 
1>java.lang.UnsupportedClassVersionError: com/android/dx/command/Main  :  Unsupported major.minor version 52.0
1>Build FAILED.
1>
========== Deploy: 0 succeeded, 1 failed, 0 skipped ========== 

Code

using System; 
using Android.App; 
using Android.Content; 
using Android.Runtime; 
using Android.Views; 
using Android.Widget; 
using Android.OS;


namespace Calculadora {
    [Activity(Label = "Calculadora", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {
        EditText edtValor;
        Button btnCalcular;
        TextView txtGorjeta;
        TextView txtValorTotal;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            edtValor        = FindViewById<EditText>(Resource.Id.edtValor);
            btnCalcular     = FindViewById<Button>(Resource.Id.btnCalcular);
            txtGorjeta      = FindViewById<TextView>(Resource.Id.txtGorjeta);
            txtValorTotal   = FindViewById<TextView>(Resource.Id.txtValorTotal);

            btnCalcular.Click += btnCalcular_Click;

        }


        void btnCalcular_Click(object sender,EventArgs e)
        {
            double valor = 0;
            valor = double.Parse(edtValor.Text);
            double valorTotal = 0;

            valor = valor * .10;
            valorTotal = valorTotal + valor;
            txtGorjeta.Text = valor.ToString();
            txtValorTotal.Text = valorTotal.ToString();
        }
    } }

Bug do Xamarin

configuração Android

1 answer

0

This is because you are trying to use JDK 1.8, Xamarin requires JDK 1.7, at documentation they guide to install JDK 7u79, but if you already have some other version of 1.7 installed it should work too, just change the path in Xamarin settings

Browser other questions tagged

You are not signed in. Login or sign up in order to post.