有没有人遇到过调用Android本机代码的nativescript插件的问题?

时间:2019-05-30 19:06:30

标签: nativescript-angular nativescript-plugin

我正在围绕本机Android SDK开发本机脚本插件。 我必须子类化本地android抽象类 下面是我执行此操作的方法:-

declare var com: any;
class MyCallBackClass extends com.xy.ab.mn.somesdk { 
  //com.xy.ab.mn.somesdk is from third party native android library and is an abstract class

  //overridden methods and other variables
} 

class MySDKClass {
  myCallBack: any; 
  constructor() {
     this.myCallBack = new MyCallBackClass()
  }
}

所有这些都是在插件中完成的。当我使用命令npm run plugin.tscwatch调试插件时,一切正常。但是,当我将插件打包到.tgz文件中并在我的应用中使用它时,出现以下错误:-

运行应用程序时,出现如下运行时错误:- System.err: TypeError: Cannot read property 'ab' of undefined

如果有人遇到上述问题并有解决方案,请提供帮助。

谢谢。

0 个答案:

没有答案