Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

Troubleshooting

Aarsh edited this page May 26, 2026 · 3 revisions

Troubleshooting

The errors you're most likely to hit, with the fix in each case.


Build / Gradle

JAVA_HOME is set to an invalid directory: C:\Program Files\Android\Android Studio\jbr

Your JAVA_HOME is pointing at an Android Studio JBR install that doesn't exist (typical on a fresh dev machine that's never had Studio installed).

# PowerShell — install OpenJDK 17 and point JAVA_HOME at it
winget install Microsoft.OpenJDK.17
$env:JAVA_HOME = "C:\Program Files\Microsoft\jdk-17.0.19.10-hotspot"

Or set it permanently via System Properties → Environment Variables.

File google-services.json is missing

Either you've never run ./retrieve_secrets.sh, or it failed silently. Run:

./retrieve_secrets.sh

…and confirm app/google-services.json now exists. If the script ran but the file is empty, jq is probably broken (see next).

jq outputs nothing, Cannot find module 'commander'

You have the npm package jq installed, which is a broken JS port. Replace it with the real binary:

npm uninstall -g jq               # remove the broken one
winget install jqlang.jq          # install the real binary
# new shell, or temporarily prepend to PATH:
export PATH="/c/Users/$USER/AppData/Local/Microsoft/WinGet/Links:$PATH"
jq --version                      # should show jq-1.8.x

Could not find com.google.android.gms:play-services-auth:21.0.0 or similar dep

Network issue or proxy. Try:

./gradlew --refresh-dependencies build

If you're behind a corporate proxy, configure it in ~/.gradle/gradle.properties.

Build was configured to prefer settings repositories over project repositories

You added a repositories { … } block inside a module's build.gradle.kts. settings.gradle.kts enforces FAIL_ON_PROJECT_REPOS — add the repo in settings.gradle.kts instead.

Build hangs on :app:lintVitalAnalyzeRelease

Lint vital is part of the release pipeline. If it's slow, it's analyzing your code (normal on cold cache). If it actually hangs, check the Gradle daemon: ./gradlew --stop then retry.

R8 strips Firestore model fields → MISSING_DOC_ID / fields are null at runtime

app/proguard-rules.pro should already preserve Subscription and PaymentRecord with -keep class … { *; }. If you add a new Firestore-mapped data class, add the same -keep rule. Symptom in production builds only — debug builds don't minify.


Auth / Sign-in

DEVELOPER_ERROR / ApiException: 10 immediately on Sign In

SHA-1 of your build's keystore isn't registered in Firebase for this app.

./gradlew :app:signingReport

Copy the SHA1 under Variant: debug (or your release variant). Firebase Console → Project settings → Your apps → (Android) com.hora.varisankya → Add fingerprint → paste → re-download google-services.json.

The registered fingerprints as of v3.8-beta.8 are listed in Firebase Setup.

NoCredentialException from Credential Manager

The device has no Google account, or the system picker timed out. Add a Google account on the device → retry. On certain emulator images (AOSP without Google APIs) Credential Manager will never succeed — use a Google APIs emulator image.

idToken is null after Credential Manager returns successfully

You're passing the wrong setServerClientId(...) — it must be the project's Web OAuth client ID (663138385072-bke7f5oflsl2cg0e5maks0ef3n6o113u.apps.googleusercontent.com), not an Android client.

Sign-out leaves the user signed in on next launch

MainActivity.performLogout does both auth.signOut() and credentialManager.clearCredentialState(...). If you copy the logout code to a new path, do both — Credential Manager caches the account separately from Firebase Auth.


Firestore

Permission denied on reads / writes

Rules aren't allowing the path. Check Logcat for the full PERMISSION_DENIED message — it'll quote the path. Then check firestore.rules and re-deploy with firebase deploy --only firestore:rules.

All Payments page loads, but is slow on the very first open

Lazy backfill is running (first-time-after-upgrade behaviour). Second visit and beyond reads from the flat collection in one round-trip. See Data Model & Migrations.

Flat-collection mirror failed warnings in Logcat

The flat-collection dual-write is being rejected — usually because rules haven't been re-deployed since the migration shipped. App still works correctly (legacy nested write is authoritative); All Payments just stays slow. Re-deploy rules.

Pending writes flag stays on metadata.hasPendingWrites

Network connectivity issue. The Firestore SDK queues writes locally and flushes when the device reconnects. App state remains consistent; the UI may briefly show stale data.


Notifications

No reminder notifications ever

First diagnostic step (since v3.8-beta.12): open Settings → Notifications → Send Test Notification. The button bypasses the worker entirely and posts a sample notification immediately. This narrows the problem decisively:

  • Test notification appears: the channel + permission + visibility chain on the device is healthy. The issue is on the scheduling side — WorkManager probably hasn't fired the worker yet, or battery optimisation is throttling it. Check the Firebase Analytics dashboard for notification_worker_run event counts to confirm. Whitelist the app from battery optimisation in OS settings.
  • Test notification doesn't appear: the device isn't delivering at all. Causes in priority order:
    • POST_NOTIFICATIONS permission isn't granted (Android 13+). Settings → Apps → Varisankya → Notifications.
    • The "Subscription Reminders" channel is disabled at the OS level. Settings → Apps → Varisankya → Notifications → Subscription Reminders.
    • Aggressive battery saver / Do Not Disturb is active.

Historical note: earlier betas used IMPORTANCE_LOW for the channel, which posted notifications silently with no sound or peek. Users could miss them entirely. Bumped to IMPORTANCE_DEFAULT in v3.8-beta.12 via a new channel id (subscription_reminders_v3 — Android caches per-channel importance, so the bump required a new id).

Notification fires but doesn't disappear after marking paid

This was the issue #7 bug — fixed in v3.8-beta.5. If you're on an older version, upgrade. If you're on beta.5+ and still seeing it, file a fresh issue with versionCode and steps.

"Mark Paid" action button on the notification opens the app instead of acting silently

You're tapping the body of the notification instead of the action. The action button is on the right side of the expanded notification.


UI / theming

Subscription list items look ungrouped (each card with its own outer corners)

The SubscriptionAdapter's singleShape/firstShape/middleShape/lastShape lookup needs the cached ShapeAppearanceModels to be built once. If you've touched that adapter, confirm the lookup-and-cache logic still runs on the first bind.

Hero card's amount text shrinks unexpectedly

Auto-size text scales between autoSizeMinTextSize and autoSizeMaxTextSize. For large amounts (multi-currency totals like ₹ 12,345,678), the auto-size will pick a smaller font to fit. Increase autoSizeMaxTextSize only if you're confident the layout has room.

Dark mode looks wrong after a theme change

AppCompatDelegate.setDefaultNightMode(...) should recreate activities automatically. If the change requires a restart (font toggle does), SettingsActivity already does this via finish() + startActivity(intent).


Studio quirks

"Module not specified" when trying to run

Gradle sync failed earlier. Open Build → Sync Project with Gradle Files; look at the Build Output panel for the underlying error.

Preview shows the wrong layout / outdated text

Studio caches tools:* preview attributes. Invalidate caches: File → Invalidate Caches….

"Unresolved reference: R" everywhere

You changed android.namespace or moved files between packages, then didn't sync. Build → Clean Project, then sync, then re-open.


Release / Publishing

:app:publishBundle fails with Service account credentials are invalid

app/play_console_key.json is missing or stale. Re-run ./retrieve_secrets.sh. Confirm the file exists and parses as JSON.

Play Console says "Version code already used"

versionCode must monotonically increase. Bump it in app/build.gradle.kts, re-build, retry.

Play Console rejects the AAB with policy violations

Read the Play Console message. Common ones: missing privacy policy URL, undeclared sensitive permission, broken target API requirement. Address in PRIVACY.md or AndroidManifest.xml as appropriate.


Still stuck?

  • Check Known Issues — your problem may be a known rough edge.
  • File a GitHub issue with versionCode, device + Android version, and reproduction steps.

Clone this wiki locally