M-CAP7AIN Member Apr 6, 2021 #1 B4A version 10.70 when compiled project in Release , webview load file problem : B4X: WV.LoadUrl("file:///android_asset/asset/"&FILE_NAME) The webpage at file:///android_asset/asset/file.html could not be loaded because: net::ERR_FILE_NOT_FOUND Click to expand... but B4A version 10.20 work correctly.
B4A version 10.70 when compiled project in Release , webview load file problem : B4X: WV.LoadUrl("file:///android_asset/asset/"&FILE_NAME) The webpage at file:///android_asset/asset/file.html could not be loaded because: net::ERR_FILE_NOT_FOUND Click to expand... but B4A version 10.20 work correctly.
Peter Simpson Expert Licensed User Longtime User Apr 6, 2021 #2 Have you tried using something like this (From memory and NOT tested) XUI.FileUri(Dir, FileName)??? B4X: WV.LoadUrl (XUI.FileUri(Dir, FileName)) Please note that I could be completely wrong with this answer, but it seems to ring a bell with me.
Have you tried using something like this (From memory and NOT tested) XUI.FileUri(Dir, FileName)??? B4X: WV.LoadUrl (XUI.FileUri(Dir, FileName)) Please note that I could be completely wrong with this answer, but it seems to ring a bell with me.
Erel B4X founder Staff member Licensed User Longtime User Apr 7, 2021 #3 It is related to the way the underlying packaging tool handles sub folders inside the assets folder. This will work in release mode: B4X: WV.LoadUrl(XUI.FileURI(File.DirAssets, "asset\"&FILE_NAME)) If the html file references other files then the references will need to be updated. Best solution is to flatten the folders and put the files in the Files tab directly. Last edited: Jul 18, 2021
It is related to the way the underlying packaging tool handles sub folders inside the assets folder. This will work in release mode: B4X: WV.LoadUrl(XUI.FileURI(File.DirAssets, "asset\"&FILE_NAME)) If the html file references other files then the references will need to be updated. Best solution is to flatten the folders and put the files in the Files tab directly.
M-CAP7AIN Member Apr 7, 2021 #4 i tested different methods. need urlEncode with %5C -> \ Click to expand... B4X: WV.LoadUrl(XUI.FileURI(File.DirAssets, asset\"&FILE_NAME)) The html file was loaded but the resources in the file were not loaded.
i tested different methods. need urlEncode with %5C -> \ Click to expand... B4X: WV.LoadUrl(XUI.FileURI(File.DirAssets, asset\"&FILE_NAME)) The html file was loaded but the resources in the file were not loaded.
Erel B4X founder Staff member Licensed User Longtime User Apr 7, 2021 #5 Best solution is to flatten the folders and put the files in the Files tab directly.