Webviewer automatic crash 2

WEBVIEWER UPDATE PROBLEMS 2, Automatic Crash (HTML/JS) and Connection refused errors...

I have a completely new problem with the new linking method from the new update... if you have something a little bit more complicated than a "hello world" HTML the app will crash on you like 1986 challenger space rocket...what the heck is going on?

In the example i have 2 buttons ... in one i load a "hello world html - > hello2.HTML "...that loads fine, but when i load my "second HTML -> index.HTML" it will try to load the html and the js, but it will 100% froze on you like Dicaprio on TITANIC and crash... while loading a 3kb HTML.

Since some of you are talking about emulators and companion in WEBVIEWER UPDATE 1 i opened a new topic to talk about this nasty crash.

I just want to know whats going on.

testwvr.aia (6.8 KB)

I think local host is only accessible from laptop/PC.

Check out the new MIT APP inventor update :

Implement a universal URL format for assets in WebViewer (# 2272)

Use file: /// appinventor_asset / or http: // localhost / to access your assets in a companion / build agnostic way.

i would like to know why its crashing...

if I use : file:///android_asset/index.html it works and loads fine but it crashes my app with http://localhost/index.html

Its the javascript thats causing the problem, but i dont know why, if i take out the (.JS file) it wont crash, but if i have the javascript file in the asset folder and load the html it crashes all the time...

It is not exactly "simple javascript".....this may be the issue that the webview cannot handle some of the features in your script.

but if it loads fine with ... file:///android_asset/index.html
the webviewer is not the problem, right?

Why with one method the webviewer handles it and with the other method it crashes?

In which case you at least have a workaround (using the previous "urls") until the matter is resolved

You can use the pathToAssets block from Taifun's Tools extension to simplify things.

I use the webviewer to load all my content, i load index.html and from there i navigate and open other htmls and javascript files ... I do apps that way, i dont use extensions.

If the MIT team can look into it i would be great, the only thing i can do is tell you guys about this, until it is resolved i guess i have to keep using the old method ...file:///android_asset/index.html

Until it stops working...will it stop working?

Hello guys, im back here again, look... here is my new .JS file, take a look at the project please... if you guys think this is complicated i dont know what to think...

in index.js we have -->

function msg(){
alert("Hello world");
}

and in the index.html we have --> 240 bytes...the structure of HTML.
and it crashes the app 100% with the new linking method from the update, common guys...

its the same problem, if it loads just a single byte of javascript it crashes.

testwvr.aia (3.8 KB)

It will fail in all your devices and emulators.

This worked fine on my Android 10 device. After some further experimentation it does seem that some versions of Android lack the appropriate file name mapping for MIME types, such that they don't recognize a .js file as application/javascript. This results in a null pointer exception in our code when it happens. I've submitted a patch for review to fix it.