Anders Carlsen
04/06/2024, 11:14 AMproductbuild: error: Cannot write product to "/Users/<user>/projects/<projectfolder>/build/compose/binaries/main-release/pkg/app-1.0.0.pkg". (Could not find appropriate signing identity for "3rd Party Mac Developer Application: <name> <teamid>" in keychain at "/Users/<user>/Library/Keychains/login.keychain-db". An installer signing identity (not an application signing identity) is required for signing flat-style products
As I understand it your “3rd Party Mac Developer Application *” certificate is used to sign app files but the installer (pkg) needs to be signed by “”3rd Party Mac Developer Installer *” certificate. I can only define one certificate in build.gradle.kts with signing.identity.set. How do I define the installer certificate to be used for the pkg step?
If I check the intermediate files they seem to be properly signed by the Application certificate.Chris Athanas
04/18/2024, 8:25 PM.pkg
to TestFlight.
To answer your immediate problem, you are using the “fully qualified” signing identity, but all you need to use is the Name portion, not the fully qualified name. So, just use your “Name” here instead.
The problem I’m now facing is dealing with libraries. Everything works fine locally. Since there are no instructions on how to upload a .pkg
to the AppStore step-by-step for MacOS (that I can find anywhere), I am hacking through it.
I was eventually able to get the .pkg
built, signed and uploaded via Transporter and put into Testflight. But when I loaded the App from TestFlight, none of the libraries worked (Ktor, VLCplayer)
I was hacking around trying a bunch of things and got this to work a couple times, but now it’s broken again, but I am unable to reproduce it now… I will continue to work thru my steps to get a reproducible case.
Given there is no documentation on how to actually do this, I’m now wondering if this is even currently possible (ie: to sign and upload a compose-desktop MacOS app to TestFlight and eventually AppStore distribution.)
Has anyone actually accomplished this yet, or am I on the bleeding edge here again?
Here’s the permalink to my current attempt:
https://github.com/realityexpander/CloudCoverUSA2
Have you had any more success?Chris Athanas
04/18/2024, 10:38 PMcompose-plugin = "1.6.10-dev1584"
and I am now able to create the correct signed MacOS App with the proper
minimumSystemVersion = "12.0"
package and upload via Transporter to the AppStore TestFlight.
The App is available in TestFlight, and when I download and install the App, the UI appears and runs fine.
I have some ktor network calls at startup and these are not being fired.
I integrated the VLC player, and when I try to open the player I get the following errors Any hints here? The errors only appear when I attempt to use a VLC player, which is a java library.
It seems like the libraries are not being signed? Is there any suggestions on this?
all my code is at: https://github.com/realityexpander/CloudCoverUSA2Chris Athanas
04/18/2024, 11:20 PMConsole.app
and I’m seeing these errors:
Any ideas about whats going wrong?Chris Athanas
04/19/2024, 1:50 AMentitlements.plist
and uploaded a new .pkg
and now my network calls from the ktor-client are working!
But still, any attempt to play a movie with the VLCJ library with “malicious software” warning.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "<http://www.apple.com/DTDs/PropertyList-1.0.dtd>">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
<key>com.apple.application-identifier</key>
<string>XXXXXXXXXX.com.realityexpander.cloudcoverusa2</string>
<key>com.apple.developer.team-identifier</key>
<string>XXXXXXXXXX</string>
<!-- Add additional entitlements here, for example for network or hardware access. -->
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
</dict>
</plist>
Is there a special step needed to add the VLCJ library? The Ktor library loaded fine…Chris Athanas
04/19/2024, 4:30 PMAnders Carlsen
04/19/2024, 5:41 PMappResourcesRootDir.set(project.layout.projectDirectory.dir("resources"))
the tricky part is getting the getting them loaded so they are used, in my example using jni I had to put this at start of main function:
val resources = File(System.getProperty("compose.application.resources.dir"))
System.setProperty("jna.library.path", resources.absolutePath)
don’t know what it is for VLCJ or if support loading deps like this..
I think there is another option to repackage the library jar (or whatever format it is) and pre-sign the files that are extracted at runtime..Chris Athanas
04/19/2024, 7:54 PM.pkg
’s, not individual files.
3. Given that works, are you saying I should place these signed files into a resources directory, and then call System.loadLibrary("vlcj")
? Or System.load("/resources/libvlcj.jar")
?
4. Do you know of any example projects that are set up to create MacOS apps uploaded to TestFlight? That include java swing libraries?
The VideoPlayer
sample that i’m using is coming from the compose-desktop example code, yes the experimental folder!
I’m assuming at this point that this may not be possible yet, or no one has actually tried it, as it’s partially documented and looks like an exercise left for the reader… (“it’s theoretically possible, but no one has done it yet?“)Anders Carlsen
04/19/2024, 8:32 PMChris Athanas
04/19/2024, 9:42 PMfeed-flow
project, and now I’m seeing loading java libraries requires much deeper gradle scripting skill than I currently have.
It seems that you have to disable the default tasks and configure the entire project, which is beyond my scope of capabilities, as it requires much deeper knowledge of gradle than I have ability to acquire at this moment, as my primary is Android, Web and iOS… Gradle is a total headache of strange error messages and requires deep-fu to get it right.
I don’t see any swing libraries used in his project.
I think I have wait to see if a better example appears, or a way to implement video directly in compose-desktop natively.
I previously had good success using a webview to display video using compose-desktop. It seemed a little heavy-handed to just display a video, which is why I attempted this route to use the swing VideoPlayer
library.
It seems like no one has done a tutorial on how to package this library within the desktop application for distribution on MacOS yet, so this shall remain a mystery until a gradle wizard takes on the challenge! I am not that wizard!Anders Carlsen
04/20/2024, 10:28 AMChris Athanas
04/24/2024, 6:48 PM