Skip to Content
0
Oct 20, 2014 at 08:25 AM

Android Offline Store - ODataNetworkException

59 Views

Hi,

I'm trying to open an Offline Store on Android, but everytime I'm getting the following error:

10-17 17:21:06.705: E/SMP_ODATA(8275): Failed to open store

10-17 17:21:06.705: E/SMP_ODATA(8275): com.sap.smp.client.odata.exception.ODataNetworkException: Unknown internal error occured

10-17 17:21:06.705: E/SMP_ODATA(8275): at com.sap.smp.client.odata.offline.ODataOfflineStore.openStoreSync(ODataOfflineStore.java:505)

10-17 17:21:06.705: E/SMP_ODATA(8275): at com.sap.smp.client.odata.offline.ODataOfflineStore$OpenStoreWithOptionsThread.run(ODataOfflineStore.java:412)

10-17 17:21:06.705: E/SMP_ODATA(8275): Caused by: com.sap.smp.client.odata.offline.ODataOfflineException: [-10060] An error occurred while performing a synchronization. Reason: -857 (ERROR) %1:[-10225] Message: Failure occurred while executing user supplied code

That's the code, it's running fine on iOS but not on Android:

function openStore() {
        if (!haveAppID()) {
            return;
        }
        startTime = new Date();
        updateStatus2("store.open called");
        var properties = {
            "name": "OfflineStore1",
            "host": smpServerHost,
            "port": smpServerPort,
            "https": false,
            "serviceRoot" :  appId, 
            "customHeaders" : {
                "X-SMP-APPCID" : appCID,
            "Authorization" : "Basic " + btoa(applicationContext.registrationContext.user + ":" + applicationContext.registrationContext.password)
        },

            "definingRequests" : {
                "req1" : "/TPLSet"          
 }
        };
        
        store = sap.OData.createOfflineStore(properties);
        store.onrequesterror = errorCallback; //called for each modification error during flush

        //var options = {};
        store.open(openStoreSuccessCallback, errorCallback/*, options*/);
    }

I'm using Android 4.4.2, Cordova 3.5, SMP SDK 3.0.5.1 and SMP 3.0.4.0

Any ideas what could be the problem?

Thanks and best regards,

Giuliano