davidhealey / waistline

Libre calorie counter app for Android. Built with Cordova.
577 stars 69 forks source link

App opens to white screen (Unable to open asset URL) #293

Closed thgoebel closed 3 years ago

thgoebel commented 3 years ago

Steps to reproduce

  1. Clean install Waistline
  2. Open app

Actual behaviour

Splash screen with logo and circular progress indicator appears. Then a white screen.

Expected behaviour

Index page shows after splash screen.

Log

08-14 11:08:19.223  4212  4276 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
08-14 11:08:19.223  4212  4284 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-camera/www/CameraConstants.js
08-14 11:08:19.223  4212  4276 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-camera/www/Camera.js
08-14 11:08:19.224  4212  4273 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/DirectoryEntry.js
08-14 11:08:19.225  4212  4284 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js
08-14 11:08:19.225  4212  4276 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/DirectoryReader.js
08-14 11:08:19.225  4212  4284 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/Entry.js
08-14 11:08:19.227  4212  4301 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/File.js
08-14 11:08:19.227  4212  4283 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/FileEntry.js
08-14 11:08:19.228  4212  4301 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/FileError.js
08-14 11:08:19.228  4212  4301 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/FileReader.js
08-14 11:08:19.229  4212  4284 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/FileSystem.js
08-14 11:08:19.230  4212  4284 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/FileUploadOptions.js
08-14 11:08:19.230  4212  4301 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/FileUploadResult.js
08-14 11:08:19.231  4212  4284 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/FileWriter.js
08-14 11:08:19.231  4212  4284 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/Flags.js
08-14 11:08:19.231  4212  4301 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/LocalFileSystem.js
08-14 11:08:19.232  4212  4284 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/Metadata.js
08-14 11:08:19.234  4212  4301 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/ProgressEvent.js
08-14 11:08:19.234  4212  4301 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/fileSystems.js
08-14 11:08:19.235  4212  4301 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
08-14 11:08:19.235  4212  4273 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/requestFileSystem.js
08-14 11:08:19.235  4212  4301 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/browser/isChrome.js
08-14 11:08:19.235  4212  4273 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/android/FileSystem.js
08-14 11:08:19.237  4212  4283 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/fileSystems-roots.js
08-14 11:08:19.238  4212  4283 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-file/www/fileSystemPaths.js
08-14 11:08:19.239  4212  4284 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-network-information/www/network.js
08-14 11:08:19.240  4212  4283 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-splashscreen/www/splashscreen.js
08-14 11:08:19.240  4212  4284 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-network-information/www/Connection.js
08-14 11:08:19.241  4212  4284 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/phonegap-plugin-barcodescanner/www/barcodescanner.js
08-14 11:08:19.242  4212  4284 E AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/plugins/cordova-plugin-device/www/device.js
08-14 11:08:19.256  4212  4212 I chromium: [INFO:CONSOLE(1327)] "Uncaught Error: Module cordova-plugin-camera.Camera does not exist.", source: file:///android_asset/www/cordova.js (1327)
08-14 11:08:19.257  4212  4212 D CordovaWebViewImpl: onPageFinished(file:///android_asset/www/index.html)
08-14 11:08:19.257  4212  4212 D PluginManager: postMessage: onPageFinished

Metadata

txominik commented 3 years ago

Same behavior on /e/OS 0.17-20210531117530 (Android 8.1.0) after an app update from 2.something (I didn't write this down) to version 3.0.2.

AdrienDSlone commented 3 years ago

Same as above. Clean install from Fdroid, also tried from Github apk. But after the logo screen, both app splashes whitescreen.

I am on Redmin Note 7 + Android 10 QKQ1 .190910.002 + MIUI Global 12.5.1 Stable

I am really happy that 3.X released :D Thanks !

davidhealey commented 3 years ago

@AdrienDSlone Did you have the issue with any other versions?

AdrienDSlone commented 3 years ago

I unstalled 3.0.2 and installed 2.4.2 from F-droid the one I used to use within years :). The 2.4.2 works and prints the user guide when I launch it then I can reach everything.

AdrienDSlone commented 3 years ago

Oh wait, the 3.0.1 works on my phone. Seems something change in 3.0.2

davidhealey commented 3 years ago

Seems something change in 3.0.2

This was the github apk?

AdrienDSlone commented 3 years ago

Seems something change in 3.0.2

This was the github apk?

Yes it is. Nice update UI and things btw

txominik commented 3 years ago

Yes, I also use the F-Droid version.

davidhealey commented 3 years ago

Yes, I also use the F-Droid version.

Can you try the version from github?

txominik commented 3 years ago

Yes, I also use the F-Droid version.

Can you try the version from github?

I just tried to install the github version over the one installed through F-Droid, that didn't work. But a fresh install works. The importer also does something, but since it's one year+ worth of data I'll give it another minute or two. I'll keep you posted.

davidhealey commented 3 years ago

since it's one year+ worth of data

I hope you have a backup!

I'll give it another minute or two

It can sometimes take a little while but I've had occassions where it hangs. Closing and reopening seemed to solve the issue.

txominik commented 3 years ago

since it's one year+ worth of data

I hope you have a backup!

I do.

I'll give it another minute or two

It can sometimes take a little while but I've had occassions where it hangs. Closing and reopening seemed to solve the issue.

I just closed and reopened, there seems to be no data. Trying the import again yields the same result (the app seems to hang). But nevermind, I'll just input a few things and compare the export with the old export and adjust the format of my backup file.

Thanks a lot.

davidhealey commented 3 years ago

Trying the import again yields the same result (the app seems to hang).

If you can send me your json file I can try on my system and see if there are any errors.

thgoebel commented 3 years ago

FWIW here's the diffoscope between the Github APK (wallet-release.apk) and the one from F-Droid (com.waist.line_30002.apk). It just confirms that the plugin file are missing in the F-Droid build. Now the questions is: why? diffoscope-waistline-3.0.2.txt

txominik commented 3 years ago

Trying the import again yields the same result (the app seems to hang).

If you can send me your json file I can try on my system and see if there are any errors.

Thanks for the offer! Maybe later, right now I have to run some errands.

Is the encoding of special characters in titles etc. UTF-8 now? Because I have many entries using ISO-8859-1 characters (invalid UTF-8, that is).

davidhealey commented 3 years ago

Is the encoding of special characters in titles etc. UTF-8 now?

Yes

AdrienDSlone commented 3 years ago

Same as above. Clean install from Fdroid, also tried from Github apk. But after the logo screen, both app splashes whitescreen.

I am on Redmin Note 7 + Android 10 QKQ1 .190910.002 + MIUI Global 12.5.1 Stable

I am really happy that 3.X released :D Thanks !

I rechecked, I was wrong, apk 3.0.2 from Github works too on my phone. My bad

davidhealey commented 3 years ago

I was wrong, apk 3.0.2 from Github works to on my phone. My bad

Thanks. I think that, and @thgoebel's finding confirms it, this is an f-droid issue.

pablob127 commented 3 years ago

I tried to upgrade from F-Droid and got bit by this. I could not downgrade (it failed with an "unknown error") so I had to uninstall to go back to the older version. But even though I did a data export, I think the data backup was lost when I uninstalled the ap, as the re-installed app doesn't offer me to import data. Is there any chance I could recover the data somehow? I had several months of data there.... My phone is not currently rooted, so a backup to a private area is as good as no backup. Could a backup be done to somewhere readable by other apps?

davidhealey commented 3 years ago

Is there any chance I could recover the data somehow?

I think it's lost unfortunately. The only place the file will be is inside the data folder.

Could a backup be done to somewhere readable by other apps?

I'd like to but there are issues with the whole file system API. I've looked for alternatives but so far haven't found a solution that works.

HelpfulCarrot commented 3 years ago

I tried to upgrade from F-Droid and got bit by this. I could not downgrade (it failed with an "unknown error") so I had to uninstall to go back to the older version.

I'm having the same issue when I try to downgrade using F-Droid (because I upgraded to 3.0.2 in F-Droid this morning and am having the white screen on launch issue). Additionally, when I try to install an APK from GitHub over the 3.0.2 F-Droid version that I upgraded to this morning, it fails with the error message 'App not installed.' I've tried this with three different APK releases on GitHub. In my experience F-Droid takes a while to update its packages, and in the meantime I have to choose between losing almost a year of data or being without this app for however long it takes F-Droid to update their package.

(I'm assuming that I'll be able to install the next version via F-Droid even though I'm not able to downgrade using F-Droid, but maybe this is an unreasonable assumption - maybe I'll have to do a clean install?)

Anyway, I'm wondering if you (davidhealey) could perhaps provide instructions on how to add a custom repository to F-Droid using the working GitHub APK file so that we could try installing that without needing to uninstall and lose our data? My apologies if this isn't a useful suggestion, I figured it was worth suggesting but I'm not sure if it's helpful.

I should also note that I've been using Waistline for more than a year and I've found it to be an excellent app, and I'm very excited to see what 3.xx brings! Thank you, Mr. Healey, for all your excellent work on this FOSS project. :)

davidhealey commented 3 years ago

how to add a custom repository to F-Droid using the working GitHub APK

You can't as far as I know. F-Droid works by building the application directly from the source code and code-signing it themselves, this assures users that the code meets all of their ethical commitments.

When I upload an APK to github or Google Play I sign it using my signing key. Because my key and f-droid key are not the same it makes the two version incompatible when it comes to updating.

Are you unable to access the waistline data folder? android/data/com.waist.line

HelpfulCarrot commented 3 years ago

how to add a custom repository to F-Droid using the working GitHub APK

You can't as far as I know. F-Droid works by building the application directly from the source code and code-signing it themselves, this assures users that the code meets all of their ethical commitments.

When I upload an APK to github or Google Play I sign it using my signing key. Because my key and f-droid key are not the same it makes the two version incompatible when it comes to updating.

Are you unable to access the waistline data folder? android/data/com.waist.line

Regarding custom repositories, I know NewPipe does it with F-Droid. See here: https://newpipe.net/FAQ/tutorials/install-add-fdroid-repo/

As for android/data/com.waist.line, that's the first place I went (using the file browser called Dir, my phone isn't rooted, Android version 9) after realizing there was a problem with the latest F-Droid build and I couldn't download, but within that directory there are only two visible subdirectories, and neither seem to contain my data: the 'cache' subdirectory contains pictures of foods I've uploaded to Open Food Facts, and the 'files' subdirectory contains waistline_export.json which was last modified on 9/14/2020. I opened that file with a text editor and it doesn't seem to contain any recent data. There doesn't appear to be any more recent data than that, perhaps because I haven't run a backup/export from Waistline in a very long time (I can't even remember if there's such a feature, tbh, although I bet there is.)

davidhealey commented 3 years ago

Regarding custom repositories, I know NewPipe does it with F-Droid.

Interesting!

I haven't run a backup/export from Waistline in a very long time

That's the problem. Always backup before installing new versions. The latest version has an auto-backup feature too that writes a new backup file each time the app is opened.

HelpfulCarrot commented 3 years ago

That's the problem. Always backup before installing new versions. The latest version has an auto-backup feature too that writes a new backup file each time the app is opened.

Yeah, I'm going to try to get in the habit of that! :) There hasn't been a new version on F-Droid for so long, I was excited to install it and skipped that step. But I'm hoping that if I'm able to install another package without uninstalling the current one first, my data will still be there, hence my hope that there might be a way to push an installable version to F-Droid via a custom repository, or perhaps if there were some way for you to create a hotfixed APK that I could download and install from GitHub which wouldn't throw the error message 'App not installed.' But I'm a bit out of my depth here, I'm really more of a PC guy than an Android guy.

davidhealey commented 3 years ago

I've just pushed a new release, but you won't be able to install this over an f-droid installation because of the different signing keys.

If you use chrome on your PC you can connect your phone to your computer and go to chrome://inspect/ open Waistline and see if you get any errors in the console. You should also be able to see if your data is still there under the Application tab >> IndexedDB (there might even be a way to export from here but I'm not sure).

