Srujan reddy
Srujan reddy

Reputation: 137

JSONStore Initialisation failure with error: -11 msg: OPERATION_FAILED_ON_SPECIFIC_DOCUMENT

We are currently developing a Cordova app using MobileFirst Foundation 8.0(20170131) which is working perfectly on an x86 Architecture Android devices and AVDs. But when comes to the 64-bit architecture device like Note 5 and Google Pixel we are seeing below error message while initialising the JSONStore API, where it says the libcrypto.so.zip file which is in assets/featurelibs is of 32-bit instead of 64 bit.

Error in Android studio(v2.2.3):

    02-11 13:18:43.136 9317-10425/com.mobiInspect E/JSONSTORE: JSONStoreLogger.logError in JSONStoreLogger.java:192 :: error while dispatching action "provision"
                                                           java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/com.mobiInspect/no_backup/libcrypto.so.1.0.0" is 32-bit instead of 64-bit
                                                               at java.lang.Runtime.load0(Runtime.java:908)
                                                               at java.lang.System.load(System.java:1505)
                                                               at com.worklight.jsonstore.util.JSONStoreUtil.loadLib(JSONStoreUtil.java:264)
                                                               at com.worklight.jsonstore.api.WLJSONStore.<init>(WLJSONStore.java:71)
                                                               at com.worklight.jsonstore.api.WLJSONStore.getInstance(WLJSONStore.java:273)
                                                               at com.worklight.androidgap.jsonstore.dispatchers.ProvisionActionDispatcher.initializeCollection(ProvisionActionDispatcher.java:149)
                                                               at com.worklight.androidgap.jsonstore.dispatchers.ProvisionActionDispatcher.databaseActionDispatch(ProvisionActionDispatcher.java:139)
                                                               at com.worklight.androidgap.jsonstore.dispatchers.BaseDatabaseActionDispatcher.actionDispatch(BaseDatabaseActionDispatcher.java:36)
                                                               at com.worklight.androidgap.jsonstore.dispatchers.BaseActionDispatcher.dispatch(BaseActionDispatcher.java:90)
                                                               at com.worklight.androidgap.jsonstore.dispatchers.DispatchingPlugin$ActionDispatcherRunnable.run(DispatchingPlugin.java:79)
                                                               at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                                                               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                                                               at java.lang.Thread.run(Thread.java:761)
02-11 13:18:43.148 9317-10425/com.mobiInspect D/JSONSTORE:JSONStoreLogger.logDebug in JSONStoreLogger.java:177 :: os.arch: x86_64
02-11 13:18:43.152 9317-10425/com.mobiInspect D/JSONSTORE: JSONStoreLogger.logDebug in JSONStoreLogger.java:177 :: Extracting zip file: featurelibs/x86/libcrypto.so.1.0.0
02-11 13:18:43.155 9317-9317/com.mobiInspect W/art: Attempt to remove non-JNI local reference, dumping thread
02-11 13:18:43.264 9317-10425/com.mobiInspect D/JSONSTORE: JSONStoreLogger.logDebug in JSONStoreLogger.java:177 :: Loading library using System.load: /data/user/0/com.mobiInspect/no_backup/libcrypto.so.1.0.0
02-11 13:18:43.269 9317-10425/com.mobiInspect D/JSONSTORE: JSONStoreLogger.logDebug in JSONStoreLogger.java:177 :: com.mobileiron.wrapped is set to false
02-11 13:18:43.281 9317-10425/com.mobiInspect D/JSONSTORE: JSONStoreLogger.logDebug in JSONStoreLogger.java:177 :: Loading library using System.load: /data/user/0/com.mobiInspect/no_backup/libcrypto.so.1.0.0

Upvotes: 0

Views: 414

Answers (1)

Srujan reddy
Srujan reddy

Reputation: 137

This is because of the renderscript which we are using in our gradelfile. Where this renderscript will import the X86_64 and armv-64a libraries while building an apk.

To solve this issue, we have two options

1) We can remove 64-bit libs from the build, or set abiFilters to package only 32-bit architectures by using below ndk property in build.gradle file:

android {
    ....
    defaultConfig {
        ....
        ndk {
            abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
        }
    }
}

2) Comment out the renderscriptApi and renderscriptEnableMode and repackage the apk.

Upvotes: 1

Related Questions