crotwell / gradle-macappbundle

A Gradle Plugin to create a Mac OSX .app application and dmg based on the project.
Apache License 2.0
94 stars 33 forks source link

Created application cannot be notarized for Mac OS Mojave #71

Open olegs opened 4 years ago

olegs commented 4 years ago

I try to build and application, and notarize it at Apple. At the moment I cannot do this because of the error.

    {
      "severity": "error",
      "code": null,
      "path": "App.app/Contents/MacOS/JavaAppLauncher",
      "message": "The binary uses an SDK older than the 10.9 SDK.",
      "docUrl": null,
      "architecture": "x86_64"
    }

Any chance that we can have JavaAppLauncher updated?

chrisvire commented 4 years ago

Where is JavaAppLauncher coming from? I need a replacement so that I can submit apps for Notarization. I would submit a PR if I knew how to rebuild it.

chrisvire commented 4 years ago

I see that @olegs forked to include JavaAppLauncher from https://github.com/i-net-software/SetupBuilder. Could we get an update for this?

olegs commented 4 years ago

@chrisvire As far as I understand originally JavaAppLauncher comes from OpenJDK7 https://svn.java.net/svn/appbundler~svn Unfortunately it is not available at the moment. I found the following fork repository: https://github.com/TheInfiniteKind/appbundler It contains source code and build instructions for JavaAppLauncher, however there were some problems building it on my machine from sources.

chrisvire commented 4 years ago

What about using javapackager from JDK?

chrisvire commented 4 years ago

@crotwell, can you find the source for JavaAppLauncher? Please?

I had the JavaAppLauncher from https://github.com/i-net-software/SetupBuilder working for me. However, just before releasing, I am seeing this Java2d crash: https://bugs.openjdk.java.net/browse/JDK-8244818

I don't see this crash with the JavaAppLauncher included in the repo. I REALLY need the source of the JavaAppLauncher that is include in the repo.

I tried taking the source (main.m) from both https://github.com/i-net-software/SetupBuilder and https://github.com/TheInfiniteKind/appbundler and build them using this makefile:

CC=clang
CFLAGS=-x objective-c -mmacosx-version-min=10.12 -I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/darwin
LIB=-framework Foundation -framework Cocoa

JavaAppLauncher: main.m
    $(CC) $(LIB) -o $@ $(CFLAGS) $<

.PHONY: clean

clean:
    rm -f JavaAppLauncher

Using either of these, my app crashes when I drag the main window from the primary monitor to the secondary monitor and then back. If I use the JavaAppLauncher that is included in this repo, then I don't see the crash. However, this binary has LC_VERSION_MIN_MACOSX set to 10.7 and notarization require 10.9 or higher.

See: https://osxapps-ssl.itunes.apple.com/itunes-assets/Enigma114/v4/2b/d4/23/2bd42342-15ec-3a17-79fa-448aa3f7f10f/developer_log.json?accessKey=1593985764_2136733404120591835_9D1VT8D9yQ5ZAMFA%2B9ohC8t4CIJ8zq6TwUw9L3aZHAN1Xw2TD%2BhhgOkWsIoq14BtMGGlX5AoC7Qz5MGabeNg7BG4G5q03Wd6koyraCCUIOODlCM5OK74TNP9G%2F9TuFe0hgjvLe%2FRq18UIswdAadhrPQjiA0BTAz1peeoiG8mC7Y%3D

chrisvire commented 4 years ago

@crotwell , @olegs : I found a version of JavaAppLauncher from OpenJDK7: https://github.com/openjdk-mirror/jdk7u-jdk/tree/master/src/macosx/bundle/appbundler/native

However, it is not the same as what is included in this repo. It is expecting the full JDK and not the JRE (different parameters in the Info.plist).

crotwell commented 4 years ago

Sorry, I am no longer developing java mac apps and don't have time to devote to this project currently. If you have a pull request I can look at it.

I do not remember where the JavaAppLauncher came from, pretty sure I did not compile it. Best guess is it was included with the JDK from Oracle, but that might have been Java6.

You can set the launcher program to another executable using the bundleExecutable property. That said, I think the java world has changed the way apps are packaged in the intervening time and this plugin may no longer be the best choice since it uses an older style.