Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem unlocking Store in LogonCore

Hi,

I'm trying to onboard users to SMP 3.0 using the OData SDK, following this example:

How To... On-board users with SMP 3.0 OData SDK (Android)

On the first run of the application (when there is no storeAvailable) everything works fine. A new secure store is created, then it is unlocked. I successfully register the new user on the SMP platform and receive back a connection id and store it in the vault.

logonCore.init(this, APPLICATION_NAME);

try {

     if (!logonCore.isStoreAvailable()) {

          logonCore.createStore(null, false);

     }

     logonCore.unlockStore(null);

     appConnId = logonCore.getObjectFromStore(VK_APPCID);

}

catch(LogonCoreException e) {

     Log.e(LOG_TAG, e.toString());

}

When I open the application for a second time and my code goes directly to unlockStore an exception is thrown:

Caused by: java.lang.NullPointerException

E/AndroidRuntime:     at java.lang.String.<init>(String.java:228)

E/AndroidRuntime:     at com.sap.maf.tools.logon.core.LogonCore.getAppSettings(LogonCore.java:1934)

E/AndroidRuntime:     at com.sap.maf.tools.logon.core.LogonCore.unlockStore(LogonCore.java:700)

E/AndroidRuntime:     at com.test.MainActivity.onCreate(MainActivity.java:87)


It crashes on the following line in the LogonCore.class:


String settingsFormat = new String(this.storeMan.getByteDataFromStore("VK_APP_SETTINGS_FORMAT"), "UTF-8");

I am using SAP Mobile SDK 3.0 SP10 PL01. What am I doing wrong?




Best regards,


Mihail



Tags:
Former Member
replied

Hi Karthik,

I updated the guide https://scn.sap.com/docs/DOC-59555. could you please give it a try and let me know if the error persists?

Best regards,

claudia

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question