Symlinks corruption in iOS custom framework
Asked Answered
M

1

7

I'm currently working on the already developed iOS project. In this project custom framework is used which is giving me error 'abcLib/abcLib.h' file not found.

When I had a look at framework in the Finder, I found that the symlinks are broken and because of which I'm not able to include the Header files in project which leads to file not found error.

Following image shows the custom framework structure: enter image description here

I also got the framework in .zip format from one of my colleague (who probably has a windows machine) and tried to integrate it again but issue still persist. Is there a way by which I can get the framework with no broken symlinks or a way to recreate the broken symlinks.

Or that I'll need the code that created the framework

Note: I don't have the Project used to create the framework.

Malinger answered 24/12, 2015 at 7:41 Comment(0)
G
6

You can recreate the symlinks using this script. I used it a couple times, it works fine.

Edit :

First delete all broken symlinks.

Then you can recreate them using this command :

ln -s {path_to_folder_or_file} {name_of_symlink}

So you will need in myFramework.framework/Versions/ :

  • The symlink Current that points to A

And in myFramework.framework/ :

  • The symlink Headers that points to /Versions/Current/Headers

  • The symlink Resources that points to /Versions/Current/Resources if you have one

  • The symlink myFramework that points to /Versions/Current/myFramework
Gemmell answered 29/12, 2015 at 10:53 Comment(4)
@ebluehands: Thanks for your response and your answer does help me to recreate the broken symlinks. But still their is one issue. If you look at the path PcfLib.framework/Versions/A in that PcfLib file exist which is as far as I know a Static Library / Fat binary which also seems to be corrupted. Is there a way to recreate that too. Thanks!Malinger
@ebluehands: Getting Error - framework not found PcfLib. clang: error: linker command failed with exit code 1 (use -v to see invocation)Malinger
The error suggests that the framework can't be found, not corrupted. When you added the framework to your project, did you check the box "copy items if needed" ? Make sure that your framework is indeed copied in your project and that it is present in Build Phase -> Link Binary With Libraries. But if the binary is corrupted, I'm afraid you can't fix it unless you have the code to rebuild it.Gemmell
@ebluehands: Yes while adding framework to the project I checked the box "copy items if needed". and also the framework is present in 'Build Phase -> Link Binary With Libraries'. Also tried setting the 'Framework Search Paths', but all helpless :(Malinger

© 2022 - 2024 — McMap. All rights reserved.