kstenerud / iOS-Universal-Framework

An XCode project template to build universal frameworks (arm7, arm7s, and simulator) for iOS / iPhone.
2.95k stars 473 forks source link

Embeddedframework build fail with Xcode5 #159

Open xiaowei4895 opened 10 years ago

xiaowei4895 commented 10 years ago

Code in master branch fails to build embeddedframework with Xcode5. The first time of build will success. But the second time it fails.

It is same issue of #157. I think it's a serious problem, so mentioned again and hope it will be fixed as soon as possible.

It seems the invalid symlink of xxx.framework causes this problem. So I add a "rm" command in script to delete the symlink after built success. It works fine, but i'm not sure it is completely correct.

My solution, at the end of "build_embedded_framework" funtion, add below code:

============================================================

Remove framework symlink. If not remove, embeddedframework will build fail at next time.

import subprocess subprocess.call (["rm", fw_path])

============================================================

bigsprocket commented 10 years ago

Unfortunately, this will cause you to miss the strip phase. After all custom scripts have run, Xcode will strip the framework, then set owner/group/mode. You need that symlink in place for the strip to work.

xiaowei4895 commented 10 years ago

I found the problem at last.

It is a logic error in creating embeddedframework structure.

In build_embedded_framework function, the script removes the embeddedframework path at first and create a new one. After that it copies xxx.framework to embededframework folder. But at the second time of building, xxx.framework is only a link. The real data is in embeddedframework. If embeddedframework path is removed first, the result data is gone and link becomes invalid. Then the copy action is failed and an invalid link of xxx.framework left which will cause "create product structure" error during afterward builds.

I fixed the problem in my branch (https://github.com/xiaowei4895/iOS-Universal-Framework), you may take a look. Note if invalid xxx.framework link is already exist, it must be removed manually.

EmperiorEric commented 10 years ago

Did you submit a pull request for your branch? This issue and #157 are still open problems in the public project. This is still a problem in whats available on the main project. It is often not a real problem for those who archive exclusively for distribution, but when running tests or debugging you hit this wall. Clearing Derived Data normally fixes it but doing that everytime between builds is quite painful for quick debugging or testing.