IBM MobileFirst 7.1 with Android Cordova failure when init JSONStore

半腔热情 提交于 2019-12-11 15:06:10

问题


I am trying to create a 'heloworld' project with IBM Mobilefirst 7.1 integrate cordova using platform android and enable feature JSONStore

  • Step 1: create mobilefirst cordova project flowing link https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/hello-world/integrating-mfpf-sdk-in-cordova-applications/#sampleApplication
    Note: platform android and add more plugin jsonstore
  • Step 2: add feature JSONStore in application-descriptor.xml
  • Step 3: add code in function wlCommonInit

    WL.JSONStore.init(collections).then(function (collections) {
        // handle success - collection.people (people's collection)
        console.log('ok')
    }).fail(function (error) {
        // handle failure
        console.log('error', error)
    });
    
  • Step 4: build and run with Android studio with Android Emulator - Nexus_4_API_19, I get error of console.log('error', error)

    col: "people"
    doc: Object
    err: -1
    msg: "PERSISTENT_STORE_FAILURE"
    res: Object
    src: "initCollection"
    usr: "jsonstore"
    

    console log in Android Studio

I/chromium: [INFO:CONSOLE(44)] "Calling WL.Client.init(wlInitOptions);", source: file:///android_asset/www/plugins/cordova-plugin-mfp/bootstrap.js (44)
W/PluginManager: THREAD WARNING: exec() call to DeviceAuth.getDeviceUUID blocked the main thread for 181ms. Plugin should use CordovaInterface.getThreadPool().
D/EGL_emulation: eglMakeCurrent: 0xb8eea440: ver 2 0
I/chromium: [INFO:CONSOLE(17)] "1", source: file:///android_asset/www/js/index.js (17)
D/EGL_emulation: eglMakeCurrent: 0xb8eea440: ver 2 0
I/dalvikvm: Could not find method com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable, referenced from method com.worklight.wlclient.push.common.GCMClientFactory.useGooglePlayServices
W/dalvikvm: VFY: unable to resolve static method 631: Lcom/google/android/gms/common/GooglePlayServicesUtil;.isGooglePlayServicesAvailable (Landroid/content/Context;)I
D/dalvikvm: VFY: replacing opcode 0x71 at 0x0006
D/dalvikvm: GC_FOR_ALLOC freed 748K, 13% free 6159K/7012K, paused 10ms, total 12ms
D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 163840
D/dalvikvm: Trying to load lib /data/data/com.ibm.testjsonstore/files/libcrypto.so.1.0.0 0xa4fcd670
D/dalvikvm: Added shared lib /data/data/com.ibm.testjsonstore/files/libcrypto.so.1.0.0 0xa4fcd670
D/dalvikvm: No JNI_OnLoad found in /data/data/com.ibm.testjsonstore/files/libcrypto.so.1.0.0 0xa4fcd670, skipping init
I/chromium: [INFO:CONSOLE(29)] "erorr", source: file:///android_asset/www/js/index.js (29)

Anyone know about this, please help

来源:https://stackoverflow.com/questions/48019338/ibm-mobilefirst-7-1-with-android-cordova-failure-when-init-jsonstore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!