CommCare Android Troubleshooting

This page describes some actions that can be useful for troubleshooting CommCare Android when the application ends up in a bad state.

If you are unable to solve your problem and do end up submitting a ticket to the CommCare support team, please make sure to include information from the error itself, per here: https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143956620

Starting Fresh

Force Full Refresh

Due to synchronicity or updates between the server and the phone, the phone can end up with stale or incompatible data.

To force a full refresh of the user's data, you can navigate to the Mobile Worker's page on CommCare HQ. You can do so by clicking on Users > Mobile Workers via the ribbon menu.

Select the username of the mobile worker.

Under the Actions tab click Force Full Refresh on next Mobile Sync.

For each device the mobile worker is on (including Web Apps), this will make it so the next time they sync that device, it will do a Full Refresh of data instead of an incremental sync. This includes case data and fixture data (including lookup tables).

The Full Refresh operation is generally recognized as safe, and happens automatically during 1-2% of restores, when irregularities are auto-detected. However there are a few caveats to keep in mind:

  • A full refresh can sometimes take longer than an incremental sync. For the majority of projects, this is negligible. If your users are able to install the app on their normal internet connection, then this will certainly not be an issue. If however you have a very large case load or very large lookup tables that affects users' ability to install the app from the field, a full refresh may be subject to the same issues.

  • Incomplete forms on Web Apps for this user will be deleted the next time they sync.

If in the past you have used User Data Reset, you are strongly encouraged to use this feature instead in those situations.

User Data Reset (aka Clear User Data)

Use Force Full Refresh instead whenever possible. If you have no access to CommCare HQ, all data can be wiped locally instead, but it comes with fewer safety checks. Please note that this can result in some data loss if you have valid unsent forms.

On 2.28 and higher:

1. Log into CommCare.

2. Look at the Sync with Server button on the home screen. If it says Unsent Forms click on the button to submit those forms to the server.

3. When on the CommCare Home Screen, Press the Menu button on your phone and choose the "advanced" option. (On a Samsung or a LAVA, Menu is the bottom left button).

4. Press Clear User Data.

5. You will be returned to the login screen. Re enter your username and password and your user data will be re-synced to the device.

          

Fresh Restart

It is occasionally possible to end up putting the phone into a state which needs to be recovered from the cloud, resetting the local install. This is also helpful once problems are diagnosed, but before a fix can be prepared. The steps for doing so are:

Make sure that you have the reference to your application's profile QR Code before starting, as well as the appropriate credentials for the user on the phone.

  1. Make sure any local data is uploaded.

    1. Log in to CommCare with your username and password, and ensure that the application isn't loading a screen informing you that it is sending unsent forms.

    2. Log back out.

  2. Clear the local memory on the phone

    1. Navigate to the phone's applications management menu, generally from the home screen the process is Options -> Settings -> Applications -> Manage Applications.

    2. Navigate to CommCare Android.

    3. Press Clear Data and confirm.

  3. Reinstall your specific app.

    1. Load up a barcode scanner on the device.

    2. Scan the barcode for your application and confirm to navigate to it with CommCare.

    3. Press the install button on CommCare, the screen will freeze but eventually load the login screen

  4. Restore User Data.

    1. Log in with the username and password as usual. Since the restore is clean, it may take somewhat longer than usual.

CommCare Mobile Error Messages

“A serious problem occurred while CommCare was trying to download an update (or install your app): CommCare couldn't find the resource with id: commcare-application-profile.”

This message, which can show up upon installation, is often due to a bad internet connection. This almost always means you do not have a strong enough Internet connection. Make sure you have Internet access.

“Unfortunately, CommCare Android has stopped.”

If CommCare crashes and you get this message, you can get more detailed information about the nature of the problem by doing the following: 

  • When CommCare crashes click the 'Report button' in the crash dialog.

  • Once the crash report has loaded click on the 'Preview' button.

  • Scroll to the bottom and click on 'Stack Trace'.

  • In the stack trace you should be able to find a more detailed error message.

