TypeError: Cannot read property 'sdkVersion' of undefined on emit in Nativescript

494 views Asked by At

I'm trying to implement Nativescript-Webview-Interface. In my case, everything is working fine on the IOS emulator, but getting an error on the Android when emit/callJSFunction from Native app to Webview.

chromium: [WARNING:dns_config_service_posix.cc(342)] Failed to read DnsConfig.
System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method onTouch failed
System.err: TypeError: Cannot read property 'sdkVersion' of undefined
System.err: 
System.err: StackTrace:
System.err: WebViewInterface._executeJS(file: node_modules/nativescript-webview-interface/index.android.js:78:32)
System.err:     at push.../node_modules/nativescript-webview-interface/index-common.js.WebViewInterface.emit(file: node_modules/nativescript-webview-interface/index-common.js:153:9)
System.err:     at goToPage(file: app/components/Home.vue:145:0)
System.err:     at tap(file: app/components/Home.vue?499f:93:0)
System.err:     at invokeWithErrorHandling(file: node_modules/nativescript-vue/dist/index.js:1862:25)
System.err:     at invoker(file: node_modules/nativescript-vue/dist/index.js:2526:13)
System.err:     at _executeCallback(file: app/packages/core/ui/gestures/index.android.ts:414:20)
1

There are 1 answers

0
Orlando Jr. Sarceda On

you are probably using updated version of nativescript but outdated version of nativescript-webview-interface just like me. We have solve this by

tns plugin update nativescript-webview-interface

then delete this file or you will have permission denied error

app\build\intermediates\signing_config\debug\out\signing-config.json