WebViewer issue

I am wondering why the WebViewer works in my test app but not in my production app.
The test app is however tested in ai2.appinventor.mit.edu (=production env) with AI Companion, as the production app is tested in ai2-test.appinventor.mit.edu (=test env) by generating and downloading apk file (this is due to some functionality reasons because some components do not work in another env).

I am using TaifunTools.PathToAssets in both env, so should I refer to them differently in different environments?

From the pictures attached you can see that in test env the WebViewer lists nicely, but in production env there is only a part of the “Pura Vida Apps” logo visualized and nothing else.

There are not any overlapping fields either.
Suspecting that something to do with TaifunTools and/or the table.html which is loaded from there.



did you upload the html file as asset in the Media section of the designer?
media
Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

Hmm,

no I did not upload it.
So you mean that HTML/JavaScript listed on the https://puravidaapps.com/table.php page?
Sorry I am so beginner still…

then please upload it
without that html file obviously it will not work

Taifun

Hm,

that did not solve the problem.

Which one of the three “set WebViewer => HomeUrl” options below should I actually use?

kuva

Continuation to previous:

is this how it should go?

–clip–
There is one special thing to consider for HTML documents uploaded as assets into App Inventor: During development, you have to use the development path to the embedded HTML document.

file:///mnt/sdcard/AppInventor/assets/.html

Before building the app, use the production path .

file:///android_asset/.html
–clap–

the first one, which provides the second option in case you are using the companion and provides the third option after building the app

yes exactly, and the PathToAssets method will simplify this, taken from the documentation here App Inventor Extensions: Tools | Pura Vida Apps

Returns the path to the assets. This method is useful, if you want to access files from the webviewer component stored in the assets of the app. The method will return file:///android_asset/ in case the app is running after building the app as apk file and will return file:///mnt/sdcard/AppInventor/assets/ in case the app is running inside the companion app (development mode).

Taifun

Thx Taifun for the perfect clarification :slight_smile:

Actually the issue was not there however; I noticed that the WebViewer component was inside a HorizontalArrangement that had configured as fixed length. Changing the length as automatic (and also long enough) and the WebViewer component to fill the parent, now everything works!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.