cancel
Showing results for 
Search instead for 
Did you mean: 

SAP MDK Error after selecting value from a List Picker

0 Kudos

Hi,

I'm using SAP MDK to build a hybrid mobile app and I'm getting a error upon selecting an item in a list picker. The page is defined as a FormCellContainer. This error not always occurs, which makes it hard to debug. Does anyone know the reason for this?

I'll provide the trace of the error below.

System.err: An uncaught Exception occurred on "main" thread. System.err: Unable to resume activity {ngn.connections.execute/sap.mdkclient.MDKAndroidActivity}: java.lang.IllegalArgumentException: No view found for id 0x2 (unknown) for fragment fragment9[7]<MDKPage<tabpage>> System.err: System.err: StackTrace: System.err: java.lang.RuntimeException: Unable to resume activity {(app.name)/sap.mdkclient.MDKAndroidActivity}: java.lang.IllegalArgumentException: No view found for id 0x2 (unknown) for fragment fragment9[7]<MDKPage<tabpage>> System.err: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4538) System.err: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4570) System.err: at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) System.err: at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2216) System.err: at android.os.Handler.dispatchMessage(Handler.java:107) System.err: at android.os.Looper.loop(Looper.java:237) System.err: at android.app.ActivityThread.main(ActivityThread.java:7948) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075) System.err: Caused by: java.lang.IllegalArgumentException: No view found for id 0x2 (unknown) for fragment fragment9[7]<MDKPage<tabpage>> System.err: at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:875) System.err: at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)

(...)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

A few questions to help get some more background

What version of the MDK Android client are you using?

What is the picker bound to? Online Entity Set, Offline Entity Set, Other?

Can you please share the metadata of the full page with the list picker?

Thanks,

--Bill

0 Kudos

bill.froelich Sorry for the late response, I updated the mdk version and waited until the issue start happening again. Here are some details:

I have 2 versions of the app installed, one is the deployed version loaded into the mdk on the play store (Mobile Svcs) and the other is the one I use to debug that is built in VSCode using MDK 5.1.2.

Both versions crash at the same time even when they have different versions of the code.

It is not feasible to paste the entire page code here so I shortened it and did some scrubbing.

This page goes inside a tab in a tabControl page.

{
    "Caption": "PageName",
    "Controls": [
        {
            "Sections": [
                {
                    "Controls": [
                        (...)
                    ],
                    "Visible": true
                },
                {
                    "Controls": [
                        {
                            "AllowDefaultValueIfOneItem": false,
                            "AllowEmptySelection": false,
                            "AllowMultipleSelection": false,
                            "Caption": "Pressure regime",
                            "DataPaging": {
                                "PageSize": 50,
                                "ShowLoadingIndicator": false
                            },
                            "IsEditable": true,
                            "IsPickerDismissedOnSelection": true,
                            "IsSearchCancelledAfterSelection": false,
                            "IsSelectedSectionEnabled": false,
                            "IsVisible": false,
                            "PickerItems": {
                                "DisplayValue": "{Description}",
                                "ReturnValue": "{Value}",
                                "Target": {
                                    "EntitySet": "EntityName",
                                    "QueryOptions": "$orderby=Value",
                                    "Service": "/mobileapp/Services/S4_HANA.service"
                                }
                            },
                            "Value": [
                                "{EntityValue}"
                            ],
                            "_Name": "SA_NP_PressureRegimeField",
                            "_Type": "Control.Type.FormCell.ListPicker"
                        }
                    ],
                    "Visible": true
                }
            ],
            "_Name": "PageName",
            "_Type": "Control.Type.FormCellContainer"
        }
    ],
    "_Name": "DataSheet",
    "_Type": "Page"
}

 

Most of the times the issue happens with the phone connected to the PC with the TNS mobile service on, but persists if I close it and disconnect the phone.

Best Regards

Nuno Oliveira

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

nuno.santos.oliveira Is the connection an online or offline connection?

Accepted Solutions (0)

Answers (1)

Answers (1)

miqueias_maia
Participant
0 Kudos

I'm facing this same issue on Android devices. On iOS, app only crashes and close.