Framework file is always red in iOS Swift Framework Project - ios

I'm trying to build an iOS framework, I did this by going to File -> New Project -> Cocoa Touch Framework.
However, I never was able to locate the .framework file event if I successfully build the project, it is always displayed in red and it's not there when I open the project's files in Finder, here is a screenshot:
What could be the problem?

Choose "Build Only Device -> Generic iOS device" should work

Short Answer = yes
red items in Frameworks and Products, pointing to derived data are normal.
See this related response:
https://stackoverflow.com/a/31226316/218152

Related

Path to archived iOS Framework

Does anyone have a clue of where to find the archived iOS framework after successful archive in Xcode 8? I've been searching for hours.. The build is successful, but, the framework is nowhere to be found.
I think what you are looking for is Xcode/DerivedData folder. Default path is /Users/YourUser/Library/Developer/Xcode/DerivedData.
Archived projects (Archives *.xcarchive) are under (default path) /Users/YourUser/Library/Developer/Xcode/Archives catalogued according to the creation date.
You can look up how those paths are set in your Xcode in the following menu: Xcode -> Preferences -> Locations (last tab). You can also change locations there.
I hope this will help you push your project further. Ania

Xcode - Bundle format unrecognized, invalid, or unsuitable

Ok so I have just about managed to get to this point on my own but am now having some issues code signing the app specifically with the AdMob framework. I am getting this error:
Command /usr/bin/codesign failed with exit code 1 the details it are giving are as follows: Applications/MyApp.app/Frameworks/GoogleMobileAds.framework: bundle format unrecognized, invalid, or unsuitable
I have read the other posts on the site and tried many different ways of fixing this. If I untick 'Code Sign On Copy' the archive builds successfully but then fails on validation with a match error. This is how I have my frameworks set up currently:
Any help would be much appreciated!
I saw this same issue with a different framework.
The solution for me was removing the framework from the 'Embedded Binaries' section and only adding it to the 'Linked Frameworks and Libraries' section in the target 'General' tab.
I have just seen the same issue but with a different framework that was the social framework and then I did below:
go to build phase -> embed frameworks -> press copy only when installing check box
then it worked with me with no error
I had a similar problem but with a different framework. The solution for me was to make sure that the framework was present in these three places:
General tab:
Embedded Binaries
Linked Frameworks and Libraries
Build Phases tab:
Embed Frameworks
I ran into this issue when using a different framework.
Clear the DerivedData solve this issue.
https://docs.sentiance.com/sdk/troubleshooting/ios/bundle-format-unrecognized-invalid-or-unsuitable
Go to Xcode menu bar and select File > Project Settings (or Workspace Settings).
Under Per-User Workspace Settings, find the shortcut to DerivedData folder and open it via Finder.
Remove the entire content of the folder and empty the Trash.
Restart Xcode.
In Xcode 11.*
Target -> General -> Linked Frameworks and Libraries
change related framework with option "Do Not Embed"
Else Check on the :
Target -> Build Phase -> Link Binary With Libraries
Check status with Required/Optional - try it with required first.

Cannot find ScriptingBridge.framework

I am new to objective-C.
I have programmed my first App in the last 2 months. I am now trying to access iTunes information and the coding appears to be straight forward but I cannot locate the ScriptingBridge.framework.
I am using Xcode 4.5. I have tried using the "+" button in the Link Binaries with Libraries section of Build Phases but ScriptingBridge.framework does not appear on the list. I have tried opening the framework directory in Finder with no luck. I cannot find a way to download the file independently from installing Xcode.
I have tried uninstalling and reinstalling Xcode. Any suggestions?
Thanks,
BobT
ScriptingBridge.framework is not available for Cocoa Touch.
I don't think you can use the scriptingBridge framework with an iOS Project. You only can use it with a cocoa application project. In a cocoa application project you can add the framework under
Targets -> Build Phases -> Link Binary with Libraries -> +
https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ScriptingBridgeConcepts/UsingScriptingBridge/UsingScriptingBridge.html

Accidentally deleted an iOS framework, is there anyway to download it

in iOS5.0, i accidentally deleted the messageUI.framework, now it does not exist in the Xcode library. Is there any way I can download just the framework or will I have to reinstall Xcode to get the framework back?
Thanks in advance for your help?
Above method will not work if your xCode's location is different. For that Open xCode click top project blue icon. Click Target-> build Phases -> Link Binary With Libraries
Now right or control click any existing framework and Show in Finder.
This way you will get all existing framework's default location. Now go to that location and add your deleted framework again.
Restart xcode then you will see your deleted framework as it was before.
Under your Project's Build Phases go to the "Link Binary With Libraries" section and press the + button.
In the search field type "message" and it should come back up. Select it and it'll be added.

Could not instantiate class named MKMapView

I may be doing something really stupid here as I've done it before and it worked and now...
Created a new iPad project, in the details view I added a MKMapView, added the MapKit.framework to the project, added the property / etc. to the header. Go to run the project and get a SIGABRT with
****Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate
class named MKMapView'**
I found http://mithin.in/2009/06/22/using-iphone-sdk-mapkit-framework-a-tutorial/ but, like I said, I've already added framework. What am I missing?
I ran into this too, but I was able to get past it by following the instructions of step 2 in your link (thanks, by the way):
Add the MapKit framework to the project. (Control + Click Frameworks
folder -> Add -> Existing Frameworks)
I just searched for MapKit.framework, added it to the project, and the error went away.
I haven't added any map code yet (although I do have a MapViewDelegate connected in IB), but it's working fine so far!
Click on your project to bring the project settings. Under Targets, click your project, select from the upper toolbar "Build Phases". Under "Link binary With Libraries" tab, you will see the list of frameworks included in your project. Click the "+" button and add MapKit library from the shown list to your project.
For Xcode 6.1:
Select your project
In general tab, look for Linked Frameworks and Libraries (last one)
Press + button
Search MapKit.framework
Finally add
Easy way!
Works above Xcode version 7.2
As far as I'm concerned selecting the MAPS from capabilities will automatically link your framework to your project all you have to do is check the Maps button in Capabilities -> Maps.
Heres the attached screenshot. Cheers!!
For xCode 4.2:
Click on your project name ->targets ->building Phase ->link binary with library
-> click on + sign ->select mapKit.framework ->click add
I noticed that I was getting this message (on top of the original one mentioned in this post) when I was building and running on the simulator:
ld: warning: ignoring file
/Users/peter/programming/iPhone/iNspector/MapKit.framework/MapKit,
file was built for unsupported file format which is not the
architecture being linked (i386)
Then I just connected my iPhone, build and ran on the device, and the map worked.
So it seems that the MapKit framework cannot be compiled on the 386 architecture, it needs the device.
In regards to #futureshocked's input, I also came across the
Id: warning: ignoring file /blah.../MapKit, file was built for unsupported file format which is not the architecture being linked (i386)
issue.
**Check to make sure you didn't copy the MapKit framework into your local project directory when you added it to your project. I accidentally did this and XCode was giving me the above error. So I removed it from my project directory (in Finder), recompiled, and everything was normal again.
If you don't have the Framework in your project, go ahead and re-link as stated in the answer above.
Found a good tutorial on getting started with MapKit:
http://www.youtube.com/watch?v=X-3jM24EIGM&feature=related
I also received this error when trying to deploy to my 5.1 phone (with XC 4.5), even after changing my deployment target to be 5.1. Looks like the maps update wouldn't fly since I still had Google Maps on my phone. After updating my phone's OS, the exception disappeared.
Please import the WebKit at your Build Phases.

Resources