35

I downloaded a project developed by Apple employees ( who taught course at Stanford on iPhone application development). Strangely , the frameworks are red.

http://img.skitch.com/20100730-kcjun96mp2pxnpg7w3x6njw57.jpg

I tried to locate coreGraphics.framework and UIKit.framework to add them again but i couldnt find them either.

Taimur

Taimur Ajmal
  • 2,778
  • 6
  • 39
  • 57

7 Answers7

34

The red text indicates that the actual files are not at the path that the project has for them.

Get info on the framework and look under the General tab. The first section shows the name and path of the framework bundle itself. The most common cause of a problem with system supplied frameworks is that the path type has been changed to something that breaks the path. The default setting is Relative to Current SDK. Change the path until you get one that leads to the actual framework.

If you have the developer tools installed in a custom location, you are more likely to run into this problem. If you copy a project from someone with non-standard settings, you can encounter it as well.

TechZen
  • 64,370
  • 15
  • 118
  • 145
22

Are you building for a Simulator or for Device?

Try building for Device.

Michael Peterson
  • 10,383
  • 3
  • 54
  • 51
7

Found a way to fix this automagically:

  • Right click your main Xcode project file (the blue one at the top alt text),
  • Get info,
  • 'General' tab,
  • At the bottom, set 'Base SDK for All configurations' to your desired one.

Done!

jchatard
  • 1,881
  • 2
  • 20
  • 25
5

Steps to fix this issue in M1 Macs:

  1. Install "sudo gem install cocoapods-deintegrate cocoapods-clean" to install deintegrate if not installed.
  2. Run "pod deintegrate" in terminal in your project folder to uninstall all pods.
  3. Run "pod cache clean —all"
  4. Run "pod install"
  5. Go to Project Explorer Select "Pods" in blue
  6. Select the each pods in the target section
  7. Search for "Excluded Architecture" in Build Settings Tab under "All" sub category.
  8. Add "Any iOS Simulator SDK" in both debug and release and set the value to "arm64" Repeat this for each Pod with the error "Framework not found". Clean Build the project.
Dharman
  • 30,962
  • 25
  • 85
  • 135
ricky roy
  • 156
  • 1
  • 5
2

I had faced this problem before. I got over it by copy the missing (in red) framework from my friend's Mac then copy it to the Framework folder.

This is the path of my framework folder:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks

You may need to change the path depend on your system or your sdk version.

Envil
  • 2,687
  • 1
  • 30
  • 42
2

Most likely you decided to remove some of the frameworks you don't need and you deleted them but selected "Move to Trash" instead of "Remove reference".

The problem is that this framework was not included in your project's folder. It sits in a System folder when it can be used by multiple projects. So not only did you cause the current project not to compile, but also all projects on your computer.

If you have any frameworks left, you can right-click on them and check "Show in Finder". Than you can find your deleted frameworks in the trash (if it's not wiped already), and put them back in the system's Frameworks folder.

If you can't find this folder, for me it was here: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library

Of course, when you go in Applications folder and select Xcode, you have to right-click on it and click "Show Package Contents".

If you deleted your frameworks even from the trash, than I guess you could re-install Xcode...

AndroC
  • 4,758
  • 2
  • 46
  • 69
2

@Taimur Hamza - Its happen (red color) following any one of reason,

  1. Your downloaded project may be miss some required files

  2. Before run the application at first time.

    so, first you have to find that above reason is happen and try to solve via copy the framework from another running project and paste it your project.

Sivanathan
  • 1,213
  • 3
  • 13
  • 25