pomodoro icon indicating copy to clipboard operation
pomodoro copied to clipboard

Error Building Application

Open cgardner opened this issue 11 years ago • 10 comments

I'm trying to build the application on OSX 10.7.5 with XCode 4.5.2 and I keep getting an error. I've tried the instructions in #283 but it isn't working.

The error is:

OSACompile Pomodoro/scripts/getToDoListFromReminders.applescript cd /Users/cgardner/src/pomodoro/repo /usr/bin/osacompile -l AppleScript -d -o /Users/cgardner/Library/Developer/Xcode/DerivedData/Pomodoro-ezliufhegysjlzebiegksrzilwrg/Build/Intermediates/ArchiveIntermediates/Pomodoro/InstallationBuildProductsLocation/Applications/Pomodoro.app/Contents/Resources/getToDoListFromReminders.scpt Pomodoro/scripts/getToDoListFromReminders.applescript

Pomodoro/scripts/getToDoListFromReminders.applescript:7: error: Expected “then”, etc. but found class name. (-2741) Command /usr/bin/osacompile failed with exit code 1

cgardner avatar Jan 19 '13 18:01 cgardner

I'm having a similar error. OSX 10.7.5 with XCode 4.6.

Very confusing. I'm a bit of a novice with building apps, unfortunately, so I'm running around in circles.

OSACompile Pomodoro/scripts/getToDoListFromReminders.applescript cd "/Users/seggix/Downloads/pomodoro-master 2" /usr/bin/osacompile -l AppleScript -d -o /Users/seggix/Library/Developer/Xcode/DerivedData/Pomodoro-esredelmrnrmbaeugeioyoednmsw/Build/Products/Release/Pomodoro.app/Contents/Resources/getToDoListFromReminders.scpt Pomodoro/scripts/getToDoListFromReminders.applescript

2013-02-07 17:20:54.256 osacompile[92316:f07] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find: /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper osacompile: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers. Pomodoro/scripts/getToDoListFromReminders.applescript:7: error: Expected “then”, etc. but found class name. (-2741) Command /usr/bin/osacompile failed with exit code 1

seggix avatar Feb 08 '13 06:02 seggix

It looks like you can't even compile Applescripts that reference Libraries that aren't installed (Reminders and Messages, introduced in 10.8). I'm not sure what the proper way around this is. When I try to compile on 10.7 I get this too. You can patch around it by just deleting the applescript.

I'd like to open up a conversation about the "right" solution to this. I can see several possibilities.

  • Modify the project to not compile the applescripts but include them in the bundle. Then when they are launched they are compiled on demand. Fixes the problem in that you should be able to build the app regardless of what's in the applescripts. Creates a new problem in that script compilation will fail at runtime. We can catch these errors at runtime, though, so you can still use the app.
  • Modify the project to conditionally compile specific applescripts based on what's available on the platform you're compiling for. It'd be more difficult since you can't #ifdef inside applescripts and the script files are currently part of the pbx file. Not sure but you might be able to do this with a build phase. Creates the new problem that the target applescripts will not be found in the bundle when accessed.

Both fixes don't address the problem that these features won't be available anyway on the specific OS X versions. That'd be a separate, UI issue. Any opinions on how best to support building and running in older OSX while still providing access to new services in 10.8?

partlyhuman avatar Feb 08 '13 21:02 partlyhuman

Is it possible to include the scripts when building for specific platforms?

cgardner avatar Feb 09 '13 19:02 cgardner

It might be, using a custom build phase that modifies which files are going to be compiled. I think including all the applescripts as source without compiling them ahead of time is a better idea. I can't test it on 10.7 until I get back to my desktop in a few days but maybe you can try out this branch and let me know if it allows you to build? https://github.com/partlyhuman/pomodoro/tree/dont-precompile-applescripts

partlyhuman avatar Feb 09 '13 21:02 partlyhuman

Good news: Successfully Built!

Bad news: Was not able to export. Got error "The operation couldn’t be completed. (OSStatus error 100021.)"

Tried with targets 10.6 and 10.7. Not sure what the issue is. Is there a known work around to this? Couldn't seem to find any solved issues of this nature.

seggix avatar Feb 12 '13 00:02 seggix

@seggix, by export do you mean Archive? Are you still using OSX 10.7.5 with XCode 4.6? Is there any additional compiler output immediately before this error message, and if so can you post it here? I will be able to try building on a 10.7 machine tomorrow, I'll report back to this thread.

partlyhuman avatar Feb 12 '13 01:02 partlyhuman

Yep, same stats as before.

I do mean export. I'm able to archive to the point where the organizer shows up, and I see the most current archive. I then follow the instructions.

  • Click "Distribute"

  • Click "Export as" and choose "Application" from the drop-down menu

  • Prompted by a page asking me to "Choose an Identity to sign with:" The two drop down options here are:

    1. Don't Re-sign
    2. Refresh Code Signing Identity...

Option 1 results in the error I've posted above, with no additional prompting.

Option 2 brings me to a page where I can enter my username and password to log in to my mac dev center account, but entering my information and clicking "Next" simply says scrolls through: "Connecting... Downloading... Building..", respectively, very briefly in succession, then just refresh's the previous 'Identity' page.

So close! I'm working with the free dev account, does that make any difference?

seggix avatar Feb 12 '13 03:02 seggix

I'm facing the same issue. Is there any way to "distribute" without code signing the application. I don't want to buy a $99 certificate.

filipiz avatar Mar 04 '13 20:03 filipiz

FYI, the solution in https://github.com/ugol/pomodoro/issues/286 fixed it for me

wavded avatar Mar 04 '13 20:03 wavded

partlyhuman, your works for me flawlessly after I spent 3 hours trying to get this one to work.

shokk avatar Sep 08 '13 03:09 shokk