Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
Hi all,

I developed a simple application in Snow Leopard. The build configurations at which it was compiled in Snow Leopard are: (10.5 | Release | i386).

When I tried to compile it using above stated configurations it gave me this error in the application delegate file, which was created automatically when I created the project: cannot find protocol declaration for 'NSApplicationDelegate'
So I removed <NSApplicationDelegate> from its header file and it was compiled successfully.

Although it is running successfully in Snow Leopard, to my surprise its .app file is not appearing to be executable in Leopard.:eek:

Can anyone suggest me why it is showing such strange behavior and how can I resolve it:confused:

Thanks,

M:cool:n@j
 

daflake

macrumors 6502a
Apr 8, 2008
920
4,329
Permissions? Just copying the app over to the new system won't set the proper permissions on it.

chmod +x "filename"

That should do it for you. Mind you, this is a stab in the dark as I am not a Mac expert, but in the world of Unix this is what I would check.
 

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
Yes

It is the release build and I think permissions can not be a reason for this problem!
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
I doubt this is the case, but if you're testing on Leopard on a PPC then you need to compile as a i386/ppc universal binary.

When I tried to compile it using above stated configurations it gave me this error in the application delegate file, which was created automatically when I created the project: cannot find protocol declaration for 'NSApplicationDelegate'
So I removed <NSApplicationDelegate> from its header file and it was compiled successfully.
That's because the NSApplicationDelegate protocol was added in 10.6, and Xcode 3.2 by default includes this for new projects.
 

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
but if you're testing on Leopard on a PPC then you need to compile as a i386/ppc universal binary
Both machines have same architecture ie. i386.

That's because the NSApplicationDelegate protocol was added in 10.6, and Xcode 3.2 by default includes this for new projects.
ok
 

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
more inputs on problem faced

Below are some of the configurations set for project :

1. Project-> Edit Project Settings -> Build Tab:
Architectures : Standard (32/64-bit universal)
Valid Architectures: i386 / ppc / ppc64 / ppc7400 / ppc970 / x86_64
Build Active Architecture Only: unchecked
Mac OS X Deployment Target: Mac OS X 10.5

2. Project -> Edit Active Target -> Build Tab:
All Same as above
Debug Information Format: DWARF with dSYM File

In the release folder there is appearing a cross symbol above .app file in Leopard. When I am trying to double click it to launch it, it is giving this message: "You cannot use this version of the application XYZ with this version of Mac OS X" :(
 

chown33

Moderator
Staff member
Aug 9, 2009
10,740
8,416
A sea of green
Post the contents of your app's Info.plist file. It may contain something that prevents it from running on Leopard.

Also post the output of the following Terminal command:
Code:
otool -L -arch all  path/to/XYZ.app/Contents/MacOS/*
Obviously, substitute the real pathname and app-name of your unlaunchable app. Keep the sub-dir part, Contents/MacOS/*, as given.
 

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
XYZ-Info.plist information

Post the contents of your app's Info.plist file.

1. Localization native development region : English
2. Executable file : ${EXECUTABLE_NAME}
3. Icon file :
4. Bundle identifier : com.yourcompany.${PRODUCT_NAME:rfc1034identifier}
5. InfoDictionary version : 6.0
6. Bundle name : ${PRODUCT_NAME}
7. Bundle OS Type code : APPL
8. Bundle creator OS Type code : ????
9. Bundle versions string, short : 1.0
10. Minimum system version : ${MACOSX_DEPLOYMENT_TARGET}
11. Bundle version : 1
12. Main nib file base name : MainMenu
13. Principal class : NSApplication
 

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
output of: otool -L -arch all path/to/XYZ.app/Contents/MacOS/*

Also post the output of the following Terminal command:

monaj:~ keyss$ otool -L -arch all /Users/keyss/Desktop/Release_2/XYZ.app/Contents/MacOS/*
/Users/keyss/Desktop/Release_2/XYZ.app/Contents/MacOS/XYZ (architecture x86_64):
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 32.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.18.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 677.24.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 949.46.0)
/Users/keyss/Desktop/Release_2/XYZ.app/Contents/MacOS/XYZ (architecture i386):
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 32.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.18.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 677.24.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 949.46.0)
/Users/keyss/Desktop/Release_2/XYZ.app/Contents/MacOS/XYZ (architecture ppc7400):
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 32.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.18.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 677.24.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 949.46.0)
 

chown33

Moderator
Staff member
Aug 9, 2009
10,740
8,416
A sea of green
This is what I get from XYZ-Info.plist file under resources! Do you mean any other file :confused:

The plist you posted is a source file in your project. It has patterns in it that Xcode replaces when it builds the app. For example, ${EXECUTABLE_NAME} and ${MACOSX_DEPLOYMENT_TARGET} are patterns, and they haven't been replaced by real values. Also, what you posted is not XML.

First build your app, then locate it in the Finder. Right-click (or control-click) its icon in the Finder window, and choose "Show Package Contents". In the window that opens, open the Contents folder, then double-click the "Info.plist" file. It should open in Property List Editor. Choose Save As, confirm the file format is XML Property List, then navigate to your Desktop folder and save. Drag the new file to TextEdit.app, then copy and paste the entire XML text into a posting. Or use the Attachment feature to upload the XML Info.plist.
 

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
XYZ info.plist in XML format

Thanks.....chown33 :eek:

It is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>XYZ</string>
<key>CFBundleIdentifier</key>
<string>com.keyss.XYZ</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>XYZ</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.5</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
 

chown33

Moderator
Staff member
Aug 9, 2009
10,740
8,416
A sea of green
I don't see anything obviously wrong with the Info.plist. I didn't see anything wrong with the 'otool -L' output, either. The dylib versions listed are consistent with a 10.5 deployment target.

As a test, try removing:
<key>LSMinimumSystemVersion</key>
<string>10.5</string>

If you change the source plist, it will be this item:
Minimum system version : ${MACOSX_DEPLOYMENT_TARGET}

If it still doesn't work, try uploading the actual built app (zipped) so others can see if it misbehaves the same for them.

Another possibility is starting a new trial project with the same template you used for the misbehaving app, then build that for 10.5. Don't edit any template source or xibs, just change the target to 10.5 and build. If that fails, then file a bug with Apple. If it works, then you have to figure out what changed between the initial project state and the non-working state.
 

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
Thanks, chown33 for all your help I will try all your suggestions!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.