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

JNA issue on MacOS after publishing to TestFlight #158

Open
bartwell opened this issue Nov 21, 2024 · 4 comments
Open

JNA issue on MacOS after publishing to TestFlight #158

bartwell opened this issue Nov 21, 2024 · 4 comments

Comments

@bartwell
Copy link

Hello,

Thank you for so useful library.

I've faced with issue on MacOS, presumably after update of MacOS and xCode. It's shows an JNA error and then crashes. Here is the text of error:

/Users/user/Library/Containers/com.site.myapp/Data/tmp/jna9436987196270821361.tmp: dlopen(/Users/user/Library/Containers/com.site.myapp/Data/tmp/jna9436987196270821361.tmp, 0x0001): tried:
/Users/user/Library/Containers/com.site.myapp/Data/tmp/jna9436987196270821361.tmp (code signature in <BEFEF0FB-C7C5-305A-8B79-ED4851A90E7F> '/Users/user/Library/Containers/com.site.myapp/Data/tmp/jna9436987196270821361.tmp' not valid for use in process: library load disallowed by system policy),
/System/Volumes/Preboot/Cryptexes/OS/Users/user/Library/Containers/com.site.myapp/Data/tmp/jna9436987196270821361.tmp (no such file),
'/Users/user/Library/Containers/com.site.myapp/Data/tmp/jna9436987196270821361.tmp' not valid for use in process: library load disallowed by system policy

Here is a sample code:

    val result = remember { mutableStateOf(listOf<Path>()) }
    Text(text = result.value.joinToString("\n"))

    val directoryLauncher = rememberDirectoryPickerLauncher(title = Strings.current.app_name) { directory ->
        directory?.file?.absolutePath?.let { result.value = listOf(Path(it)) }
    }
    Button(
        onClick = {
            directoryLauncher.launch()
        },
    ) {
        Text(text = "Open")
    }

Library version 0.8.7.

Could you please help with this issue?

Thank you.

@vinceglb
Copy link
Owner

Hello @bartwell! Thank you for your feedback!

I'm trying to reproduce your issue.

  • What is your macOS and Xcode version?
  • Does the sample-compose work on your device?

@bartwell
Copy link
Author

@vinceglb, sorry for not mentioning the key detail earlier: this issue occurs only in sandbox mode after publishing to TestFlight, so I can't reproduce it in the sample application.
I am using macOS Sequoia 15.1 (24B83) and Xcode 16.1 (16B40).

@bartwell bartwell changed the title JNA issue on MacOS JNA issue on MacOS after publishing to TestFlight Nov 21, 2024
@vinceglb
Copy link
Owner

Thank you for the information. Interesting 🤔

The bad news here is I don't have anymore an Apple Developer subscription to test the behavior.

I found this thread that can help us fix the problem:
https://groups.google.com/g/jna-users/c/Bws1h060faA

@bartwell
Copy link
Author

Thank you for the link. It seems like the solution might be:

System.setProperty("jna.nounpack", "true");
System.setProperty("jna.boot.library.path", "<path to native libs>");

However, could you clarify what path should be specified here? As far as I can tell, the directories inside /Applications/MyApp.app/Contents/ are writable only by root.

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