title: Android 4.2.1, WebView and javascript interface breaks
body: <p>I have a webview with added javascript interface which works perfectly on most devices, except for those running Android 4.2.1.</p>
  
  <p>I removed most of the code, and stayed with a very basic code:</p>
  
  <pre><code>this.webView.getSettings().setJavaScriptEnabled(true);
  this.webView.setWebChromeClient(new WebChromeClient());
  this.webView.addJavascriptInterface(new Object() {
      public void handshake() {
          Log.d("JS", "handshake no params");
      }
  
      public void handshake(String json) {
          Log.d("JS", "handshake with params: " + json);
      }
  }, "Android");
  </code></pre>
  
  <p>In the javascript side of things the testing code looks like this:</p>
  
  <pre><code>Android.handshake();
  </code></pre>
  
  <p>But I get this in the logcat:</p>
  
  <blockquote>
    <p>E/Web Console: Uncaught TypeError: Object [object Object] has no
    method 'handshake'</p>
  </blockquote>
  
  <p>Again, this same exact thing works fine in devices who are have older android os (&lt; 4.2.1) that I have tested (the minimal version being 2.3.3).</p>
  
  <p>The strange thing is that if I start a completely new project, with nothing but a single Activity which has just a WebView, with the same code, everything works fine even for 4.2.1, but when it's part of my actual project, things break.
  There's nothing I'm doing with the webview which is not included in this code snippets I provided.</p>
  
  <p>What is the most strange to me is that the javascript finds the Android object but it just does not have the requested method (handshake), how can that be?</p>
  
  <p>Any help will be greatly appreciated since this has been driving me crazy for the past 2 weeks or so (it's a bug I go back to all the time, then give up, etc).
  Thanks.</p>