Openmrs android client error when creating a patient or trying to find patients

@magp when you are trying to build and run on emulator just shift the variant back to debug build, it will reduce build time also. Just try and let me know if it works with emulator.if It works I will raise a API specific ticket for this bug !!

You were right! I tried it in a different device with API level 23 which led me to the same issue, and then I tried to run it on an emulator with API level 30 and it finally works as expected. Thank you for the constant support!

1 Like

welcome glad I could help @magp :slight_smile:

cc @rishabh997 we are facing crashes on low API devices due to multidex related issue we should raise a ticket for this !!

1 Like

Hi, I am also facing the similar kind of issue where the app crashes when creating/finding patients.

I have followed the same above steps to build a Bundle APK and install it manually on my device (API level 28). I am running debug variant.

Here is my Build Log and Runtime Logcat.

@manjotsidhu I tried building the apk and it runs fine (I tried adding providers ) on API level 25 , could you clean build after invalidating caches and try it again, some other people also have experinced this issue due to the recent schema changes but it goes away after a clean build . let me know if it works for you!!

I just now did the following steps and got the same result of crashes -

  • Invalidated Caches and Restart
  • Clean Project
  • Build debug APK
  • Uninstalled the previous app and Installed the newly built app

I have cloned the Android Client today itself and started working on it, so I don’t think schema changes might be the issue.

1 Like

@manjotsidhu the logs you shared are after the crash happend could you share the whole log.

@manjotsidhu thanks for reporting I think this is an issue will create a ticket for it.

cc @rishabh997
the app crashed after pulling in PR 847

here are the full logs

Actually those logs are from the start of the App only. You can check again.

I also tested build by reverting PR 847 but looks like the issue still persists for me.

AC-847 was quiet an independent PR with changes persisting to only UI, it has nothing to do with crash. There is som error in patients api for lower API devices… Will need to investigate it properly

okay @rishabh997 for me the app crashed after pulling in that PR so I thought its related will update the description !! and I saw in the logcat

Caused by: android.view.InflateException: Binary XML file line #49: Binary XML file line #49: Error inflating class <unknown>
     Caused by: android.view.InflateException: Binary XML file line #49: Error inflating class <unknown>
     Caused by: java.lang.reflect.InvocationTargetException

 Caused by: android.content.res.Resources$NotFoundException: Drawable android:color/primary_text_material_light with resource ID #0x106012b
     Caused by: android.content.res.Resources$NotFoundException: File res/color/primary_text_material_light.xml from drawable resource ID #0x106012b

something related to drawable resources and xml.

I tested for API level 25

I would like to share the video on how the App crashes for me Here

@rishabh997 I tried with breakpoints and chucker in the app as well as verified from the server, the requests are going through to the server and patients are getting saved but the crash happens just after.

@saurabh Could you test this change on your device. This fixes AC-851 for me and I think errors while registering or finding patients will be fixed too.

I tested on Android Emulator API level 28.

1 Like

@manjotsidhu can you claim the issue and create a PR I will review it from there !!

Done please check AC-851 Pull Request.