1

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
Mark Veenstra
  • 4,691
  • 6
  • 35
  • 66

1 Answers1

3

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.

Lennon Spirlandelli
  • 3,131
  • 5
  • 26
  • 51
  • Why wouldn't my session be created? Without CrossWalk all is working well. – Mark Veenstra Jul 22 '15 at 13:42
  • As i said. It Cannot find `opentok` library. Use android studio to access console. That plugin has lots of logs. – Martin Dejmek Jul 27 '15 at 08:05
  • Creating a directory called 'platforms\android\libs\armeabi-v7a' which contained the opentok.so did the trick for me. Kudos! – IjzerenHein Nov 18 '15 at 14:44
  • Something that worked for me was simply to remove the lib/arm64-v8a and lib/armeabi-v7a directories. Apparently the runtime linker for android will stick with the first working platform folder it finds, so it didn't find the opentok.so for me even though it was in every other platform. – th317erd Jul 05 '16 at 23:47