Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ant build failed #32

Closed
ghost opened this issue Sep 28, 2023 · 4 comments
Closed

ant build failed #32

ghost opened this issue Sep 28, 2023 · 4 comments

Comments

@ghost
Copy link

ghost commented Sep 28, 2023

Hello, I am trying to build the applet using the ant-javacard with the instruction provided in this repo readme but the build is failing.
My system is:

  • macos 13
  • openjdk17 installed
  • ant v1.10.14 installed
    I cloned this repository using git clone --recursive, then invoke ant and the error message is as follows:
BUILD FAILED
/IsoApplet/build.xml:10: Verification failed: Export file 
/IsoApplet/ext/sdks/jc304_kit/api_export_files/javacard/framework/javacard/framework.exp is in unsupported Java Card API export file format. Please use the latest version of the API export files which are in 2.3 Export File format

How to fix the error?
Sorry I rather new to this and no idea how to fix this error, sorry if opened an issue here.

@philipWendland
Copy link
Owner

Hello, I just tried in Arch Linux, it compiles fine. Are you sure that openjdk17 is used instead of a different version?

@ghost
Copy link
Author

ghost commented Sep 29, 2023

Hello, I just tried in Arch Linux, it compiles fine. Are you sure that openjdk17 is used instead of a different version?

Yes, I'm sure of it.

I also tried to build it in my windows machine where it has java 8 installed, and by using the same build.xml it produced the same error. Then I changed the javacard-jckit attribute in the xml to:

<javacard jckit="ext/sdks/jc304_kit">

and it built successfully.

Can you help me understand what is the usage between javacard-jckit attribute and cap-targetsdk attribute?
So, in the provided build.xml, are you specifying to use higher (version) of jckit / sdk to then build the cap which target lower version of jckit/ sdk?. Thank you.

@martinpaljak
Copy link
Contributor

martinpaljak commented Sep 30, 2023

diff --git a/build.xml b/build.xml
index 3f2d786..f395632 100644
--- a/build.xml
+++ b/build.xml
@@ -8,7 +8,7 @@
     <target name="dist" description="generate the distribution">
         <tstamp/>
         <javacard jckit="ext/sdks/jc310r20210706_kit">
-            <cap targetsdk="ext/sdks/jc304_kit" aid="f2:76:a2:88:bc:fb:a6:9d:34:f3:10" output="IsoApplet.cap" sources="src" version="1.0">
+            <cap targetsdk="3.0.4" aid="f2:76:a2:88:bc:fb:a6:9d:34:f3:10" output="IsoApplet.cap" sources="src" version="1.0">
                 <applet class="xyz.wendland.javacard.pki.isoapplet.IsoApplet" aid="f2:76:a2:88:bc:fb:a6:9d:34:f3:10:01"/>
             </cap>
         </javacard>

Set the targetsdk to "3.0.4". The reason why it probably work for you @philipWendland is that the ant-javacard.jar file is already present and older version. Clean checkout failed for me as well (other option would be to use a different javacard kit from 3.0.X series instead of 3.1)

@mario-jaya jckit identifies the javacard SDK which converter is used, targetsdk indicates the target platform for the applet. With JC devkit 3.1 new version of export files was introduced and that needs adjustments in workflows. See also martinpaljak/ant-javacard#92

@philipWendland
Copy link
Owner

Thank you, I fixed this on the main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants