I'm trying to build a native quarkus application (Apple M2 Max chip), however I am using the library jSerialComm for serial communication.
Upon building quarkus via:
$ /mvn install -Dnative
I receive the following error:
Detailed message:
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:126)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:810)
... 6 more
Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: com.fazecast.jSerialComm.android.AndroidPort.getCommPortsNative(). This error is reported at image build time because class com.fazecast.jSerialComm.SerialPort is registered for linking at image build time by command line and command line.
Or short:
This error is reported at image build time because class com.fazecast.jSerialComm.SerialPort is registered for linking at image build time by command line and command line.
Is there a way to fix this error or are libraries that are registered for linking at image build time by command line or command line and native builds incompatible?
this is common issue when using libraries not supported by Quarkus. The cause behind it is usually some missing dependency on the classpath.
Please have a look at this FAQ entry of Quarkus' Native Reference Guide for more info.