KimHJ 2 Posted November 8 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
Dave Nottage 554 Posted November 8 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: Expand the Android 32-bit target Right-click on Libraries Click Add.. Select the .jar file 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
KimHJ 2 Posted November 8 (edited) 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 November 8 by KimHJ Share this post Link to post
KimHJ 2 Posted yesterday at 03:19 AM I added the jar file, I did not see anything about adding the aidl in Embarcadero's website about jar files. Now I get an exception class 6 in Andoidapi.JNIBridge in class procedure TBridgeHelper.Alloc Could this be because I used the aidl file to create the JavaInterfaces.pas? Share this post Link to post
Dave Nottage 554 Posted yesterday at 05:03 AM 1 hour ago, KimHJ said: I did not see anything about adding the aidl in Embarcadero's website about jar files. That's because you don't need to. 1 hour ago, KimHJ said: Could this be because I used the aidl file to create the JavaInterfaces.pas? Possibly - the Java signatures in that file look a bit odd. Is the .jar file available publicly? Share this post Link to post
KimHJ 2 Posted 19 hours ago Yes, I will create a new java2op using the jar. Share this post Link to post