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

Doesn't compile, missing jcardsim #9

Open
7ritn opened this issue Oct 5, 2022 · 1 comment
Open

Doesn't compile, missing jcardsim #9

7ritn opened this issue Oct 5, 2022 · 1 comment

Comments

@7ritn
Copy link

7ritn commented Oct 5, 2022

Hi,

this project doesn't compile when following the steps. It seems like the jcardsim dependency doesn't get pulled.

[~/Development/javacard-gradle-template-edu] git(master) ❱❱❱ gradle buildJavaCard
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
[ant:compile] /home/triton/Development/javacard-gradle-template-edu/applet/src/main/java/main/Run.java:4: error: package com.licel.jcardsim.smartcardio does not exist
[ant:compile] import com.licel.jcardsim.smartcardio.CardSimulator;
[ant:compile]                                      ^
[ant:compile] /home/triton/Development/javacard-gradle-template-edu/applet/src/main/java/main/Run.java:5: error: package com.licel.jcardsim.utils does not exist
[ant:compile] import com.licel.jcardsim.utils.AIDUtil;
[ant:compile]                                ^
[ant:compile] /home/triton/Development/javacard-gradle-template-edu/applet/src/main/java/main/Run.java:12: error: cannot find symbol
[ant:compile]         CardSimulator simulator = new CardSimulator();
[ant:compile]         ^
[ant:compile]   symbol:   class CardSimulator
[ant:compile]   location: class Run
[ant:compile] /home/triton/Development/javacard-gradle-template-edu/applet/src/main/java/main/Run.java:12: error: cannot find symbol
[ant:compile]         CardSimulator simulator = new CardSimulator();
[ant:compile]                                       ^
[ant:compile]   symbol:   class CardSimulator
[ant:compile]   location: class Run
[ant:compile] /home/triton/Development/javacard-gradle-template-edu/applet/src/main/java/main/Run.java:15: error: cannot find symbol
[ant:compile]         AID appletAID = AIDUtil.create("F000000001");
[ant:compile]                         ^
[ant:compile]   symbol:   variable AIDUtil
[ant:compile]   location: class Run
[ant:compile] 5 errors

> Task :applet:buildJavaCard FAILED
[ant:cap] INFO: using JavaCard 3.1.0 SDK in /home/triton/Development/javacard-gradle-template-edu/libs-sdks/jc310b43_kit
[ant:cap] INFO: targeting JavaCard 3.0.4 SDK in /home/triton/Development/javacard-gradle-template-edu/libs-sdks/jc304_kit
[ant:cap] Building CAP with 1 applet from package applet (AID: 01FFFF040506070809)
[ant:cap] applet.MainApplet 01FFFF0405060708090102
[ant:compile] Compiling files from /home/triton/Development/javacard-gradle-template-edu/applet/src/main/java
[ant:compile] Compiling 3 source files to /tmp/jccpro12968740519650334899

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':applet:buildJavaCard'.
> Compile failed; see the compiler error output for details.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5s
1 actionable task: 1 executed

@mistial-dev
Copy link

I'd suspect it would be better to not compile the Run class at all when building for Javacard, but as a workaround it is possible to pull in jCardSim as a dependency.

In the cap section, add the dependency as follows:

        cap {
            packageName 'applet'
            version '0.1'
            aid '01:ff:ff:04:05:06:07:08:09'
            output 'applet.cap'

// ...

            dependencies {
                remote 'com.klinec:jcardsim:3.0.5.11'
            }
        }

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