-1

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

baycisk
  • 131
  • 2
  • 12
  • Can you attach your phone to the computer and try getting the output of `adb logcat`? – gkpln3 Oct 16 '19 at 07:09
  • it giving this on pressing link: 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 – baycisk Oct 16 '19 at 07:11
  • For some reason, the error shows up only in Android Studio's debug mode. Generating an APK and installing that works perfectly. Thanks :) – Anas Mehar Oct 16 '19 at 07:18

2 Answers2

0

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.

gkpln3
  • 1,317
  • 10
  • 24
0

Jasonelle does not allow website links, buttons and forms to functions in the app. Every page or link is in a .json file. you will have to create the destination pages is jsonelle json pages. i dont recommend using Jsonelle for webcontainer instead look into webview android.

you can also add

  <category android:name="android.intent.category.BROWSABLE"></category>

to you AndroidManifest.xml

how to route to another page in jasonelle

        {  
           "type" : "label",
            "text": "click here",
            "style": {
              "color": "black"
            },
            "url": "https://google.com/page.json"
          }
Kofi Sammie
  • 3,237
  • 1
  • 17
  • 17