Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes on Android Version 5 #185

Closed
4 tasks
AnnieMungai opened this issue Aug 9, 2021 · 9 comments
Closed
4 tasks

App crashes on Android Version 5 #185

AnnieMungai opened this issue Aug 9, 2021 · 9 comments
Labels
Show stopper Cannot go into production with this issue Top priority This issue requires top priority

Comments

@AnnieMungai
Copy link
Contributor

AnnieMungai commented Aug 9, 2021

App version 2.0.2 (production)

  • Sorry a fatal error occurred when loading the form error message displayed when registering a child on a tablet running android v5.1.1. - the system is not able to generate a unique OpenSRP ID thus a user cannot register a child. Error reported: Sorry a fatal error occurred when loading the form, please contact a developer for further assistance. Tablet being used; - Huawei Media pad M2 running android v5.1.1
  • Login failed, try again error message on a tablet running android v5.1.1.
  • User group error on a tablet running android v5.1.1
    Note! Are approximately 300 users with Android 5 and 6
  • Fix to also consider Android 6 as there is a good number of users still on Android 6.

Additional notes
The issues seem not to be replicated when Android 7-9 is used.
The errors started happening when the app is upgraded from version 2.0.0. to 2.0.1 and 2.0.2. (Meanwhile, we have asked the users not to upgrade to those versions).

Question: @ellykits Could these errors be related to change of labels on Measles where Measles was removed to leave only MR?

@AnnieMungai AnnieMungai added Show stopper Cannot go into production with this issue Top priority This issue requires top priority labels Aug 12, 2021
@AnnieMungai
Copy link
Contributor Author

AnnieMungai commented Aug 12, 2021

Possible solution:
opensrp/opensrp-client-chw#1777

@ndegwamartin
Copy link
Collaborator

ndegwamartin commented Aug 12, 2021

Also consider upgrading the Native Forms library for this fix here

@junaidwarsivd @ellykits @tychus6

@junaidwarsivd
Copy link
Contributor

Caused by java.lang.SecurityException: getDeviceId: The user 10215 does not meet the requirements to access device identifiers.
at android.os.Parcel.createException(Parcel.java:2088)
at android.os.Parcel.readException(Parcel.java:2056)
at android.os.Parcel.readException(Parcel.java:2004)
at com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceId(ITelephony.java:11175)
at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:2284)
at com.vijay.jsonwizard.utils.PropertyManager.getDeviceId(PropertyManager.java:88)
at com.vijay.jsonwizard.utils.PropertyManager.addPhoneProperties(PropertyManager.java:127)
at com.vijay.jsonwizard.utils.PropertyManager.access$000(PropertyManager.java:42)
at com.vijay.jsonwizard.utils.PropertyManager$1.onRequestPermissionResult(PropertyManager.java:110)
at com.vijay.jsonwizard.activities.JsonFormBaseActivity.onRequestPermissionsResult(JsonFormBaseActivity.java:199)
at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:8476)
at android.app.Activity.dispatchActivityResult(Activity.java:8298)
at android.app.ActivityThread.deliverResults(ActivityThread.java:5317)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5365)
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:2261)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8107)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

for this i have upgraded the Native Form Library to the lattest version to 2.1.3

@junaidwarsivd
Copy link
Contributor

Fatal Exception: java.lang.IllegalArgumentException: URI is not absolute
at java.net.URI.toURL(URI.java:1090)
at org.smartregister.service.HTTPAgent.getHttpURLConnection(HTTPAgent.java:149)
at org.smartregister.service.HTTPAgent.initializeHttp(HTTPAgent.java:130)
at org.smartregister.service.HTTPAgent.fetch(HTTPAgent.java:156)
at org.smartregister.stock.sync.StockSyncIntentService.pullStockFromServer(StockSyncIntentService.java:98)
at org.smartregister.stock.sync.StockSyncIntentService.onHandleIntent(StockSyncIntentService.java:68)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:67)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)

for this crash i've found out there was an illegalArgumentException which wasn't handled on the HttpAgent class in Client Core i have added this exception in the catch block in HttpAgent.getHttpURLConnection() respective calls

