shripalsoni04 / nativescript-webview-interface

Plugin for bi-directional communication between webView and android/ios
MIT License
89 stars 35 forks source link

ERROR TypeError: Cannot read property 'natiescriptwebviewinterface' of undefined #23

Closed newapx closed 6 years ago

newapx commented 6 years ago

After up-dating on TNS 3.4 the error appears: ERROR TypeError: Cannot read property 'natiescriptwebviewinterface' of undefined

I debug and found out that an error in index.js line

function getAndroidJSInterface(oWebViewInterface){
    var AndroidWebViewInterface = com.shripalsoni.natiescriptwebviewinterface.WebViewInterface.extend

com.shripalsoni is undefined

carrbrpoa commented 6 years ago

Same problem. Found something, @newapx? I thought it was a typo (see it's "natiescriptwebviewinterface", missing the "v"). But even hardcoding the "correct" way, the problem persists.

NickIliev commented 6 years ago

@newapx @carrbrpoa there is an upcoming fix in android-runtime that is about to be patched which will resolve the issue for plugins like nativescript-webview-interface not being built. Stay tuned for versions 3.4.1 of tns-android and you will be able to use nativescript-webview-interface.

hettiger commented 6 years ago

Thank you @NickIliev

Stay tuned for versions 3.4.1 of tns-android and you will be able to use nativescript-webview-interface.

Are there any plans when it comes to ios? When can we expect 3.4.1?

carrbrpoa commented 6 years ago

Meanwhile, FYI, I used a workaround based on https://stackoverflow.com/questions/40294845/nativescript-webview-capture-onclick-event, without the plugin, which satisfies my needs for now.

hettiger commented 6 years ago

@carrbrpoa The fix / version 3.4.1 has already been released. Just execute tns platform remove android && tns platform add android@next. For me it works flawlessly.

shripalsoni04 commented 6 years ago

As mentioned by @hettiger , it seems the issue is resolved in android runtime version 3.4.1 as my demo app of this plugin is working perfectly fine on Android with latest runtime (v 3.4.1) and nativescript versions (v 3.4.1).

sachokD-TC commented 5 years ago

Still have this error. TypeError: Cannot read property 'natiescriptwebviewinterface' of undefined File: "file:///data/data/org.nativescript.preview/files/app/nativescript-webview-interface/index.js, line: 10, column: 50