1 Reply Latest reply on May 7, 2013 7:05 AM by Erik Jan de Wit

    cordova error on android 2.3.3

    francesco milesi Newbie

      Hi everybody,

       

      I am developing an app with errai-cordova. When I deploy my app to an android > 4.0, everything works fine. But when I deploy it to android 2.3.3, the screen is blank and I get the following error:

       

      05-07 12:25:39.362: I/dalvikvm(333): Could not find method android.webkit.WebView.<init>, referenced from method org.apache.cordova.CordovaWebView.<init>

      05-07 12:25:39.362: W/dalvikvm(333): VFY: unable to resolve direct method 3464: Landroid/webkit/WebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V

      05-07 12:25:39.362: D/dalvikvm(333): VFY: replacing opcode 0x70 at 0x0001

      05-07 12:25:39.362: D/dalvikvm(333): VFY: dead code 0x0004-0050 in Lorg/apache/cordova/CordovaWebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V

       

      I found out that this could be a problem related to cordova 2.2.0, that, if I am correct, is the cordova version bundled with errai.

      I tried to update the javascript org/jboss/errai/ui/cordova/js/cordova-android-2.2.0.js with cordova-android-2.5.0.js, but keeping the same file name, in my errai-cordova-3.0-SNAPSHOT.jar, but I have the same problem.

       

      My android application code is made of two classes (I show them here jiust for reference...)

       

      public class MainActivity extends DroidGap {

                    @Override

                  public void onCreate(Bundle savedInstanceState) {

                    super.onCreate(savedInstanceState);

                    super.loadUrl("file:///android_asset/www/index.html");

                  }

       

       

                  @Override

                  public void init() {

                    super.init(new CordovaWebView(this), new GWTCordovaWebViewClient(this), new CordovaChromeClient(this));

                  }

                  }


       

      public class GWTCordovaWebViewClient extends CordovaWebViewClient {

       

       

                public GWTCordovaWebViewClient(DroidGap ctx) {

                          super(ctx);

                }

       

       

                @Override

                public boolean shouldOverrideUrlLoading(WebView view, String url) {

                          if (url.startsWith("file://")) {

                                    return false;

                          }

       

                           return super.shouldOverrideUrlLoading(view, url);

                  }

      }

       

       

      DO you have any idea what is going on?

       

      thanks for your help

       

      ciao Francesco