App keeps crashing on Android APK & Live

Well…

I finally decided that doesn’t matter how big my screen is, I am going to recreate it. So I then created a brand new project, added a new screen & then manually added 150+ components in it. Everything worked fine, until I added a Web-Viewer. I have an HTML file in my app’s files/assets, whose task is to check whether an entered email is in a valid format.

The moment I set the web-viewer’s URL to my local file (verifyemail.html), and opened the screen in Thunkable Live, my app crashed. I then removed the URL, and added an actual URL (eg. https://www.bing.com), and found that now it doesn’t crash. Then I added the local URL again, and it again crashed.

Since all these tests were done in a new test app, I tried the same thing on my original project (removing the local URL from the web-viewer) and found out that my original app doesn’t crash. It works very smoothly.

So turns out, all along the problem was not with the navigate to block, but with the web-viewer with the URL set to a local file.

1 Like

But now, what should I do with the local file? I need to use both the files, because the only way I can check if the email is valid or not is through the first file, verifyemail.html. The second file’s task is to encrypt text, encodedata.html.

I send the encodedata file some text I need to encode through the web-viewer POST message method, and then receive the encoded data through the received message event; and then use the encrypted data further.

image

image


The files worked all the time through the web-viewer. Everytime I would successfully get the email validation & the encoded data. The problem is, it just crashes my app.

Is there any way you could suggest, so not only I could use the local files with the web-viewer, but also prevent my app from crashing?

Thanks a lot! :grinning:

1 Like

@jared If I am right I remember you also worked with local HTML files in one of your apps - Do you have any advice on this? (refer to the last post)

Thanks!

1 Like

Thanks for sharing this finding!
If you open verifyemail.html in a normal web browser, does it look OK?
If you get a sample HTML file from the internet and try to display that in your project, does it cause the same behavior?

2 Likes

So you first get the data and can see it but then the app crashes?

1 Like

My app is also crashing sometimes… I don’t know why

Hi, @jane @jared!

First off, sorry for the delay - I’ve been unable to reply…

I tested all the points, and found out the following conclusions -

  • I hosted that HTML file on my website (so it would be as https://xyz.com/verifyemail.html) and put its URL into the web-viewer in order to test it to see if it worked.

    image

    Then found out that it’s (a hosted HTML file) working, even when we Post/Receive a message. Also, you might want to reload the web-viewer you are trying to POST a message to before posting it.

    image

  • The web-viewer doesn’t work & crashes the app when set to invisible.

    • The web-view I was working on all along was always set to invisible, because it was of no use to show it to the user either.
    • I then tried to set the size of 1px (nearly invisible) to the web-viewer, and then it worked.
  • Both the online hosted HTML file & locally stored file showed crashes when they were set to a web-viewer which was invisible. They both started working when I added some height to the web-viewer.

Conclusion:
The main problem lied in the invisible web-viewer. If a web-viewer is set to invisible/height=0px, then it would crash your app. If you really want to hide it, you can set it’s height to 1px, so it won’t be visible.

So, I did the same as above, and it worked. Thanks!

4 Likes

This is what I did for the web viewer to work (DnD UI) to make it work. It never worked good if set to invisible.

image

1 Like

Resizing is ok, but how to bring previous size (full container)?

1 Like

In DnD UI, there is no auto sizing therefore there is no full container.

Ok solved it by setting

set WebViewer URL to BLANK (pink, empty field)

set column with WebViewer to false