Steps to reproduce on macOS 26 :
- Git clone the main branch;
- In the swift-java/Samples/JavaKitSampleApp folder, run "swift build";
- The debug build works perfectly, ci-validate.sh passed;
- Then create release build by running "swift build -c release";
- Validate result based on the ci-validate.sh script;
Result:
java -cp .build/plugins/outputs/javakitsampleapp/JavaKitExample/destination/JavaCompilerPlugin/Java -Djava.library.path=.build/release "com.example.swift.JavaKitSampleMain"
Exception in thread "main" java.lang.UnsatisfiedLinkError: 'int com.example.swift.HelloSwift.sayHello(int, int)'
at com.example.swift.HelloSwift.sayHello(Native Method)
at com.example.swift.JavaKitSampleMain.main(JavaKitSampleMain.java:23)
The nm tool shows the release build missing exports native functions similar to debug build:
0000000000002a20 T _Java_com_example_swift_HelloSwift_sayHello
00000000000041d0 T _Java_com_example_swift_HelloSwift_throwMessageFromSwift