Search code examples
javascriptandroidibm-mobilefirstjsonstore

JSONSTORE Mobilefirst 7.1 error java.lang.NoClassDefFoundError: com.worklight.jsonstore.util.JSONStoreUtil


I am having the error java.lang.NoClassDefFoundError: com.worklight.jsonstore.util.JSONStoreUtil when I initialize a function of JSONSTORE.

I am using Mobilefirst Studio 7.1.0.00-20160323-1606

In main.js I have this code:

function wlCommonInit(){    
    var collectionCart = {
        cartCellphones : {
            searchFields: {id: 'integer', model: 'string', precio:'integer', caracteristicas:'string',image:'string',brand:'string'}
        }
    };

    WL.JSONStore.init(collectionCart).then(function (collectionCart) {
      // handle success - collection.people (people's collection)
    }).fail(function (error) {
      // handle failure
    });

    /************************JSON STORE Datos personales**********************************/

    var collectionData = {
        personalData : {
            searchFields: {name: 'string', lastName:'string', photo:'string',telephone:'string',email:'string', datebirth: 'string',}
        }
    };

    WL.JSONStore.init(collectionData).then(function (collectionData) {
      // handle success - collection.people (people's collection)
    }).fail(function (error) {
      // handle failure
    });
}

EDIT

I am seeing in the android studio project that int the file .idea/libraries/libs.xml the jsonstore.jar is not imported

libs.xml

Also in the folder libs the file jsonstore.jar exists

libs

I don´t know if that could be a problem.


Solution

  • I resolve my problem, the JSONSTORE was not imported in the Android Project. So I imported the jsonStore.jar with the android Studio and the problem was solved.

    Add Libraries