Delphi Android SDK EPSON-找不到调用错误方法

时间:2018-11-19 09:24:13

标签: android delphi sdk

我收到以下错误EJNIFatal异常:为TM M30(蓝牙)实现EPSON打印机SDK时找不到方法 com.epson.epos2.discovery.Discovery

界面

unit com.epson.epos2.discovery.Discovery;

interface

uses
  AndroidAPI.JNIBridge,
  Androidapi.JNI.JavaTypes,
  com.epson.epos2.discovery.DiscoveryListener,
  com.epson.epos2.discovery.FilterOption,
  Androidapi.JNI.GraphicsContentViewText,
  com.epson.epos2.discovery.DeviceInfo;

type
  JDiscovery = interface;

  JDiscoveryClass = interface(JObjectClass)
    ['{D8B21BB2-D0C7-4654-AAFB-61B39334F3F1}']
    function GetFILTER_NAME : Integer; cdecl;                                  //  A: $19
    function GetFILTER_NONE : Integer; cdecl;                                  //  A: $19
    function GetMODEL_ALL : Integer; cdecl;                                    //  A: $19
    function GetPORTTYPE_ALL : Integer; cdecl;                                 //  A: $19
    function GetPORTTYPE_BLUETOOTH : Integer; cdecl;                           //  A: $19
    function GetPORTTYPE_TCP : Integer; cdecl;                                 //  A: $19
    function GetPORTTYPE_USB : Integer; cdecl;                                 //  A: $19
    function GetTYPE_ALL : Integer; cdecl;                                     //  A: $19
    function GetTYPE_CAT : Integer; cdecl;                                     //  A: $19
    function GetTYPE_CCHANGER : Integer; cdecl;                                //  A: $19
    function GetTYPE_DISPLAY : Integer; cdecl;                                 //  A: $19
    function GetTYPE_HYBRID_PRINTER : Integer; cdecl;                          //  A: $19
    function GetTYPE_KEYBOARD : Integer; cdecl;                                //  A: $19
    function GetTYPE_MSR : Integer; cdecl;                                     //  A: $19
    function GetTYPE_OTHER_PERIPHERAL : Integer; cdecl;                        //  A: $19
    function GetTYPE_POS_KEYBOARD : Integer; cdecl;                            //  A: $19
    function GetTYPE_PRINTER : Integer; cdecl;                                 //  A: $19
    function GetTYPE_SCANNER : Integer; cdecl;                                 //  A: $19
    function GetTYPE_SERIAL : Integer; cdecl;                                  //  A: $19
    function init : JDiscovery; cdecl;                                          // ()V A: $1
    procedure start(context : JContext; filterOption : JFilterOption; listener : JDiscoveryListener) ; cdecl;// (Landroid/content/Context;Lcom/epson/epos2/discovery/FilterOption;Lcom/epson/epos2/discovery/DiscoveryListener;)V A: $29
    procedure stop ; cdecl;                                                     // ()V A: $29
    property FILTER_NAME : Integer read GetFILTER_NAME;                        // I A: $19
    property FILTER_NONE : Integer read GetFILTER_NONE;                        // I A: $19
    property MODEL_ALL : Integer read GetMODEL_ALL;                            // I A: $19
    property PORTTYPE_ALL : Integer read GetPORTTYPE_ALL;                      // I A: $19
    property PORTTYPE_BLUETOOTH : Integer read GetPORTTYPE_BLUETOOTH;          // I A: $19
    property PORTTYPE_TCP : Integer read GetPORTTYPE_TCP;                      // I A: $19
    property PORTTYPE_USB : Integer read GetPORTTYPE_USB;                      // I A: $19
    property TYPE_ALL : Integer read GetTYPE_ALL;                              // I A: $19
    property TYPE_CAT : Integer read GetTYPE_CAT;                              // I A: $19
    property TYPE_CCHANGER : Integer read GetTYPE_CCHANGER;                    // I A: $19
    property TYPE_DISPLAY : Integer read GetTYPE_DISPLAY;                      // I A: $19
    property TYPE_HYBRID_PRINTER : Integer read GetTYPE_HYBRID_PRINTER;        // I A: $19
    property TYPE_KEYBOARD : Integer read GetTYPE_KEYBOARD;                    // I A: $19
    property TYPE_MSR : Integer read GetTYPE_MSR;                              // I A: $19
    property TYPE_OTHER_PERIPHERAL : Integer read GetTYPE_OTHER_PERIPHERAL;    // I A: $19
    property TYPE_POS_KEYBOARD : Integer read GetTYPE_POS_KEYBOARD;            // I A: $19
    property TYPE_PRINTER : Integer read GetTYPE_PRINTER;                      // I A: $19
    property TYPE_SCANNER : Integer read GetTYPE_SCANNER;                      // I A: $19
    property TYPE_SERIAL : Integer read GetTYPE_SERIAL;                        // I A: $19
  end;

  [JavaSignature('com/epson/epos2/discovery/Discovery')]
  JDiscovery = interface(JObject)
    ['{1CA6140A-C36C-454F-81D9-81DD7B66281B}']
    procedure start(context : JContext; filterOption : JFilterOption; listener : JDiscoveryListener) ; cdecl;// (Landroid/content/Context;Lcom/epson/epos2/discovery/FilterOption;Lcom/epson/epos2/discovery/DiscoveryListener;)V A: $29
    procedure stop ; cdecl;
  end;

  TJDiscovery = class(TJavaGenericImport<JDiscoveryClass, JDiscovery>)
  end;

我的代码如下

procedure TForm1.Button1Click(Sender: TObject);
var
 ldiscover : TJDiscovery;
 ldis      : JDiscovery;
begin
 ldis :=  TJDiscovery.JavaClass.init; //<----- Error here

end;

有人可以提供帮助吗?找不到方法? (delphi / android处理API的方式是否有问题,“未找到方法”的问题已经全部解决,但是没有解决方案)

使用东京10.2

0 个答案:

没有答案