compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

Desktop app for Mac crash when running packaged app

Open imptah opened this issue 4 years ago • 6 comments

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 avatar Jul 19 '21 12:07 imptah

@imptah can you share a sample reproducible project?

AlexeyTsvetkov avatar Jul 19 '21 14:07 AlexeyTsvetkov

ComposeBug.zip Here is reproducer from https://github.com/JetBrains/compose-jb/issues/928 (looks like the same issue)

akurasov avatar Jul 23 '21 05:07 akurasov

@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?

NewFileError.zip

imptah avatar Jul 29 '21 00:07 imptah

Reproduced with v1.0.0-alpha3 as well

imptah avatar Aug 15 '21 11:08 imptah

Issue still exists with 1.3.0. Mostly related to Mac Permissions

anikrajc avatar Mar 05 '23 18:03 anikrajc

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.

Kevin-Case avatar Apr 18 '23 09:04 Kevin-Case

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov avatar Jul 14 '24 16:07 okushnikov