Search code examples
androidjasonette

Clicking link on web container always force close the app


I am using jasonette to create a webview / iframe / web container to load my website into native app (android). The website loaded beautifully, but somehow it always crashed when i tried to click any link in the website.

Here my code snippet to load the website

{
"$jason": {
    "body": {
      "background": {
        "type": "html",
        "url": "https://stackoverflow.com/",
        "action": {
          "type": "$default"
        }
      }
    }
  }
}

what is not correct about it? and is there a way to debug error in web container?

edit: when clicking any link, on logcat shows this message: W/JasonParser: processTask : java.lang.NullPointerException: Attempt to invoke virtual method 'com.eclipsesource.v8.V8Locker com.eclipsesource.v8.V8.getLocker()' on a null object reference

then it crashed


Solution

  • Seems like this guy was having the same issue as you: https://github.com/jasonelle/jasonelle/issues/22

    found the issue. for some reason, the error shows up only in Android Studio's debug mode. Generating an APK and installing that works perfectly. Thanks :)

    Try installing a release version of the APK to the phone and check if it works for you.