OpenTok for Cordova with Crosswalk throws alert()

840 views Asked by At

We have build an application using OpenTok for Cordova plugin. All is working well on Android and IOS when using the default Cordova Webview.

Once we try to use Crosswalk for Cordova, the OpenTok plugin crashes with the following error:

Attempt to invoke virtual method 'void com.opentok.android.Session.connect(java.lang.String)' on a null object reference.

I have been searching for answers / solution. I came across this open issue on GitHub. But I have failed to find a solution.

Does anyone have the same issue and hopefully a solution?

I am using the following plugins:

com.lampa.startapp 0.0.4 "startApp"
com.tokbox.cordova.opentok 1.0.3 "OpenTokCordovaPlugin"
cordova-plugin-camera 1.1.0 "Camera"
cordova-plugin-console 1.0.0 "Console"
cordova-plugin-crosswalk-webview 1.2.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.0.0 "Device"
cordova-plugin-dialogs 1.1.0 "Notification"
cordova-plugin-geolocation 1.0.0 "Geolocation"
cordova-plugin-inappbrowser 1.0.0 "InAppBrowser"
cordova-plugin-splashscreen 2.0.0 "Splashscreen"
cordova-plugin-whitelist 1.0.0 "Whitelist"
nl.x-services.plugins.insomnia 4.0.1 "Insomnia (prevent screen sleep)"
nl.x-services.plugins.launchmyapp 3.2.2 "Custom URL scheme"

I have the following library versions:

Cordova CLI: 5.0.0
Ionic: 1.0.0
Ionic-cli: 1.5.0
1

There are 1 answers

4
Martin Dejmek On BEST ANSWER

I had same issue. Your session is not created, so you are calling connect on null. In my case it was because android wasn't able to find opentok library. I copied opentok.so from platforms\android\libs\armeabi to libs itself and also created folders armeabi-v7a and armeabi_v7a. I'm not sure which one fixed the issue and didn't test separated cases yet.