locked
Xamarin Forms Android MethodAccessException RRS feed

  • Question

  • User362694 posted

    Since the upgrade to 15.5.1, my Xamarin project doesn't seem to work anymore.

    When loading a page, I get this error:

    System.MethodAccessException: Method Xamarin.Forms.View:.ctor ()' is inaccessible from methodMyApp.MyPage.InitializeComponent ()'

    However, this page is built exactly like my other pages which are working and I have no idea where to start searching. Any ideas where this comes from? I use Xamarin.Forms plugin version 2.5.0.121934.

    Edit: This is the content of the auto generated file where the exception comes up:

    public partial class MyPage : global::Xamarin.Forms.ContentPage {
         [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
        private void InitializeComponent() {
            global::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(MyPage));
        }
    }
    
    Thursday, December 14, 2017 12:21 PM

Answers

  • User362694 posted

    Got it fixed.

    used a View-item as placeholder which caused the error.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, December 14, 2017 2:15 PM

All replies

  • User362694 posted

    Got it fixed.

    used a View-item as placeholder which caused the error.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, December 14, 2017 2:15 PM
  • User230366 posted

    To clarify to help others..it looks like you can't have views at all anymore. I was using a view just as a touch listener and the page started crashing once I updated Xamarin. Simply changed the View to a StackLayout and everything works again.

    Thursday, March 1, 2018 9:30 PM