@junaidwarsivd
Copy link
Contributor

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.compareTo(java.lang.String)' on a null object reference
at org.smartregister.child.model.ChildMotherDetailModel.compareTo(ChildMotherDetailModel.java:201)
at org.smartregister.child.model.ChildMotherDetailModel.compareTo(ChildMotherDetailModel.java:9)
at java.util.Collections$ReverseComparator.compare(Collections.java:5165)
at java.util.Collections$ReverseComparator.compare(Collections.java:5156)
at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
at java.util.TimSort.sort(TimSort.java:220)
at java.util.Arrays.sort(Arrays.java:1498)
at java.util.ArrayList.sort(ArrayList.java:1470)
at java.util.Collections.sort(Collections.java:201)
at org.smartregister.child.util.ChildJsonFormUtils.processReturnedAdvanceSearchResults(ChildJsonFormUtils.java:2253)
at org.smartregister.child.model.BaseChildAdvancedSearchModel.getChildMotherDetailModels(BaseChildAdvancedSearchModel.java:208)
at org.smartregister.path.model.AdvancedSearchModel.createMatrixCursor(AdvancedSearchModel.java:63)
at org.smartregister.child.presenter.BaseChildAdvancedSearchPresenter.onResultsFound(BaseChildAdvancedSearchPresenter.java:112)
at org.smartregister.child.interactor.ChildAdvancedSearchInteractor.lambda$null$0(ChildAdvancedSearchInteractor.java:55)
at org.smartregister.child.interactor.-$$Lambda$ChildAdvancedSearchInteractor$sKC-cLVEIGA04K-drgD59pcU0cY.run(:6)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7156)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)

added null check on compareto method on mother child detail model

@junaidwarsivd
Copy link
Contributor

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.smartregister.path/org.smartregister.path.activity.ChildRegisterActivity}: java.lang.StringIndexOutOfBoundsException: length=0; index=0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2804)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2875)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1578)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6617)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)

added arrayoutofbound exception handeling on core utils

@junaidwarsivd
Copy link
Contributor

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
at org.smartregister.adapter.ServiceLocationsAdapter.getView(ServiceLocationsAdapter.java:64)
at android.widget.AbsListView.obtainView(AbsListView.java:2452)
at android.widget.ListView.measureHeightOfChildren(ListView.java:1426)
at android.widget.ListView.onMeasure(ListView.java:1332)
at android.view.View.measure(View.java:25007)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7018)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
at android.view.View.measure(View.java:25007)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7018)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:25007)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7018)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:25007)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7018)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at com.android.internal.policy.DecorView.onMeasure(DecorView.java:805)
at android.view.View.measure(View.java:25007)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3491)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2140)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2471)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2051)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8456)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1065)
at android.view.Choreographer.doCallbacks(Choreographer.java:889)
at android.view.Choreographer.doFrame(Choreographer.java:816)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1050)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7830)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1040)
added a null check curLocation on serviceLocationAdapter

@junaidwarsivd
Copy link
Contributor

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference
at org.smartregister.path.util.FormUtils.getSpinnerKeys(FormUtils.java:72)
at org.smartregister.path.util.FormUtils.obtainUpdatedForm(FormUtils.java:49)
at org.smartregister.path.activity.ChildDetailTabbedActivity.startFormActivity(ChildDetailTabbedActivity.java:228)
at org.smartregister.path.activity.ChildDetailTabbedActivity.onOptionsItemSelected(ChildDetailTabbedActivity.java:131)
at android.app.Activity.onMenuItemSelected(Activity.java:4182)
at androidx.fragment.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:383)
at androidx.appcompat.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:228)
at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:109)
at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:109)
at androidx.appcompat.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:65)
at androidx.appcompat.widget.Toolbar$1.onMenuItemClick(Toolbar.java:207)
at androidx.appcompat.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:779)
at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:834)
at androidx.appcompat.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:158)
at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:985)
at androidx.appcompat.view.menu.MenuPopup.onItemClick(MenuPopup.java:128)
at android.widget.AdapterView.performItemClick(AdapterView.java:374)
at android.widget.AbsListView.performItemClick(AbsListView.java:1736)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:4207)
at android.widget.AbsListView$7.run(AbsListView.java:6692)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8107)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
added a null check on string.split invocation

@AnnieMungai
Copy link
Contributor Author

Closing this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Show stopper Cannot go into production with this issue Top priority This issue requires top priority
Projects
None yet
Development

No branches or pull requests

3 participants