opensrp / opensrp-client-reveal

OpenSRP Client Reveal App
Other
7 stars 8 forks source link

Fix crash for dynamic tasking when adding structure #1464

Closed LZRS closed 3 years ago

LZRS commented 3 years ago

When adding structure, in dynamic tasking, the app crashes with error

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ibm/fhir/model/type/Canonical;

madrinekariuki commented 3 years ago

@LZRS Please confirm if this is the same issue i have shared a video with you. issue seems related to #1468 -After you login to the app -When adding a new structure -and a prompt asking you to "Allow Reveal to manage and make phone calls" -when you click Allow the app crashes and you have to click on it and login in again...

I am unable to upload a video here but i have share it on slack. image

madrinekariuki commented 3 years ago

@LZRS please note that this issue is also appearing in the Nam prod apk V5.2.26 android version used is 11.

LZRS commented 3 years ago

@madrinekariuki do you mean v5.3.26?

madrinekariuki commented 3 years ago

@madrinekariuki do you mean v5.3.26?

yes.. apologies.

LZRS commented 3 years ago

For Namibia, the issue was resolved here https://github.com/opensrp/opensrp-client-reveal/pull/1476

madrinekariuki commented 3 years ago

@LZRS please confirm if this fix was deployed to the dynamic tasking APK cc @samkanga

LZRS commented 3 years ago

The crashes happening when one accepts 'Allow this App to make phone calls', is due to the app trying to use TelephonyManager.getDeviceId which as described here was deprecated from android 8 and since android 10, crashes with SecurityException and requires privileged permission READ_PRIVILEGED_PHONE_STATE.

@Rkareko I'm not sure of its use, as used from native forms here cc @samkanga @madrinekariuki

Rkareko commented 3 years ago

Crashlytics logs found here

Fatal Exception: java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=15143, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {org.smartregister.reveal/org.smartregister.reveal.activity.RevealJsonFormActivity}: java.lang.SecurityException: getDeviceId: The user 10265 does not meet the requirements to access device identifiers.
       at android.app.ActivityThread.deliverResults(ActivityThread.java:5384)
       at android.app.ActivityThread.handleSendResult(ActivityThread.java:5425)
       at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2319)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:257)
       at android.app.ActivityThread.main(ActivityThread.java:8218)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1016)
LZRS commented 3 years ago

Resolved by #1503

madrinekariuki commented 3 years ago

This has been tested on v5.3.26-rc6 th-en preview v5.3.26-rc6 th preview

the app is no longer crashing when adding a structure.