Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 664 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OS X Framework Library not loaded: 'Image not found'

#1
I am trying to create a basic OS X Framework, right now I just have a test framework created: `TestMacFramework.framework` and I'm trying to import it into a brand new OS X Application project.

I have built the .framework file and imported it into the new project, The framework appears to link okay, and I can reference the public header file I added to the framework build phases section.

However, when I try to run the container Application I get the following Error:

dyld: Library not loaded: /Library/Frameworks/TestMacFramework.framework/Versions/A/TestMacFramework
Referenced from: /Users/samharman/Library/Developer/Xcode/DerivedData/TestMacContainer-dzabuelobzfknafuhmgooqhqrgzl/Build/Products/Debug/TestMacContainer.app/Contents/MacOS/TestMacContainer
Reason: image not found

After a bit of googling I realised I needed to add a `Copy Files` section to my container application build phases, so I have done this and set it up like so...

![enter image description here][1]

However, I am still getting the runtime error. I'm obviously doing something wrong here, but the Apple developer library resource for this references Xcode 2, so isn't very helpful!

What have I missed?

**UPDATE:**

I can see in the build log that my `TestMacFramework.framework` is being copied into the .app contents/frameworks directory, but it isn't being installed to the Library/Frameworks directory on the HD

![enter image description here][2]

**UPDATE 2:**

The build links correctly if I manually copy the `TestMacFramework.framework` into the `Library/Frameworks` directory

[1]:

[2]:
Reply

#2
So I managed to get it working, it's quite simple when you have the right instructions. What I was looking for was a 'private' framework which lives in the App bundle rather than being written to the system library folder.

**Building The Framework**

1. Add a target to create a Cocoa Framework
2. Within that targets 'Build Settings' configure the 'Installation Directory' to '@executable_path/../Frameworks'
3. Build library, and access the .framework from the archive or products directory

**Including The Framework**

4. Drag the created .framework file into the Xcode Project, be sure to tick 'Copy Files to Directory'
5. In the containing applications target, add a new 'Copy File Build Phase'
6. Set the 'Destination' to 'Frameworks'
7. Drag in the created .framework
Reply

#3
It was quite simple for me, i just added my framework to my embedded binaries under app targets
Reply

#4
Deleting derived data saved it for me
Reply

#5
If you accidentally reset your keychain, this can occur due to missing Apple certificates in the keychain. I followed [this][1] to solve my problem.

I had the same issue and was able to fix by re-downloading the WWDR (Apple Worldwide Developer Relations Certification Authority).
Download from here: [

[To see links please register here]

][2]


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#6
The options above where not possible for me to include.
I solved it by specifying the Runpath Search Path

This is on the '**Build Settings**' tab.
In the '**Linking**' section.
Change '**Runpath Search Paths**' into `$(inherited) @executable_path/Frameworks`
Reply

#7
None of these issues solved this for me. The problem in the end was pretty easy. It looks like its a pretty major Xcode bug which I have logged the problem and fix under Apple bug: 29820370. If you are struggling (as it seems like there are several pages of problems similar to this ) then it would be great if you can raise a bug on bug reporter:

[To see links please register here]

and reference the bug I raised to gain visibility. I want to make Xcode back into the pleasure that it was before - and this is something I am sure Xcode should have fixed itself.

Here is the fix:
1. Open Keychain - go to Apple Worldwide Developer Cert.
2. Double Click on it
3. Change the permission level from "always trust" to use System Defaults
4. Save and close it
5. Restart Xcode, Clean and build your project and it should be gone.

Screenshot below of the correct settings:
[![Keychain access fixed][1]][1]
Hope this helps!


[1]:
Reply

#8
There should be a 'Run Script' into 'Build Phases' with this: '/usr/local/bin/carthage copy-frameworks'

On the 'Input Files' of that 'Run Script', you should add the path to your libraries. Like this:

![Build Phases Run Script][1]

[1]:
Reply

#9
I found that this issue was related only to the code signing and certificates not the code itself. To verify this, create the basic single view app and try to run it without any changes to your device. If you see the same error type this shows your code is fine. Like me you will find that your certificates are invalid. Download all again and fix any expired ones. Then when you get the basic app to not report the error try your app again after exiting Xcode and perhaps restarting your mac for good measure. That finally put this nightmare to an end. Most likely this has nothing to do with your code especially if you get Build Successful message when you try to run it. FYI
Reply

#10
Got the issue when trying Xcode 9 beta and going back to Xcode 8. A simple Clean on the target resolved the issue.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through