Unable to read symbols for "@loader_path

Asked by Steve M

I am trying to add 1.5b6 to a project. I was having the same issues as Scott with the "Unknown class `SUUpdater' in nib file, using `NSObject' instead." error. I had a previous version of Sparkle running with no problems. I had issues trying to add the framework to the project. So like always lets create a test project. Now adding the framework, creating a New Copy Files Build Phase "copy files"(framework) to the test project yields similar results I was having before. The error from the console

This GDB was configured as "i386-apple-darwin".tty /dev/ttys002
warning: Unable to read symbols for "@loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle" (file not found).
warning: Unable to read symbols from "Sparkle" (not yet mapped into memory).
Program loaded.

I have checked the Frameworks search path in the Target, all ok...

xcode 3.0 10.5 debug i386
I even built 1.56b from source with a Release build, same outcome. ?
Thanks for any pointers in the right direction.
-steve

Question information

Language:
English Edit question
Status:
Solved
For:
Sparkle Edit question
Assignee:
No assignee Edit question
Solved by:
Steve M
Solved:
Last query:
Last reply:
Revision history for this message
Hofman (cmhofman) said :
#1

Is Sparkle present in Frameworks in the .app bundle?

Revision history for this message
Steve M (steve-mcferrin) said :
#2

Yes the sparkle framework is in the .app bundle, I had not checked that earlier but I just checked and it is getting copied to the bundle.
Thanks
Steve

Revision history for this message
Steve M (steve-mcferrin) said :
#3

I would be happy to send you the project..

Revision history for this message
Hofman (cmhofman) said :
#4

Can you check using otool if the binary of your app links to Sparkle ("otool -L path/to/YourApp.app/Contents/MacOS/YourApp")

Did you follow the instructions exactly as in the (current) documentation?

If not, you're having a linker problem.

Perhaps it works if you add $(SOURCE_ROOT) to the framework search paths in your app's build settings, assuming that you copied Sparkle.framework in the source root?

Revision history for this message
Steve M (steve-mcferrin) said :
#5

Here is the otool output..

/Users/steve/Software Projects/LetsTestSparkle1.5/build/Debug/LetsTestSparkle1.5.app/Contents/MacOS/LetsTestSparkle1.5:
 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
 @loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle (compatibility version 1.5.0, current version 1.5.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.0.0)
 /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 949.0.0)
I checked the build settings and all is well. I even tried adding the $(SOURCE_ROOT) to no avail.
I am still getting the
warning: Unable to read symbols for "@loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle" (file not found).
warning: Unable to read symbols from "Sparkle" (not yet mapped into memory).

I added the framework with instructions via the new wiki docs.. I will try once again...
thx for the help..

Revision history for this message
Hofman (cmhofman) said :
#6

Everything seems to be in place. It's certainly also not the same problem Scott had (or the one Andy mentioned there). So are you really sure that Sparkle is located in LetsTestSparkle1.5.app/Contents/Frameworks? Also, did you build your app for the correct architecture (i.e. i386)? Perhaps you could try otool with an "-arch i386" option?

Revision history for this message
Steve M (steve-mcferrin) said :
#7

thanks for the help.. I checked the architecture with otool all was well.. but I did find that for whatever reason the Sparkle.Frameworks was defaulting to @loader_path/../ instead of @executable_path so I added a build script to change this

install_name_tool -change \
 "@loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle" \
 "@executable_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle" \
 "$BUILT_PRODUCTS_DIR/$EXECUTABLE_PATH"

now it builds and shows @executable and all is well. I am not sure why I have to do this for every Project but it seems to be working.
May be someone smarter than I could shed some light?
Once again, thanks for answering my questions and helping!!! Learning a ton!
Steve

Revision history for this message
Hofman (cmhofman) said :
#8

The @loader_path is set in the build settings of the Sparkle project, in ConfigFramework.xcconfig to be precise. So if you want to change it you should change it there. And it should also work with @loader_path, because for an app @executable_path and @loader_path are the same. So something still is wrong.

Revision history for this message
David Dauer (ddauer) said :
#9

I have the same issue (10.5.5, Xcode 3.1.1), changing loader_path to executable_path did the job.

Revision history for this message
Jakob Dam Jensen (jakob-deliciouscode-deactivatedaccount) said :
#10

Even though this is marked as being solved, I still have problems. I guess it's not solved in the build but only for you guys...

I've tried with the Shell script but I get the following error:
install_name_tool: can't open file: /Users/jakob/Applications/TexWriter.app/Contents/MacOS/TexWriter (No such file or directory)

Which refers to the last line of the script: "$INSTALL_PATH/$EXECUTABLE_PATH" if I'm not mistaking..

What to do to correct this behavior?

And a side note.. Why is this only a problem when doing the release? It works fine with debug... And yet another thing - the problem with @loader_path only occurs when I open a new window in my document-based app. Sparkle it self works fine (ie. it shows the "should I do automatic updates"-window without problems)....

What am I missing?

I did the copy files routine.. And as I said - it works fine when I build using debug build config.

Is it necessary for me to get Bazaar and checkout a version and do a build my self?

Revision history for this message
Andy Matuschak (andymatuschak) said :
#11

What shell script is that? I don't recognize the action there. It's weird that it's something that would happen when building your project rather than when building Sparkle. I think it works fine with debug because it doesn't do the installation phase with that.

"the problem with @loader_path only occurs when I open a new window in my document-based app."

Sorry, I don't understand what you mean here.

Revision history for this message
Jakob Dam Jensen (jakob-deliciouscode-deactivatedaccount) said :
#12

Don't worry Andy - I found out this morning that the problem is else where.. Sorry for that...

Revision history for this message
KevinC (kpcregister) said :
#13

Hi folks -
I just released an update to Accessorizer (V1.2.1) and I *REALLY* wanted to ship it with Sparkle. Both times I tried to implement the framework, I got the:
warning: Unable to read symbols for "@loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle" (file not found).
warning: Unable to read symbols from "Sparkle" (not yet mapped into memory).

I believe I followed the instructions carefully.
Andy - what's the correct way to solve this issue?

Thanks! I'm eagerly looking forward to using Sparkle.

Kevin Callahan

Revision history for this message
Steve M (steve-mcferrin) said :
#14

Kevin,
I had the same problem, It worked fine in some projects but not in my soon to be released app? Never figured out why. I added the script above to the target and it seems to be ok.

Try deleting the frameworks from the project and from the resourse folder. (both) then clean the project. Add the framework again and add the copy files phase "frameworks" to your target and add it there as well.
Then you might need to re-read the class back into IB.
Hope that helps..
Steve
Nice product by the way!

Revision history for this message
shw (jarek-pendowski) said :
#15

I've had the same problem just now - it turns out that I've just had to change "Copy files" destination from "Resources" to "Frameworks" and it works!