Help...Code Signing Issues Causing Unexpectedly Quitting

I am getting a code signing issue that is new and progressively getting worse. The app gives this error after crash. Saving app often hangs Script Debugger too on the portion of Code Signing. Any ideas?

This is what happens now when saving: Code signing failed.

/Users/myname/myapp.app: A timestamp was expected but was not found.

In subcomponent: /myapp.app/Contents/Script Debugger.plist
(1)

When exporting app it doesnt fail but unexpectedly quits and the report shows this:
Termination Reason: Namespace CODESIGNING, Code 0x1

What version of the OS are you running when you sign, and when you see the error? Are you saving/exporting run-only? What version of Script Debugger (please try with 7.0.8 if you haven’t already). Do you have any other items in the app bundle?

Osx 10.13.6 Script Debugger 7.08
I have isolated it to only doing it when I saved as Enhanced which was fine before.

I was able to have improve things by deleting all of my certificates and logging in again in Xcode.
I think the problem started when Xcode updated to the Version 10.1 (10B61) I think it updated in the past 2 days and didnt realize you were using the signing from that. But issues again anything running outside of the main thread crashes it as an enhanced app.
ie: current application’s NSApp’s delegate()'s checkForUpdates:me

I do have lots in the app bundle in scripts and one of your libraries in script libraries and the pub key for sparkle.

Have you tried exporting a run-only version?

Yes. it opens but the check for updates or the example showing the about window item causes it to quit where before it ran fine if it wasn’t in the main thread. I even have an old exported version. I believe it has to do with enhanced app and the certificates issue I had.

I can send u a stripped down app if it’s easier to test

Please send it to me.

For anyone following along, there are some important things to keep in mind:

  • Enhanced Applets run their scripts on a background thread. If you are using ASObjC, any code that deals with interface items needs to be run on the main thread, using performSelectorOnMainThread:withObject:waitUntilDone:.

  • Whenever signing code, you should always check the results before distributing your app. In Terminal:

/usr/sbin/spctl --assess --type exec -vv /path/to/Your.app

The result needs to say accepted and source=Developer ID.

It’s also worth keeping in mind that the signing done by Script Debugger and Script Editor is not adequate for notarizing.

1 Like

Thanks again. Shane! I think the signing issue was related to me being behind a coporate firewall saving and the response timing out or being blocked. It locked up Script Debugger a few times. Verifying is definately key and tip helpful!

The main thread vs the background thread issue seems more sensitive in 7.08 then it was in 7.06. I tried running the older version to test my theory but it wouldnt run since the new release is on my machine…although I agree I was definately pushing the background thread UI boundaries. Can you give me an example of usage of performSelectorOnMainThread:withObject:waitUntilDone: in a subroutine? Its tough to find an example of use. I found an old reference to one on your site but the post was outdated.

As always your knowledge is appreciated.

The issue is not directly related to the version of Script Debugger — it’s the OS. Dealing with interface stuff on background threads has always been illegal, but some infractions used to be ignored, then they started producing console errors, and now they’re throwing full-blown exceptions.

You should find plenty of examples around here. You’re using Dialog Plus Toolkit in your app, so look at its code — it uses it extensively.

Doh! Found it just as your responded. Perfect examples in Dialog Toolkit.

Shane,
With the current version of any Enhanced App I save, if I view the typical About window, it shows it then unexpectedly quits after closing the window. This is the same behavior I am experiencing with any UI, although I broke the rules of background threading and main threading and have since fixed it, I still get the same behavior. Can you confirm if you experience the same issue as an enhanced app set to always keep open? It only started in the most recent release.
Thanks
Dean

Email me an example.

It looks like there’s a bug. Until it’s fixed, you can disable the About… menu item like this:

set aboutMenu to (current application's NSApp's mainMenu()'s itemAtIndex:0)'s submenu()'s itemAtIndex:0
aboutMenu's setAction:(missing value)

Is there a way to run the older debugger version? It happens with any ui interaction even if I’m background thread or updates etc

The Script Debugger 7.0.7 release announcement contains a direct download link:

It goes to the 7.08 page. I have version 7.06 however when I try running it it says my version timed out and to run the latest version. Is there a way to over-ride that or can you send me a beta version of 7.07 that will run?

it says this if I try running any older version I have:
The build of Script Debugger has expired. Contact support@latenightsw.com if you have not already received a notification of a newer build.

Sorry the reason I need this is I use the sparkle update and I am saving out a current version of my enhanced applet and any dialog or ui call causes it to quit if I am using your last release and on client-site otherwise I would be patient until the fix is released.

You can download to Script Debugger 7.0.7 here.

Hey guys…wanted to thank you. The 7.07 version works great as enhanced applet. It helped out in a pinch. Feel free to send beta update when you have time to resolve the bug.

Shane,
Is there a chance you or @alldritt could look at what the differences between 7.07 and the newer versions of Script Debugger causing this bug? I hate having to keep using the older version even for saving. Just a reminder…saving as enhanced app and using update/about menu causes app to quit unexpectedly.

Are you able to move this to new topic? Or should I create a new one?