简体   繁体   中英

WL.JsonStore is not initialized, When trying to build the cordova IBM Mobile First Application in Android devices and In Android Emulator

I Followed the Following Link

https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/jsonstore/cordova/#adding-jsonstore

I have Also added the JsonStore Plugin

Wl.jsonStore is not Initialized when trying to initialize the Cordova Mobile First application

 WL.JSONStore.init(collections).then(function (collections) {                
    alert("collections creted sucessfully");
     console.log("Collections created sucessfully");
    // handle success - collection.people (people's collection)
                                            }).fail(function 
    (error) {
alert(error);
     console.log(error);// handle failure                                       });

WL.Store is need to Initialized. Kinldy Help me out To fix this Issue.

在此处输入图像描述

At Last, I Found my answer in the IBM TroubleShoot Site

Kindly Refer the Link:

https://mobilefirstplatform.ibmcloud.com/tutorials/ru/foundation/8.0/troubleshooting/jsonstore/

In config.xml, change the clientCustomInit property to true. In index.js file: add the following line at the beginning of the file:

document.addEventListener('mfpjsonjsloaded', initWL, false);

leave the WL.JSONStore.init call in wlCommonInit()

add the following function:

function initWL(){                                                     
  var options = typeof wlInitOptions !== 'undefined' ? wlInitOptions
  : {};                                                                
  WL.Client.init(options);                                           
}   

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM