Crashalytics issue fixing

XMLWordPrintable

    • Type: Bug
    • Resolution: Done
    • Priority: Low
    • 2.13
    • Affects Version/s: 2.13
    • None
    • FLW Sprint 53
    • FLW Mobile App
    • Prod

      DayPickerView.onLayout
      Closed on Sep 28, 2026
      java.lang.NullPointerException - Attempt to invoke virtual method 'int android.widget.SimpleMonthView.getMonthHeight()' on a null object reference
      android.widget
      DayPickerView.java:228

      Cause
      1. The calendar in DatePickerDialog counts how many month pages to show from the min and max dates: (max year − min year) × 12 + (max month − min month) + 1.
      2. If the min date is in a later month than the max date, that count is 0 or less, so no month pages are created.
      3. When the dialog is laid out, DayPickerView.onLayout() asks for the first page, gets null, and calls getMonthHeight() on it. That is the NPE in your trace.
      Sol:-- Set max date first

      ==============================================
      RoomDbEncryptionHelper.ensureSqlCipherLoaded

      Causes :-due sharing apk through file storage

      solution:-Fix the issue with

      ==============================================
      AccountDeactivationInterceptor.intercept (UnknownHostException / SocketTimeoutException / ConnectException) — Niramay, Mitanin
      Cause:- The interceptor is only the first app frame in the trace. The real crash is a network error (offline, DNS failure, timeout) thrown by a Retrofit call made from a screen with no
      error handling:
      1. Maa Meeting form: saving ran upload + download sync immediately after the local save, with no try/catch, so saving while offline crashed the app.
      2. BenRepo.verifyOtp: the OTP verify call had no try/catch (sendOtp/resendOtp already had one).
      3. On 2.9.0 the getUserDetail call on the home screen (already fixed in #477).
      Sol:- Wrapped the sync after a Maa Meeting save in try/catch (the record is already saved locally; MaaMeetingsPushWorker uploads it later). Wrapped verifyOtp in try/catch so it returns
      "not verified" instead of crashing. Commit 91da0b4dd
      ==============================================
      AllHouseholdFragment - Navigation action_allHouseholdFragment_to_newHouseholdFragment cannot be found
      Cause:- Double tap on "New Household" posted the navigate event twice; the second one fired after the app had already moved to the New Household screen.
      Sol:- Reset the navigate flag before navigating and used safeNavigate (drops the request if the action is no longer valid). Commit 01d552050
      ==============================================
      Icon-grid menus (HRP Cases, Mother Care, Disease Control, Malaria, Child Care, NCD, CD, Leprosy, EC, Death Reports, VLF, Immunization) - Navigation action cannot be found from current
      destination
      Cause:- All icon-grid menus used findNavController().navigate(); a second queued tap ran after the first navigation.
      Sol:- All 15 icon-grid menus now use safeNavigate. Commit def1cd62b
      ==============================================
      List screens and dialogs (Household Members, Child Month List, Infant List, Infant Day List, UWin List, New Household "Add Head of Family" dialog, Incentives) - Navigation action cannot
      be found
      Cause:- Same double-tap problem in list item clicks and dialog buttons.
      Sol:- Switched these to NavController.safeNavigate. A normal tap behaves exactly as before. Commit 0bb2ed2b4
      ==============================================
      BlockEditText$LengthFilter.filter - IndexOutOfBoundsException: setSpan (4 ... 4) ends beyond length 3 (Aadhaar input)
      Cause:- When pasted/autofilled digits overflowed one block, the extra digits were inserted into the next block, whose own filter can drop/move characters, so the cursor position was set
      past the block's real length.
      Sol:- Cursor position is now limited to the block's actual text length. Commit 3202b8570
      ==============================================
      BlockEditText.onTextChanged - IndexOutOfBoundsException in TextView.bringPointIntoView (Aadhaar input)
      Cause:- Focus was moved to the next/previous block inside onTextChanged, while the current field's layout still had the old text.
      Sol:- The focus change is posted so it happens after the current edit finishes. Commit f95005b42
      ==============================================
      NewChildBenRegDataset.setUpPage - ArrayIndexOutOfBoundsException: length=9; index=9
      Cause:- The child registration form has only 9 child slots, but mothers with more than 9 registered children were pre-filled for every child.
      Sol:- Pre-fill is limited to the 9 available slots. Commit fa813ccc5
      ==============================================
      ApiAnalyticsInterceptor.intercept - OutOfMemoryError (~180 MB)
      Cause:- OkHttp BODY logging (kept in release for the sync log) copied the whole request body into memory; a large couple/register/saveAll upload used up all the memory.
      Sol:- Added BodyCappedLoggingInterceptor: bodies up to 1 MB are still logged, larger requests are logged as headers only. (Separate follow-up: that saveAll gets HTTP 413 and needs
      chunking.) Commit dd53b745d
      ==============================================
      Hilt_CbacFragment.onGetLayoutInflater - Fragment not attached to FragmentManager
      Cause:- The CBAC referral dialog's "Yes" button could be tapped after the CBAC screen was closed.
      Sol:- The click is ignored when the fragment is not attached, and the dialog is dismissed in onDestroyView. Commit 6210aa7cb
      ==============================================
      EcrDao_Impl.upsert - SQLiteConstraintException: FOREIGN KEY constraint failed
      Cause:- While a child was being added, the sync worker replaced the mother's temporary benId with the server id. The EC record upsert then referenced the old id and failed the foreign
      key. NewBenRegViewModel.saveForm only caught IllegalAccessError, so it crashed.
      Sol:- The FK failure on that step is non-fatal (the child is already saved), and saveForm now catches Exception and shows "save failed" instead of crashing. Also covers the
      BenRegFormDataset.mapValues NPE (DOB missing at save). Commit cbfd0014b
      ==============================================
      HomeActivity/LoginActivity.onCreate - NoSuchMethodException: EcFilterBottomSheetFragment / LanguageBottomSheet.<init>()
      Cause:- When Android restores the app after killing it in the background, it re-creates open bottom sheets using a no-argument constructor; these sheets only had a (value, callback)
      constructor.
      Sol:- Gave the constructor parameters default values (so a no-arg constructor exists), and a sheet re-created without its callback closes itself. Commit b25b2f0a4
      ==============================================
      EnableDevModeBottomSheetFragment - NumberFormatException: For input string: ""
      Cause:- The PIN was parsed with toInt() and crashed on empty input.
      Sol:- Uses toIntOrNull(); empty or invalid input shows "Invalid PIN!". Commit 84f0b7b70
      ==============================================
      NewHouseholdFragment / NewBenRegFragment mic - ActivityNotFoundException: RECOGNIZE_SPEECH
      Cause:- Some phones have no speech recognizer app, so launching voice input crashed.
      Sol:- SpeechToTextContract checks for a recognizer first; if none, it shows "Voice input is not available on this device" (en/hi/as/bn) and does nothing. This covers all mic buttons.
      Added the <queries> entry to the manifest so the check works on Android 11+. Commit aaf66cc48
      ==============================================
      ImmunizationFormViewModel - NPE on MutableSharedFlow.emit / UninitializedPropertyAccessException: vaccinesList
      Cause:- clickedBenId was declared below init, but the background coroutine started in init could run before it was set (null). The vaccine details flow read a lateinit vaccinesList
      before it was loaded.
      Sol:- Declared clickedBenId before init; the details flow now waits for the loaded vaccine list. Fixed the same race in MotherImmunizationListViewModel. Commit 39a7ff143
      ==============================================
      IncentivesFragment.showFile - Fragment not attached to an activity
      Cause:- The download Snackbar's "Open" action was tapped after leaving the Incentives screen.
      Sol:- showFile does nothing when the screen is no longer attached. Commit 59352aeaf
      ==============================================
      EyeSurgeryFormFragment.handleFormSubmission - Fragment not associated with a fragment manager
      Cause:- The save finished after the form was already closed (double submit / back press during save).
      Sol:- Context and messages are captured before the save; the result toast still shows in the user's language; navigation only runs while the screen is attached. Commit 5d6ad5f71
      ==============================================
      TBScreeningFormFragment.referToHwcFacilityAlert - Fragment not associated with a fragment manager
      Cause:- The referral dialog's "Yes" button was tapped after the TB screening screen was closed.
      Sol:- Navigates only while attached, using safeNavigate. Commit dac0f8eb9
      ==============================================
      NewBenRegFragment.getBinding - NullPointerException (hardCodedListUpdate)
      Cause:- The age/date picker returned its value after the screen's view was destroyed.
      Sol:- The value is still saved in the ViewModel; the list refresh is skipped when there is no view. Commit b248787f6
      ==============================================
      PwAncFormFragment.onActivityResult - null cannot be cast to FormInputAdapterWithBgIcon
      Cause:- The file-picker result arrived while the app was being re-created, before the form list was shown.
      Sol:- Safe cast; the file is stored in the ViewModel and appears once the form loads. Commit 5e423ab06
      ==============================================
      SyncBottomSheetFragment - Fragment already added (tag=SYNC)
      Cause:- A quick double tap on the sync icon added the same bottom sheet twice (show() queues the add, so the "is visible" check was still false).
      CI build failure - Unresolved reference: NativeLibraryLoader
      Cause:- Commit f662e4fc0 used NativeLibraryLoader but the file itself was never committed.
      Sol:- Added NativeLibraryLoader.kt. Commit 59fc723a6
      ==============================================

              Assignee:
              Deep Shikha
              Reporter:
              Nikhil Ananda Fegade
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: