Codesign error during the creation of the package release distributable on macOs BigSur
Describe the bug
Run the packageReleaseDistributionForCurrentOS command on macOs the build failed with the error:
- Error in the console:
Command: [/usr/bin/codesign, -vvvv, --remove-signature, /compose/tmp/sign/libsodium.dylib]
- Error in the log file created:
/Library/Developer/CommandLineTools/usr/bin/codesign_allocate: fatal error: file not in an order that can be processed (function starts data out of place): /Users/user/IdeaProjects/appname/build/compose/tmp/sign/libsodium.dylib
/Users/user/IdeaProjects/appname/build/compose/tmp/sign/libsodium.dylib: the codesign_allocate helper tool cannot be found or > used
Affected platforms Select one of the platforms below:
- Desktop
Versions
- Kotlin version: 1.8.0
- Compose Multiplatform version: 1.4.2
- OS version(s): macOs BigSur
- OS architecture: x86
- JDK (for desktop issues): 18
To Reproduce Steps and/or the code snippet to reproduce the behavior:
- Download before the main library here
- Then publish to maven local in your machine
- After you need to install the desktop version
- Run the
packageReleaseDistributionForCurrentOScommand - See error in the console
Expected behavior
After run that command should be created the package in the .pkg format for the release distributable
This message is suspicious:
the codesign_allocate helper tool cannot be found or > used
Can you type codesign_allocate in your terminal and ensure that it's installed (should be shipped with Xcode)?
Hi, sorry for the delay for the reply, I tried to execute the command you suggest and this is the response:
user@xxx ~ % codesign_allocate
Usage: /Library/Developer/CommandLineTools/usr/bin/codesign_allocate -i input [[-a <arch> <size>]... [-A <cputype>
<cpusubtype> <size>]... | -r] [-p] -o output
so I don't now if is effectively intalled, have you some tips about? Thanks for the help anyway
It's installed, but the Gradle task can't resolve it for some reason, we'll investigate that.
Yes, thanks you for the help!
I couldn't reproduce it.
BUILD SUCCESSFUL in 1m 47s
9 actionable tasks: 9 executed
14:54:50: Execution finished 'packageReleaseDistributionForCurrentOS'.
It seems like there is some problem with your environment.
Did you run It on a macOs enviroment? Because in the other works correctly
Yes. I'm running Sonoma though.
Please, add this to build.gradle.kts in your desktop sources:
tasks.all {
if (name == "packageReleaseDistributionForCurrentOS") {
doFirst {
println("Current PATH: " + System.getenv("PATH"))
}
}
}
Then check that your resolved PATH contains folder where codesign_allocate resides.
You can look up this folder using locate codesign_allocate.
Thank you, I try right now
Sorry I cannot execute the task, where I need to place that snippet?
In the end of your build.gradle.kts in Pandoro-Desktop.
Okay thanks
Maybe I wrong, but the task is not executed the gradle make only the task of the main task
I can executing the tesk, the result is:
Current PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
The result instead of the locate codesign_allocate is:
/usr/bin/codesign_allocate
/usr/libexec/DeveloperTools/codesign_allocate
Do I have to change the project path?
No, there is /usr/bin in your PATH, and that's where codesign_allocate is contained. I have no idea why you are getting the message about missing executable.
@igordmn can you have a look?
Okay understood, sorry for the request but are days that I try to figure out with this. Again thank you for the help
Hi, any updates about?
Hi, nothing yet?
Sorry I really need build version also for MacOS and that problem is still occurs, what I need to do to build correctly?