title: Error in error callback: TestPlugin2 = ReferenceError: Can't find variable: log at file:///android_asset/www/js/cordova-1.6.1.js:276
body: <p>Can somebody help me with this: 
  this is my code:</p>
  
  <p>//js</p>
  
  <pre><code>var TestPlugin={ 
  test:function(name,successCallback,failureCallback){
      console.log("navigator.service.sms smssend: ----------------");
      PhoneGap.exec(successCallback, failureCallback, "TestPlugin", "test", [name]);
  }};
  
  TestPlugin.test(
      "hubiao",
          function(){
              alert("success");
          },
          function(e){
              alert("fail");
              log(e);
          }
      );
  </code></pre>
  
  <p>//Android  phonegap</p>
  
  <pre><code>public class TestPlugin extends Plugin {
  @Override
  public PluginResult execute(String action, JSONArray data, String callBackId) {
  
      if ("test".equalsIgnoreCase(action)) {  
          Log.d("DatePickerPluginListener execute", "test");  
          Context context=ctx.getContext();
          String name="";
          JSONObject fileInfo = new JSONObject();
          try {
              name = data.getString(0);
              fileInfo.put("hello", "Android"+name);
          } catch (JSONException e) {
              e.printStackTrace();
          }
          final PluginResult r = new PluginResult(  
                  Status.OK,fileInfo); 
          Log.i("TestPlugin", name);
          Toast.makeText(context,"User:"+name, Toast.LENGTH_LONG).show();
          return r;  
      }else{
           Log.d("DatePickerPlugin", "Invalid action : " + action + " passed"); 
           return new PluginResult(Status.INVALID_ACTION); 
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>///
  The point:
  if I add:</p>
  
  <pre><code> Toast.makeText(context,"User:"+name, Toast.LENGTH_LONG).show();
  </code></pre>
  
  <p>phonegap will give failureCallback,
  when I remove:</p>
  
  <pre><code> Toast.makeText(context,"User:"+name, Toast.LENGTH_LONG).show();
  </code></pre>
  
  <p>phonegap will give successCallback.
  Why? I have no idea.Anyone counld help me? Thank you very much!</p>