Desktop app for Mac crash when running packaged app
I made Compose Desktop application, but it keeps immediately closing after startup of the App inside dmg.
runDistributable - successfully run the App.
I've tried to run it from Terminal:
./MyApp.app/Contents/MacOS/MyApp and it shows error:
"Error opening "/PathToApp/MyApp.app/Contents/Contents/app/MyApp.cfg" file: No such file or directory" - I was surprised by the duplication of Contents directory.
When I moved MyApp.app/Contents/MacOS/MyApp to MyApp.app/Contents/MyApp and run it from Terminal - it successfully started.
I am using:
- compose 0.4.0
- kotlin 1.5.10
- java 15.0.2
@imptah can you share a sample reproducible project?
ComposeBug.zip Here is reproducer from https://github.com/JetBrains/compose-jb/issues/928 (looks like the same issue)
@imptah can you share a sample reproducible project?
Sorry for the long reply. I have figured out the issue. It was related to the creation of the new files inside the packaged App. After switching off logging and making the database work in memory, the App successfully started.
Here is the sample that reproduces it. It's just a template App with the creation of a File in fun main(). If you run packaged App in .dmg, it will close immediately. If you do runDistributable, it will create the file and run the App.
Maybe it is somehow related to the permissions inside the MacOS ecosystem? Do you have any ideas on how it can be fixed?
Reproduced with v1.0.0-alpha3 as well
Issue still exists with 1.3.0. Mostly related to Mac Permissions
As @anikrajc mentioned. The issue still exists.
I'm using SqlDelight with KMM project. The packaged app fails when start the application from generated *.app file (packageDMG). But if I start the app from Contents/MacOs/ it works. If I configure SqlDelight to use IN_MEMORY it works fine. It seems an issue with write permissions of the starting process.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.