Skip to content

Unable to use Swift function that returns String on Java side #216

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

Open
dieter115 opened this issue Feb 25, 2025 · 0 comments
Open

Unable to use Swift function that returns String on Java side #216

dieter115 opened this issue Feb 25, 2025 · 0 comments

Comments

@dieter115
Copy link

dieter115 commented Feb 25, 2025

I'm using jextract-swift to create Java Classes for the Sources/MySwiftLibrary/SwiftKitSamleApp for the sample SwiftKitSampleApp.

I created the following function just to test something in HelloJava2Swift.swift

public func retrieveToken() -> String {
  return "test"
}

But when I try to do the following in MySwiftLibraryTest.java

@Test
    void call_retrieveToken() {
        MySwiftLibrary.retrieveToken();
        assertNotNull(MySwiftLibrary.retrieveToken$address());
    }

It gives the following error

Image

I'm probably forgetting something important.

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

1 participant