HelpfulCarrot commented 3 years ago

Oh, I just went back and re-read what you wrote regarding the different keys making things incompatible in terms of updating. I'm not sure if a custom repo for F-Droid would fix that, but I'm guessing not. So now I suppose I'm just wondering if you have any idea why I'm not able to downgrade within F-Droid, and if I'll be able to update to the next version that F-Droid builds without uninstalling the current version first. I'm thinking that perhaps the cause of the inability to downgrade is that the previous versions are in the F-Droid Archive repo whereas the new version is in the main F-Droid repo, but I'm not even sure if that's correct.

HelpfulCarrot commented 3 years ago

Thanks, I'll check out the chrome stuff!

davidhealey commented 3 years ago

if you have any idea why I'm not able to downgrade within F-Droid

Google changed the required format of the signing keys between version 2.x and 3.x so it could be that there is an incompatibility there. Or that might just be a requirement for the Play store.

HelpfulCarrot commented 3 years ago

I'm not having any luck with Chrome (I'm sure I'm doing something wrong, but nothing appears on the console or in IndexedDB), but that's okay, I don't expect you to help me any more than you already have - I'll just wait for F-Droid to push the next version, whenever that happens. In the meantime I'll write things down the old-fashioned way. Hopefully F-Droid will update to the new version within a week or so and it'll let me install the update, and that would be great! If not, I guess I'll just have to live with losing that data, and do a clean install of the new version. In any case, thanks so much for your hard work on the app and your assistance today! :)

nm17 commented 3 years ago

Any ETA for this?

davidhealey commented 3 years ago

Any ETA for this?

Seems to be a problem with F-Droid's build process so I don't know if there's anything I can do.

HelpfulCarrot commented 3 years ago

Any ETA for this?

Seems to be a problem with F-Droid's build process so I don't know if there's anything I can do.

Am I correct in understanding that you mean all future versions on F-Droid are likely to be broken? If this is the case, perhaps the best thing to do would be to remove Waistline from F-Droid, as unfortunate as this would be.

More immediately relevant, would you recommend that users encountering this bug uninstall the F-Droid build and reinstall through GitHub or the Play Store even though this involves losing all data that hasn't been backed up, since (if I understand you correctly) you don't foresee a better solution? That's fine, but it would be nice to know your official recommendation based on your feelings of the likelihood of a fixed build with the F-Droid signature. :)

davidhealey commented 3 years ago

@HelpfulCarrot I don't see any reason why a future release won't work - I don't see any reason why the current release doesn't work either! If you can get in touch with f-droid and ask them what they need from me (if anything) to get it working and let me know that would be very helpful.

undefiened commented 3 years ago

Are you sure the current build didn't work? It looks to me F-Droid did build it, see https://monitor.f-droid.org/builds/log/com.waist.line/30100 and https://monitor.f-droid.org/builds/log/com.waist.line/30101 There are 4 errors in the log, but I think the build was successful overall. I think they just haven't deployed the updated version yet as they are still building new versions of other apps.

But I might be wrong as I don't know how critical these 4 errors are, I apologize if this is the case.

davidhealey commented 3 years ago

Are you sure the current build didn't work? It looks to me F-Droid did build it, see https://monitor.f-droid.org/builds/log/com.waist.line/30100 and https://monitor.f-droid.org/builds/log/com.waist.line/30101 There are 4 errors in the log, but I think the build was successful overall. I think they just haven't deployed the updated version yet as they are still building new versions of other apps.

But I might be wrong as I don't know how critical these 4 errors are, I apologize if this is the case.

The OP posted a log when the app is running and it shows the camera plugin is missing - 08-14 11:08:19.256 4212 4212 I chromium: [INFO:CONSOLE(1327)] "Uncaught Error: Module cordova-plugin-camera.Camera does not exist."

HelpfulCarrot commented 3 years ago

@HelpfulCarrot I don't see any reason why a future release won't work - I don't see any reason why the current release doesn't work either! If you can get in touch with f-droid and ask them what they need from me (if anything) to get it working and let me know that would be very helpful.

I'd be happy to do what I can to help! I'll try to contact them as soon as I have time. It seems like posting on the F-Droid support forum is the best way to go, so I'll do that. :)

HelpfulCarrot commented 3 years ago

Are you sure the current build didn't work? It looks to me F-Droid did build it, see https://monitor.f-droid.org/builds/log/com.waist.line/30100 and https://monitor.f-droid.org/builds/log/com.waist.line/30101 There are 4 errors in the log, but I think the build was successful overall. I think they just haven't deployed the updated version yet as they are still building new versions of other apps. But I might be wrong as I don't know how critical these 4 errors are, I apologize if this is the case.

The OP posted a log when the app is running and it shows the camera plugin is missing - 08-14 11:08:19.256 4212 4212 I chromium: [INFO:CONSOLE(1327)] "Uncaught Error: Module cordova-plugin-camera.Camera does not exist."

Do the messages for the 4 errors give any indication whatsoever as to whether or not the errors are significant? I don't see any mention of the keyword 'camera' in the error log, but I don't have a clue how to interpret it, really.

davidhealey commented 3 years ago

@HelpfulCarrot No, those errors don't mean anything to me.

m0ppers commented 3 years ago

finally they picked up a newer version. I could upgrade to 3.1.1 using fdroid but the error is still the same :( white screen

undefiened commented 3 years ago

Just letting know that I have tried reproducing the problem with building using their docker image, but failed miserably so far as their docker image doesn't seem to reproduce the same build results as the official server (https://gitlab.com/fdroid/docker-executable-fdroidserver/-/issues/12) :(

Darkproduct commented 3 years ago

Having the same problem.

Google Pixel 3 XL with Android 11

It looks like I'll be waiting for a new F-Droid release as well.

davidhealey commented 3 years ago

Maybe they need me to upload the platform plugins directory, I'll try that and see if the next build they make works, I'll bump the version number to trigger a new build.

davidhealey commented 3 years ago

Let's wait and see - https://github.com/davidhealey/waistline/releases/tag/3.1.2

HelpfulCarrot commented 3 years ago

Apologies for not getting to this sooner, I had to undergo a medical procedure on Friday and wanted to wait until I was a bit less out of it. Fentanyl was quite the wild ride, I don't look forward to being on that again!

Anyway, I reached out via the F-Droid forums. https://forum.f-droid.org/t/error-in-building-compiling-f-droid-build-of-the-app-waistline/14752?u=helpfulcarrot

I hope this is at least slightly helpful!

HelpfulCarrot commented 3 years ago

Also, I tagged @eighthave in the F-Droid forums - since he seems to be one of the driving forces behind F-Droid, I thought he might be interested in a possible issue with the compiler / build process.

linsui commented 3 years ago

I change the build block a little to make it builds in https://gitlab.com/fdroid/fdroiddata/-/commit/39bd283300f87fcbda3aa2485384736919ec178b#14fd17b1fe4b68da9bae6d17d4a004c59aa95141_362_341 because BarcodeScanner@2.1.5 can't be built with our setup. But I guess that's not the reason. I thought davidhealey is correct. We build this app with gradle only so platform files need to be in the repo. This works before version 3. Or we can generate those file when we build it if that's better.

Caeglathatur commented 3 years ago

@HelpfulCarrot For what it's worth, it seems I found the F-Droid-signed v2.4.2 apk, if you want to attempt a downgrade. I just get an "App not installed" error though. https://archive.org/details/com.waist.line_20402

I'm in a similar predicament as you. 4 months of data, no backup (monkey brain press shiny update button), borked F-Droid release, no way to downgrade or change release without uninstalling and losing all data. Based on the existing releases on the F-Droid page, I predict that the hopefully fixed version 3.1.2 will be available on F-Droid on Saturday. Gonna use a spreadsheet until then, I guess :P

HelpfulCarrot commented 3 years ago

@HelpfulCarrot For what it's worth, it seems I found the F-Droid-signed v2.4.2 apk, if you want to attempt a downgrade. I just get an "App not installed" error though. https://archive.org/details/com.waist.line_20402

Thanks for the tip! Unfortunately, I get the same error message.

mrhebisan commented 3 years ago

Downgrading apps via the UI on Android without first uninstalling isn't allowed so its not a surprise that people are running into this problem when trying to return to a working version. The OS just has a really poor error message that doesn't explain why the downgrade fails.

I'd recommend doing what NewPipe does so that you can better guarantee a working application. It won't help current users whose data is lost but it will help avoid these situations going forward