title: xamarin android build error: "Failed to create JavaTypeInfo for class"
body: <p>On build, the compiler is throwing the following error:</p>
  
  <blockquote>
    <p>Error Failed to create JavaTypeInfo for class:
    App.Droid.Controls.WebViewJavaScriptInterface due to
    System.NullReferenceException: Object reference not set to an instance
    of an object. at
    Java.Interop.Tools.JavaCallableWrappers.JavaCallableWrapperGenerator.Signature..ctor(String
    name, String signature, String connector, String managedParameters,
    String outerType, String superCall) at
    Java.Interop.Tools.JavaCallableWrappers.JavaCallableWrapperGenerator.Signature..ctor(MethodDefinition
    method, ExportAttribute export) at
    Java.Interop.Tools.JavaCallableWrappers.JavaCallableWrapperGenerator.AddMethod(MethodDefinition
    registeredMethod, MethodDefinition implementedMethod) at
    Java.Interop.Tools.JavaCallableWrappers.JavaCallableWrapperGenerator..ctor(TypeDefinition
    type, String outerType, Action2 log) at
    Java.Interop.Tools.JavaCallableWrappers.JavaCallableWrapperGenerator..ctor(TypeDefinition
    type, Action2 log) at
    Xamarin.Android.Tasks.Generator.GenerateJavaSource(TaskLoggingHelper
    log, TypeDefinition t, String outputPath, String applicationJavaClass,
    Boolean useSharedRuntime, Boolean generateOnCreateOverrides, Boolean
    hasExportReference)</p>
  </blockquote>
  
  <p>I have created a custom renderer for the webview, where I am trying to inject JavaScriptInterface. I have a solution with different Projects, which might be reason for the above issue, or maybe not.</p>
  
  <pre><code>public class WebviewRendererEX : WebViewRenderer
  {
      Context _context;
  
      public WebviewRendererEX(Context context) : base(context)
      {
          _context = context;
      }
      protected override void OnElementChanged(ElementChangedEventArgs&lt;Xamarin.Forms.WebView&gt; e)
      {
          base.OnElementChanged(e);
          if (Control != null)
          {
              CookieManager cm = CookieManager.Instance;
              cm.SetAcceptCookie(true);
              cm.SetAcceptThirdPartyCookies(Control, true);
              Control.Settings.JavaScriptEnabled = true;
              Control.Settings.DomStorageEnabled = true;
              Control.AddJavascriptInterface(this, "Android");
              Device.BeginInvokeOnMainThread(() =&gt;
              {
                  Control.EvaluateJavascript("function someNavigate(dict){Android.navigateTo(dict);}", null);
              });    
          }
      }
  }
  
  public class WebViewJavaScriptInterface : Java.Lang.Object
  {
  
      private Context context;
      public WebViewJavaScriptInterface(Context context)
      {
          this.context = context;
      }
      [Java.Interop.Export("navigateTo")]
      [JavascriptInterface]
      public void NavigateTo(Dictionary&lt;string, object&gt; dict)
      {
          Console.WriteLine(dict);
      }
  }
  </code></pre>
  
  <p>I expected that the App should run without any complietime issue, And once webview loaded javascriptInterface should work.</p>