Troubleshooting
common problems and fixes.
Real cases from the code and the build, with what to check.
01iPhone: the Night Strip stays empty
The strip only fills from real events. On iOS they come from the Shortcuts automations. Open Settings, Setup Doctor: until automations A (plugged in) and B (unplugged) have each arrived once, the strip stays empty. Check they use Run Immediately, the phone runs iOS 17.2 or newer, and do one real plug-in and unplug. See iOS Shortcuts.
02Shortcuts does not list "Log Charge Event"
Open the app once after installing it so iOS indexes its actions, and check the iOS version is 17.2 or newer. A build from an old Xcode may not include the App Intents metadata; rebuild with a current Xcode.
03iPhone: events appear without a percent
When iOS gives no battery reading to a background action the level is -1 and only the event is logged. This is an iOS behaviour, not a bug in your build.
04Android: charges are missing or late
Allow the app to run in the background (battery set to Unrestricted, autostart on makers that have it). Android only delivers some power broadcasts to apps in the background in limited ways, so the 15-minute check fills gaps and tags them android_worker. Some makers stop background work completely. See Phone makers.
05Android: the target alert comes late or not at all
Android 12+ may refuse to start the foreground service from the background; the app then relies on the 15-minute check. Also check notifications are allowed (Android 13+ asks). If the phone has a charge limit below your target, the target is never reached.
06The paywall says purchases are not set up
No product id is set for this platform. Fill the ids in brand.dart or the console (Where to put the ids). Ids must match App Store Connect and Play Console exactly.
07Products are set but the store returns nothing
iOS: the Paid Apps agreement and tax forms must be complete and the product ready to submit. Android: the app must be installed from a Play test track (not a sideloaded APK) by a licence tester, and the product and base plan must be active. Wait some hours after creating products.
08Pro unlocks and then locks again
A yearly subscription is trusted for 35 days after the last store confirmation and re-checked after 7 days. If the subscription has ended or was refunded, Pro locks. Ask the user to tap Restore purchases.
09Purchase verification answers 501
501 verification_off means verification is not switched on in the console, so the app trusts the on-device result. Turn it on under Purchases and fill in the credentials.
10Google Play verification fails with a permission error
The service account must be invited in Play Console with View app information and View financial data, and the Android Publisher API must be enabled in the Google Cloud project. New permissions can take some time to apply. Use Test connection in the console.
11App Store lookup fails
Check the bundle id, Key ID, Issuer ID, and that the .p8 text was pasted whole including its BEGIN and END lines. The server tries Production, then Sandbox.
12I cannot find the console setup code
It is printed in the server log at start when ADMIN_SETUP_TOKEN is empty. In Docker run docker logs. Or set ADMIN_SETUP_TOKEN in .env and restart.
13npm ci fails or better-sqlite3 will not load
Use Node 22.12 or newer (node -v). better-sqlite3 is a native module: if no prebuilt file exists for your system, you need build tools (Python 3, make, a C++ compiler). Delete node_modules and run npm ci again after changing Node versions.
14429 errors, or everyone shares one address
/v1 routes allow 60 requests a minute per address. Behind a proxy set TRUST_PROXY_HOPS=1, otherwise all users look like the proxy's address.
15A console change does not appear in the app
The config is cached for 5 minutes and by ETag. Wait, then reopen the app. Check the app was built with API_BASE_URL and that the address is https and reachable from the phone.
16Play rejects the upload or says the app is debug-signed
As shipped, release builds use the debug key. Add your own signing config (Release).
17Xcode says signing failed or the bundle id is not available
The project ships with the author's team id and bundle id. Choose your own team and a bundle id you own (Rename).
18Simulator build fails with a Flutter.framework architecture error
Seen by the author with Xcode 27: flutter build ios --simulator failed. Use a real device, or update Flutter and Xcode. flutter build ios --no-codesign works.