“Storage is Corrupt :/”

CommCare Android can enter an error state with the message "Storage is Corrupt :/" (see image at bottom). This happens when the app install that's currently on the phone enters an inconsistent state that we can't correct.

There are three causes of this

  • The app's storage files have been manually changed/modified: Some of CommCare's files non-userdata files are stored on the phone in an area where external apps can delete them.

  • The phone's storage layer has corrupted the files stored to the device: This is a problem that we've seen on certain devices, more commonly with counterfeit SD Cards. We don't believe this to be a common problem outside of Counterfeit SD cards, but it has come up in the past rarely.

  • There is a bug in CommCare's code that is resulting in corrupted files: It's possible that CommCare is writing an invalid app structure to the phone's storage due to an unforseen bug in the code. The only time this kind of bug could occur that would result in Recovery Mode being triggered would be immediately after some sort of remote update that resulted in the phone not having a fully installed and consistent version of your app. This would not be expected, however, to cause any problems in submitting unsent data to the server. 

If you receive this error, please report it! In your report, please let us know:

  1. What version of CommCare you are using - So we know whether it's possible that you are triggering an older bug

  2. What devices are in use: This helps us disambiguate whether the issue might be related to "external storage" on older android phones and also the likelihood that there might be any hardware problems.

  3. Whether there was a specific circumstance that seemed to trigger the issues. Are you frequently using remote updates for the app? Do you know whether the issues appeared after some critical event?

  4. How widespread is the issue? Do certain users seem to have the problem over and over, or is it randomly distributed between users? 

  5. Can you replicate the problem? If so we can help work through it very quickly.

CommCare Recovery Mode

Phones entering recovery mode is unusual and unexpected. This happens when the app install that's currently on the phone enters an inconsistent state that CommCare can't correct.

Selecting "Enter Recovery Mode" will navigate you to a screen like the one below. An advantage of entering recovery mode is that users will be presented with the opportunity to submit any unsent forms.

“Having issues communicating with the server to send forms. Will try again later” or “CommCare ODK will not Send Forms to Server”

We have recently encountered a few instances where one device or user on a domain is not able to send forms to the server despite a seemingly strong internet connection.

Unfortunately this is often the result of SSL certificate errors, firewalls, or other issues that we have trouble diagnosing and fixing. Please submit a support ticket when you receive this. For an immediate fix, you can try using https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143973390 to transfer your forms to another device. Please follow the links above to see instructions on using this feature. The forms you send via these methods will appear the same on the server as if they had been submitted by the original device.

Stuck Forms

How to fix incomplete forms that can be loaded

See https://dimagi.atlassian.net/wiki/x/3AvKfw.

How to check if there are quarantined forms on the device

If you know or suspect that there are forms which a mobile user filled out on their device but are not appearing on the server, one possible cause is that the form became corrupted in some way and has been quarantined on the device. Quarantining is when the form gets removed from the queue of forms to be sent to CommCare HQ, but is still kept on the device. If CommCare Android detects that a form has become corrupted, it will automatically quarantine the form. Users can also manually quarantine a completed-but-unsent form. You can view quarantined forms on a device by taking the following steps:

1. Go to the list of Saved Forms on the device, either by pressing the "Saved" button on the home screen (if it's available), or going to the home screen options menu and then selecting "Saved Forms". 

2. Click on the filter button in the upper-right corner of that screen, and select "Filter: Quarantined Forms."

3. If there are any quarantined forms on the device, they will appear in this list, and you will be able to open them for viewing to determine what exact form they were.

4. You can also get more information about what is wrong with a quarantined form by long-clicking on the form in the list, and then selecting "Scan Record Integrity". A dialog will then pop up with some detailed information about the form and what may be wrong with it. This information can be quite dense, but it is very helpful to include if you are reporting an issue to Dimagi about the problematic form.