I'm working on an application and everything was running in the iPhone and iPad simulator. But when was testing on the iPhone I received the following message:
Could not find a storyboard named 'MainStoryboard_iPhone'
But I can see and change the two Storyboards in Project Navigator. When I checked the Build Phases according to another question on SO, I found that there is something wrong but I don't know what to do. What is wrong?
This is the Build Phases, which I believe have a problem:
Thanks in advance.
Did you try to :
"Show in finder on both files"
"Save it to a safe place" >
"Remove file from Xcode (reference)"
"Add Files to your project" (With the 2 storyboards)
Related
I have an existing project that I am trying to add unit tests to.
I'm on Xcode 10.1 and project is purely in Swift.
I start by clicking on "New Target..."
In the first dialog I am able to choose the project but the dialog box for "Target to be tested" is grayed out.
I have tried to go ahead and add the test target without choosing and this results in my test bundle not being able to find my existing classes - "No such Module error"
Here is the dialog for adding the test bundle:
Not sure what I'm doing wrong to prevent the this selection
Thanks for any help!
In Xcode 10.2.1, with your project open, click on the diamond with a dash in it:
Then down at the bottom left of the project window click on the '+' and select "New Unit Test Target".
I cannot run my project in simulator because i get this error:
Could not find a storyboard named 'MainStoryboard_iPad'
But the storyboard is there.
Thank you
I managed to solve this problem in my iPad App through the following steps:
Checking the Build Phases
Editing the Info.plist file to add the option "Main storyboard file base name (iPad)"
Just like in this picture:
In my case, the iPad storyboard file was already in the project, and testing the app worked until I introduced what seems to be an unrelated bug... I fixed this by changing the filename in xCode for the MainStoryBoard_iPad to MainStoryBoard_iPad1 and changing the TARGETS > Summary > iPad deployment Info > Main Storyboard entry. For good measure also verifying the same in -Info.plist file and Build Phases accordingly... similar to #daniel-lima.
Hopefully, this may help others that did not fix based on above notes. This started after I fixed a CoreData related bug in a category-file. The issue was reproducible on another machine... and this fixed it on both machines.
My issue was only on iOS 5. The resolution was found at http://need-bee.com/b/2013/08/could-not-find-a-storyboard-in-xcode-5-for-ios-5-0/
To summarize:
In Xcode, open each story board file and uncheck "Base" under localization on the right hand side. It will prompt you to move to English. Select ok. Once rebuilt my issue was resolved.
Click target and there is Mainstoryboard with textfield. Click and select your storyboard named "Mainstoryboard_iPad" and clean your project and then run it.
Remove from the project all the StoryBoards and add all of them again, for me worked.
I got this problem today as well, for me, a Product > Clean solved the problem. After that, I can rebuild the app and run it inside the Simulator without any issue.
I was encountering the same problem as in the original question but for me there wasn't really a bug - rather, the storyboard which appeared in the project navigator as "Main.Storyboard" actually had a base name of "Main" in info.plist. So my attempts to use "MainStoryboard" and "Main.Storyboard" in my code were generating a crash, but once I changed it to "Main" it worked just fine - didn't need any of the elaborate workarounds above.
If the failure occurs after launch, check to make sure any references to a storyboard via storyboardWithName: refers to the correct name. You may have an incorrect name hardcoded in your binary.
In my case, I renamed the storyboard (based on a suggested workaround on stack overflow), but forgot to rename references to the storyboard in code. The symptoms were that changes to the storyboard weren't visible in the running application, but once I reset the simulator, the app stopped working completely. In that case, the old, stale copy of the storyboard was around at first and was used; once the simulator was reset, the stale copy disappeared and the "could not find a storyboard" message started appearing.
Just a Hello world app.
I create a view-based appllication named it Hello World.
then save ,build and
I double click the app under products.
cause the error:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread: 0
Dyld Error Message:
Library not loaded: /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
Referenced from: /Users/myname/Documents/Control Fun/build/Debug-iphonesimulator/Control Fun.app/Control Fun
Reason: image not found
I googled and tyied many ideas.Unluckily I can't slove it.
Thanks in advance!
You can't run iOS apps directly on Mac OS X. You either have to run a build compiled for the simulator within the iOS Simulator, or a build for the device directly on your iPhone, iPod touch or iPad.
When you double-click the item in Xcode's Products group, you're essentially trying to launch the app directly. Just hit "Build and Run" instead and it should launch in the iOS Simulator or on an attached device, depending on your settings.
Btw: if this really is an iOS related question, you should remove or replace the "cocoa" tag from your OP. Cocoa is Mac, Cocoa Touch is iOS.
Plz check you project has CoreGraphics.framework. It would be defaulty included..but you might remove it by mistake.
You can check included frameworks on "General Tap" of project info.
You probably haven't included the CoreGraphics framework. To add it in do the following :
Click on HelloWorld (ie ur project name) in the Project Navigator.
Click on HelloWorld under the Targets in the Project Editor.
Open "Build Settings" tab, and select "Link Binary With Libraries"
Now, you should see 3 libraries (at a minimum) in this section. They should be : UIKit.framework, Foundation.framework, CoreGraphics.framework
(Note: In some cases the order is important so click and drag them into the order above)
Incase any of those 3 libraries are missing :
Click the '+' (ie ADD) button and type in the name of the missing library. Select it, and hit add. Now run the project again and let me know if you have any more errors :D
Check out my blog for a simple tutorial on making your first iOS app : It teaches you Interface Builder, buttons, methods, etc : http://techtalktone.wordpress.com/2011/11/26/hello-world/
I'm trying to create a universal iPhone/iPad app using this method: http://www.enscand.com/roller/enscand/entry/ready_for_ipad which is also described all over the web. My problem is that the "Upgrade current target for iPad" line is grayed out and doesn't appear at all when I right click the target.
I'm working on an app that I inherited from someone, and have tried this with an app that I wrote entirely myself (no problems on that one). And yes, I'm sure that I'm selecting the target.
Just wondering if anyone has any insight into what checks are being run that would cause this option to be unavailable.
It took me a while to realize that you have to have a target selected before the menu item will become enabled.
I figured out that you have to select the target from the window on the left "Group & Files" for that "Upgrade Current target for ipad" to show.
I found the solution. After upgrading first target just rename Resources~iPad group in Groups&Files (e.g. to ResourcesFirstTarget~iPad). After that you can upgrade your other targets with "Upgrade Current Target For iPad".
I had this problem because I was trying to do it with the xib file selected, not the item under the the 'Targets' folder.
I just found that my project was set to "iPhone" for Distribution, but it was still set to "iPhone/iPad" for Debug. After switching to "iPhone" for Debug also, the option to convert to a Universal app became available.
Im not sure if this is an actual solution but I solved this problem by selecting the target, going to "Project" and setting the Active Build Configuration to "Release". Update Current Target for IPad then became enabled.
I deleted the "Resources-iPad" group and voila - the "Update Current Target for iPad" became enabled.
I was having the same problem, what I did to solve it was the normal thing:
- select target in Groups and Files
- (i.e change it from 'iPhone/iPad' to 'iPhone').
and it was grayed out...
- so I've cleaned the project (Build/Clean All targets)
It solved my problem, so I advise you to after make some changes that supposing would made it work, to clean the project afterwards!
Hope it can help someone.
I've found the same problem but can upgrade if I right click the target rather than using the menu item.
Further more I've just realised that the menu item does become ungrayed out if you select the target in Groups & Files not in the drop down at the top.
I don't know if this post is still active.
In project info, take a look at "Architecture", if there's more than one entry, the "Upgrade target for ipad" is greyed.
Set you app to target iPhone in both the Project->Edit Project Settings: All Configurations
and in the side menu, where you right click the target ->Get Info same type of menu.
To be able to click the "Upgrade to Ipad(...)" you have to click and select the target. Then it will work.
I solved this problem by right clicking on the target -> get info -> build, and changing the targeted device family from iphone/ipad to iphone.
No biggie, but when I add the AVFoundation framework for the iPhone, it turns red for some reason I'm unable to figure out why. The project will not compile unless I add this framework, and if I do, Xcode will mark the framework red (apparently that means xcode cannot find the framework), but yet it will work.
This is quite annoying. Any clue what I might be doing wrong here?
Try adding AVFoundation framework via your target.
Look for your target under "Groups and Files"
"Get Info" for it
Click the "General" tab
At the bottom right of the window click the "+" button
At the top of your list you should find AVFoundation, add it.
close Xcode
delete your project
shut down your mac
take the mac back to your boss and tell him it's not working
wait until they figure out what it is
if this doesn't work, find a new job that doesn't require the use of a mac
All I had to do was open up the "General" settings tab for the project and change the "Base SDK for All Configurations" value. It was set to an SDK that I no longer had installed.