【问题标题】:TypeError: Cannot read property 'sdkVersion' of undefined on emit in NativescriptTypeError:无法在 Nativescript 中读取未定义的属性“sdkVersion”
【发布时间】:2021-01-15 05:23:04
【问题描述】:

我正在尝试实现 Nativescript-Webview-Interface。就我而言,在 IOS 模拟器上一切正常,但在从 Native 应用程序到 Webview 的发射/callJSFunction 时在 Android 上出现错误。

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)

【问题讨论】:

标签: webview android-webview nativescript nativescript-vue


【解决方案1】:

您可能像我一样使用更新版本的 nativescript 但已过时的 nativescript-webview-interface 版本。我们已经解决了这个问题

tns 插件更新 nativescript-webview-interface

然后删除此文件,否则您将出现权限被拒绝错误

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

【讨论】:

    猜你喜欢
    • 2018-08-04
    • 2019-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-29
    • 1970-01-01
    相关资源
    最近更新 更多