Jump to content
KimHJ

Android aidl error when using it.

Recommended Posts

I create a JavaInterface file using java2op, but I have problems when I use it. I have attached the JavaInterface.pas

I get this error when it execute printText.

First chance exception at $8689BB93. Exception class EJNIFatal with message 'Java type recieptservice/com/recieptservice/PrinterInterface could not be found'. Process ComcaH10.apk (6409)

 

What is missing?

 

Tanks for any help.

 

uses
JavaInterfaces;

procedure TMainForm.PrintThis;
 var
 Myprinter: JPrinterInterface;
 begin

      MyPrinter := TJPrinterInterface.Create;

      MyPrinter.printText(StringToJString('This Is A Test'));
      MyPrinter.endWork;

 end;

 

JavaInterfaces.pas

Share this post


Link to post
1 minute ago, KimHJ said:

Exception class EJNIFatal with message 'Java type recieptservice/com/recieptservice/PrinterInterface could not be found'

That usually means you have not added the required .jar file (the one you ran Java2OP on) to the project. In Project Manager:

  1. Expand the Android 32-bit target
  2. Right-click on Libraries
  3. Click Add..
  4. Select the .jar file
  5. Click OK

Note that the .jar will be compiled in regardless of whether you compile for 32-bit or 64-bit.

Share this post


Link to post

You are right, I didn't know I had to include the jar file.

 

I have a aidl and a jar, I made the JavaInterface.pas from the aidl, do I need to add that as well?

 

Thanks.

Edited by KimHJ

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×