We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

`Java.Lang.NoSuchMethodError` exception while using Navigation Drawer

Thread ID:

Created:

Updated:

Platform:

Replies:

125512 Aug 10,2016 11:10 PM Aug 20,2016 04:04 AM General Discussion 4
loading
Tags: General Discussion
trinitro
Asked On August 10, 2016 11:10 PM

I'm trying to create a navigation drawer from samples, but I get the following exception on android simulator.

>Java.Lang.NoSuchMethodError: no method with name='setClipToOutline' signature='(Z)V' in class Lcom/xamarin/forms/platform/android/FormsViewGroup;


This is my code:

    public class MainPage : ContentPage
    {       
        public MainPage()
        {
            SfNavigationDrawer nav = new SfNavigationDrawer
            {
            };

            StackLayout mainStack = new StackLayout();
            mainStack.Opacity = 1;
            mainStack.Orientation = StackOrientation.Vertical;
            mainStack.HeightRequest = 500;
            mainStack.BackgroundColor = Color.White;

            ObservableCollection<String> list = new ObservableCollection<string>();
            list.Add("Home");
            list.Add("Profile");
            list.Add("Inbox");
            list.Add("Outbox");
            list.Add("Sent");
            list.Add("Draft");

            ListView listView = new ListView();
            listView.WidthRequest = 200;
            listView.VerticalOptions = LayoutOptions.FillAndExpand;
            listView.ItemsSource = list;
            mainStack.Children.Add(listView);

            nav.DrawerContentView = mainStack;



            StackLayout headerLayout = new StackLayout();
            headerLayout.Orientation = StackOrientation.Vertical;
            headerLayout.BackgroundColor = Color.FromHex("#1aa1d6");
            headerLayout.VerticalOptions = LayoutOptions.CenterAndExpand;
            headerLayout.HorizontalOptions = LayoutOptions.CenterAndExpand;
            headerLayout.HeightRequest = 200;
            headerLayout.WidthRequest = 275;
            Image image = new Image();
            image.Source = ImageSource.FromFile("user.png");
            image.HeightRequest = 100;
            image.WidthRequest = 70;
            image.HorizontalOptions = LayoutOptions.CenterAndExpand;
            image.VerticalOptions = LayoutOptions.Center;
            image.BackgroundColor = Color.FromHex("#1aa1d6");
            headerLayout.Children.Add(image);

            Label header = new Label();
            header.Text = "James Pollock";
            header.FontSize = 20;
            header.HeightRequest = 30;
            header.WidthRequest = 140;
            header.TextColor = Color.White;
            header.HorizontalOptions = LayoutOptions.Center;
            header.VerticalOptions = LayoutOptions.Center;
            header.BackgroundColor = Color.FromHex("#1aa1d6");
            headerLayout.Children.Add(header);
            nav.DrawerHeaderView = headerLayout;



            Button imageButton = new Button();
            //imageButton.Source = (FileImageSource)ImageSource.FromFile("_menu_.png");
            imageButton.WidthRequest = 50;

            Label homeLabel = new Label();
            homeLabel.Text = "Home";
            homeLabel.FontSize = 15;
            homeLabel.TextColor = Color.White;
            homeLabel.HorizontalTextAlignment = TextAlignment.Center;
            homeLabel.VerticalTextAlignment = TextAlignment.Center;

            StackLayout headerFrame = new StackLayout();
            headerFrame.Orientation = StackOrientation.Horizontal;
            headerFrame.Children.Add(imageButton);
            headerFrame.Children.Add(homeLabel);

            Label mainLabel = new Label();
            mainLabel.FontSize = 14;
            mainLabel.TextColor = Color.Black;
            mainLabel.Text = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum tempus. Turpis facilisis vitae consequat, cum a a, turpis dui consequat massa in dolor per, felis non amet. Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula. Lorem tortor neque, purus taciti quis id. Elementum integer orci accumsan minim phasellus vel.";

            StackLayout ContentFrame = new StackLayout();
            ContentFrame.Orientation = StackOrientation.Vertical;
            ContentFrame.BackgroundColor = Color.White;
            ContentFrame.Children.Add(headerFrame);
            ContentFrame.Children.Add(mainLabel);
            nav.ContentView = ContentFrame;



            nav.Position = Position.Left;
            nav.Transition = Transition.SlideOnTop;
           

            this.Content = nav;

        }
    }


I'll be thankful if you could help me get it working.



Vignesh V [Syncfusion]
Replied On August 11, 2016 04:41 AM

Hi Trinitro,

The reported crash issue might occur in older versions of Xamarin assemblies and so we request to check with upgraded xamarin version. We also suggest you to upgrade Essential Studio to our latest 2016 Volume 2 SP1 version which has the latest issue fixes. The latest ES version can be downloaded from the following link

https://www.syncfusion.com/forums/125204/essential-studio-2016-volume-2-service-pack-release-v14-2-0-28-available-for-download

Please let us know if the latest version fixes issue at your end.

Regards,
Vignesh V

trinitro
Replied On August 11, 2016 10:34 AM

Hi Vignesh,

I'm using the latest Essential Studio, I'll let you know if upgrading Xamarin fixed the issue.


Thank you for your replay,



trinitro
Replied On August 13, 2016 12:27 AM

I'm using ES V `14.2.0.26`, and latest release note doesn't include any information about this issue, so I'm assuming that this is a problem with Xamarin Form.

This are my packages:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Xamarin.Android.Support.Design" version="23.0.1.3" targetFramework="monoandroid60" />
  <package id="Xamarin.Android.Support.v4" version="23.0.1.3" targetFramework="monoandroid60" />
  <package id="Xamarin.Android.Support.v7.AppCompat" version="23.0.1.3" targetFramework="monoandroid60" />
  <package id="Xamarin.Android.Support.v7.CardView" version="23.0.1.3" targetFramework="monoandroid60" />
  <package id="Xamarin.Android.Support.v7.MediaRouter" version="23.0.1.3" targetFramework="monoandroid60" />
  <package id="Xamarin.Forms" version="2.0.0.6482" targetFramework="monoandroid60" />
</packages>

When I want to update Xamarin from Nuget, I'll be facing this exception:

An outdated of 'Android SDK Build-tools' is in use which this version of Android Support Library does not support. You must uninstall any 'Android SDK Build-tools' versions older than 23.0.0 from the 'Tools' section in your 'Android SDK Manager' You also need to install 'Android SDK Build-tools' version 23.0.0 or higher. Invoice.Android

It's while I have only V `23.0.3` and `24.0` installed.

I know it's not a Syncfusion issue, but I'll be very grateful if you could possibly suggest some workarounds.


Thanks you.

Ashwini Paranthaman [Syncfusion]
Replied On August 17, 2016 02:13 AM

Hi Trinitro, 
As we are a US based business and therefore by law we cannot engage in any commercial transaction with businesses from Iran, we are regretfully unable to help you with this. 
 
Regards, 
Ashwini P. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;