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

MacOS .pkg application do not start after installing. "Extensions" file missing from app bundle #1531

Open
lRaulMN7 opened this issue Jan 5, 2023 · 1 comment

Comments

@lRaulMN7
Copy link

lRaulMN7 commented Jan 5, 2023

Hello! I've been trying to create a .pkg that I can forward to other mac users to use my application.
This is my current build.sbt

val scala3Version = "3.2.1"

enablePlugins(JDKPackagerPlugin)
enablePlugins(JavaAppPackaging)
Compile / mainClass := Some("com.myname.desktop.QaInterface")
Compile / discoveredMainClasses := Seq()

jdkPackagerType := "pkg"
name := "QaInterface"
maintainer := "myname"
packageSummary := "test"
packageDescription := "testing"

version := "0.1.3-SNAPSHOT"
jdkPackagerProperties := Map("app.name" -> name.value, "app.version" -> version.value)

jdkPackagerAppArgs := Seq(maintainer.value, packageSummary.value, packageDescription.value)

ThisBuild / assemblyMergeStrategy := {
    case PathList("META-INF", _*) => MergeStrategy.discard
    case _ => MergeStrategy.first
}

lazy val root = project
  .in(file("."))
  .settings(
    name := "QaInterface",
    version := "0.1.3-SNAPSHOT",
    assembly / mainClass := Some("com.myname.desktop.QaInterface"),
    scalaVersion := scala3Version,
    libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "2.1.0",
    libraryDependencies += "org.scalafx" %% "scalafx" % "18.0.2-R29"
  )

QaInterface looks like this:

object QaInterface extends JFXApp3{

    override def start(): Unit = {
      stage = new PrimaryStage {
        title = "QaInterface - "
        width = 650
        height = 450
        scene = new Scene {
          fill = Black
          }
        }
      }
  }

This works when I run it from the script, jar file, running from IntelliJ, but when trying to do a pkg using
sbt jdkPackager:packageBin

After successfully installing the app using the installer, when I execute it, it crashes, reporting the following error in the macos console:
Non-fatal error enumerating at <private>, continuing: Error Domain=NSCocoaErrorDomain Code=260 "The file “Extensions” couldn’t be opened because there is no such file." UserInfo={NSURL=Extensions/ -- file:///Applications/QaInterface.app/Contents/, NSFilePath=/Applications/QaInterface.app/Contents/Extensions, NSUnderlyingError=0x7fe0a7f09f30 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

I'm completely lost because I'm not doing any references to an "Extensions" folder in my code and also the documentation of jdkpackager withing sbt-native-packager doesn't mention it. Does anybody have an idea of why this could be happening? I've been researching, and this "Extension" file is not supposed to exist in the app bundle, right?

Using addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.9")
% sbt -version
sbt version in this project: 1.8.0
sbt script version: 1.8.0

MacOs Ventura 13.0.1

@muuki88
Copy link
Contributor

muuki88 commented Apr 24, 2023

Thanks @lRaulMN7 for your issue. It's been years since I heard from the last mac user.

I'm not sure if this integration still works. Neither can I help with any MacOS related topics :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants