Xcode is loading in OS X objects instead of iOS objects - ios

I have an iOS window application, which was working fine with Xcode up until today.
When I open the project in the object library it seems to load in all of the OS X development objects, and I can no longer see any of the cocoa touch items like UITextViews, etc.
I didn't manually change any of the settings so I am not sure why this is happening.

Not sure if its the exact same problem, but I found that opening a .xib file switches the Object Library from OS X to iOS objects...

I downloaded Xcode 4.3.3 last night and had the same problem on my first launch of Xcode after the upgrade.
It certainly looks like a bug. My workaround: in the Build Settings, I changed the "iOS Deployment Target" pulldown to a different SDK, then changed it back. After that, I got the iOS objects back.

You can fix it by going File - New - File - Choose "Cocoa Touch" in iOS - choose "Objective-C class - Next - Choose options for your new file: select checkbox "With XIB for user interface"

Changing the deployment target to a different sdk didn't fix it for me.
However, opening up a storyboard brings back the IOS specific objects.

You probably added the Storyboard from the "macOS" tab. Was the icon blue-tinted or yellow-tinted?
yellow-tint -> iOS, watchOS, tvOS
blue-tint -> macOS

Related

dyld`__abort_with_payload: Without an error message

When I start my app with Xcode, I have a crash, but without an error.
The app is just stopping on this thread:
What can I do to have more information about the issue?
If you are using custom frameworks, you need to put it inside the "Embedded Binaries" section located in the Xcode project under the tab Target / General.
For me a simple Clean and Rebuild sorted it out.
This problem appeared after a system update up to macOS 10.15.2 beta (Catalina). Disabling "Thread Sanitizer" solved the issue (Xcode 11.2). Now I can't use Thread Sanitizer and have to wait for the next OS update.
Adding the framework to the embedded binary asset list fixed this. Here is what the setup of a foreign framework looks like in final form in the Xcode GUI as an Embedded Framework (Xcode 9.2, personally I like a visual breadcrumb trail better ;-) ):
Did Apple intentionally crash the runtime to somehow tell the developer about the problem that you cannot use non-Apple frameworks as simply linked frameworks in iOS development? It would be better to have it come up as a build error I would think... with a button that said "move it!"
The use of Embedded Binaries keeps the end user from having to add the Framework independently of your app (or have you do with an installer). In the case of the iPhone (iOS), that is impossible, but on macOS, it is possible, but it can get messy fast.
For the end user, it is much nicer to simply drag and drop an app to install it on macOS, which is where embedded becomes a benefit. Embedding also avoids the classic "DLL conflicts" of having external versions of your framework to manage. (Disk space is cheap, but my customer's time is precious.)
I fixed the error in my project just now!
If you are using the Swift framework in an Objective-C project, I advice you to change the build settings.
Set the Always Set Embed the Swift Standard Libraries option to Yes. Like this:
It was finally solved!
Making the framework "optional" instead of "required" worked for me.
To answer the original question "What can I do to have more informations about the issue?", this Apple forum thread provides a very simple tip: simply run your crashing app outside Xcode (i.e., stop it from Xcode, then run it manually on your device).
This will produce a crash log containing more details about what happened. You can then review this log from the Xcode Window menu → Devices and Simulators → View Device Logs.
In Xcode 11.1, turn off Do not Embed in Embed & Sign is a nice option.
Credit: mkonovalov's answer and William Cerniuk's answer
Unchecking "Guard Malloc" in diagnostics worked for me.
Continue the execution to see if any message shows up in debugger such as "MyFramework.framework" not found. If that is the case, follow this question: OS X Framework Library not loaded: 'Image not found'
For me Amos Joshua's answer worked.
Make sure you have added your binaries through "Embed Binaries" section.
Make sure you have enabled signing of frameworks in build phase section.
Make sure the embedded frameworks are not symlinks.
You can make the linked frameworks optional instead of required in "Link binary with libraries" phase. This will tell iOS to not look for these frameworks during launch. But anyway you need to fix the errors to use those frameworks!
Check if all the info.plist entries are good. In my case, I was using a Mac info.plist file for iOS. It was looking for some xib file which was not present in the iOS project.
Do a clean and build after any such change. This is required because Xcode does not copy/change these files if they already exist.
Remove the app from iPad and then install. Same reason as 7.
I had just missed applying the "Privacy - Camera Usage Description" in the info.plist file.
I faced the same issue with Xcode 11.3 and macOS v10.15.2 (Catalina) . The app was running well on the device, but not in the simulator. It seems there is an issue with the simulator and the workaround is to disable Thread Sanitizer.
Refer to Xcode 11.3 simulator SIGABRT on launch.
I encountered an error with the same signature (my project was in Objective-C) and discovered I had forgotten to link with the appropriate framework. The error message in the debug log that led to finding the error was:
dyld: Symbol not found: OBJC_CLASS$_SFSafariViewController
For my specific error, adding SafariServices.framework in the Targets → Build Phases → "Link Binary With Libraries" resolved the issue. While you probably don't have the same specific error and resolution, checking the debug log for clues is useful.
Sometimes it happens when you use system frameworks that are accessible only from a later iOS version than your target version. It might be fixed by marking this linked framework as optional.
For example, a project targeted on iOS 11 and being using AuthenticationServices for the iOS 12 AutoFill feature will crash on iOS 11 in the described way.
I had a similar issue that was resolved by a missing permission specification in plist (as weird as it is...).
I've tried to use AVCaptureDevice and it just crashed at starting (my app was very minimal).
Adding Privacy - Camera Usage Description to the info.plist file solved it for me.
I've had this situation after updating Xcode to v10.2.1 and Swift to v5.0.
If you are using Carthage + RxSwift, the new RxSwift uses RxRelay.framework. You should go to your /Carthage/Build directory find that framework and drag it to your project. Don't forget also add it to your carthage copy-frameworks script:
$(SRCROOT)/Carthage/Build/iOS/RxRelay.framework
It was resolved thanks to fred's answer.
I had this issue and didn't have success with the answers.
I was using a custom framework that would connect with Bluetooth devices. So the crash was happening because I had missed applying the "Privacy - Bluetooth Always Usage Description" in the info.plist file.
Check all your permissions fields are set up in the p-list file.
I was facing the same issue. Setting 'Always Embed Swift Standard Libraries' to Yes in Build Settings of my target worked for me.
If you use the Carthage build framework, after dragging the framework to your project, you should add it to General/Embedded Binaries.
I found the right way to resolve it.
Make sure the AppleWWDRCA.cer is set to the system default mode, and then it will work:
If you're using a framework written in Swift in an Objective-C application, you need to include the Swift toolchain in the app that consumes the framework.
The way I've found to do this is to create a dummy Swift file in the app, so that Xcode recognizes Swift and appropriately adds it to the project. You can then delete the dummy file.
Also if you are using custom frameworks, make sure you set the Mach-O type to static library. I read somewhere that iOS doesn't allow dylib. Anyway, this worked for me.
To add to the long list of encounters with this error, it occurs when I am on Xcode 12.2 Beta 2 deploying to my Mac running macOS v10.15.5 (Catalina) with the deployment target set to macOS v11.0 (Big Sur).
This situation happened because I was trying out the Mac Catalyst Tutorial app on adding a SideBar. Switching the target to macOS v10.15.5 eliminated the error and launched the app properly.
I faced this issue on iOS 14.5 when playing/implementing ATT (App Tracking Transparency) and have yet to add a usage description in file info.plist on why user tracking is needed.
The app crashes whenever the settings "Allow Apps to Request to Track" was enabled (when disabled, everything worked well).
The crash in Xcode provided no clues, except
libsystem_kernel.dylib`__abort_with_payload: (SIGABRT)
CoreSimulator 757.5 - Device: iPhone 11 (29AD27B2-6EC0-4B9C-8C8C-C5450695A19C) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone 11
Using the answer from fred's answer and getting the crash log from the actual device yielded this clue which was extremely helpful.
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: TCC, This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSUserTrackingUsageDescription key with a string value explaining to the user how the app uses this data.
Triggered by Thread: 1
I fixed it by changing "Embed & Sign" to "Embed without Signing" under General > Frameworks, Libraries and Embedded Content.
I didn't think this applied to me because I wasn't using the camera, but it did.
Many answers reference adding a Usage Description to Info.plist. I didn't know there are many more cases where a usage description is necessary (besides just the camera), see this link.
The link lists these services as needing a usage description or will cause this error:
Calendar, Contact, Reminder, Photo, Bluetooth Sharing, Microphone, Camera, Location, Heath, HomeKit, Media Library, Motion, CallKit, Speech Recognition, SiriKit, and TV Provider.
Add an entry to Info.plist, start typing "Privacy" as the key, and you will see all the available options pop up.
I've just had the same issue and the reason why was due to the fact that I've revoked my Developer Certificates and created new ones with Xcode 10, after a fresh macOS v10.14 (Mojave) update (for some reason, it deleted all login credentials and outdated some keychain certificates).
So, all I had to do was to remove the installed apps from my device and run them through Xcode again, in order for it to install the right new Provisioning Profile in my device :)
Actually, I had the issue with Xcode 11.3.1 and Thread Sanitizer was already turned off as mentioned in previous answers.
In my case, the issue was I used to have different Xcode versions in my Application folder like this:
/Applications/xcode11.3.1/Xcode.app
/Applications/xcode11.3/Xcode.app
/Applications/xcode10.1/Xcode.app
and
/Applications/Xcode.app - was 11.2
The build system looks on the /Applications/Xcode.app file by default. So bringing Xcode 11.3.1 to the /Applications/Xcode.app finally resolve the problem.
The same issue happened with me. I had iOS 14 Beta and the problem was fixed when I updated it to the official version.
I have fixed my error in my project.
I checked the other threads when the error happened. I found my error is about the camera.
Add the Camera privacy in the Info.plist file.
Open the info.plist file.
Add a new key called "Privacy - Camera Usage Description" and enter a string that describes why the app need camera. The describes will display when your app need to use the privacy.

XCode no valid compiled storyboard at path

I've got a universal XCode Project (ObjC) for iPad and iPhone with a subproject that contains a storyboard.
The subproject is a static library that has been added to the main project. Included in this subproject is a bundle containing bespoken storyboard.
Whenenver I tap a certain button the application, the storyboard needs to be loaded;
[UIStoryboard storyboardWithName:#"UIControls.bundle/Config" bundle:nil];
That works perfectly fine for the iPhone (devices and simulators), but whenever I try to run the project an an iPad (device or simulator), I'm getting the following error;
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'There doesn't seem to be a valid compiled storyboard at path...
What's the about? The project is a universal project, so why can't the iPad find the storyboard?
To answer my own question;
This error appears when the bundle target isn't universal.
So make sure the Targeted Device Family in the bundle's build settings is set to iPhone AND iPad.
Just ran into this, after switching a project from a Universal target to iPad only, and the deployment target from iOS 9.0 to iOS 7.1.
The solution was to disable 'Use Size Classes' on the storyboard, and only keep the sizes for iPad.
To get to this checkbox, open the storyboard in the project navigator, then select then show the File Inspector (first icon) and scroll down to Interface Builder Document heading.
I was using a Storyboard from a custom Cocoapod and it kept crashing with
There doesn't seem to be a "valid compiled storyboard" at path ...
In the affected storyboard, under Interface Builder Document I switched the "Builds for" value from "iOS 7.0 or later" to "Project Deployment Target" (which was 9.0), this did the trick for me.
I'm sorry for my previous comments.
I don't know why it didn't work, but currently I fixed that problem with following steps:
Go to Project Target -> Info and then delete KeyValue object for key Main storyboard file base name and Main storyboard file base name (iPad).
To ensure that it's completely removed, go to Info.plist file and verify the KeyValue objects aren't exist there. If they are, then also delete from there.
Remove references to Storyboards from Xcode project.
Add Storyboards back to the project by right-click on the project in Xcode -> Add files to project_name, tick the Copy items if needed, Create groups and project target options.
Set Storyboards names both for iPhone and iPad in Project Target –> Info, by adding previously removed KeyValue objects.
From now Storyboards work as previously!
I was trying to fix this problem for 2 days with no hope till i found that it also did not open the sqlite DB file also and after that everything is corrupted after this DB failure. that was my case. And all of that was a memory issue even if ARC set arrays or dictionaries after finishing to nil;
In our case, we were running a shell script that executed one of XCode's commandline tools, ibtool,
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target 6.0 --output-format human-readable-text --compile ./Build/Release-iphonesimulator/TestApp.app/TestStoryboard.storyboardc ./Resources/TestStoryboard.storyboard --sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk
and while it seemed to run without errors, it actually produced an empty storyboardc directory. Upgrading the minimum deployment target to 8.0 produced a properly constructed storyboardc, with an Info.plist file inside. When IBTool fails / produces an empty directory, I definitely think it should actually fail, and cease compilation, because otherwise everything looks like it's properly set up and correct, it actually isn't.
So yeah, solution for us was upgrading the minimum deployment target of our app.
I had this problem due to changes in the Storyboard color of Status Bar Style and not changed in project settings
For me solution is:
I used this code to load a new view controller - [UIStoryboard storyboardWithName:#"UIViewController" bundle:nil];
First I tried - [UIStoryboard storyboardWithName:#"UIViewController" bundle:[NSBundle mainBandle]];
But no lucky, finally I changed this code to:
[self performSegueWithIdentifier:#"Segue" sender:self];
And it helped, maybe it can help somebody too.
Had the same issue. Solved it buy adding libc++.tbd in Link Bindary with Libraries.

iPad apps never install in Retina simulator

I've racked my brains over this one, and I'm probably just making a stupid mistake. After switching to Xcode 4.5.1 (it may have happened at 4.5) I simply cannot load an app into the iPad Retina simulator. I've edited the compilation scheme to say to always use the Retina display for the iPad. No love. It used to be that you could change simulators on the fly and whatever one was open would be the one the project compiled for. But I can't figure out how to do this in 4.5. Help!
Something funky is going on, which seems to be not acting as expected. Try these solutions in the following order.
Your method is correct, you set your Simulator Display preference when editing your schemes. Make sure your destination for the scheme is the iPad simulator, that it's tied to the Run scheme, and set iPad Simulator display to Retina. Save/apply your scheme changes, try to run your app. If that doesn't work, close + re-open Xcode, check scheme settings to see if they stuck, and try again
You may want to double check if your changes stuck. Delve into your project file (by right clicking on your project file, and selecting "Show Package Contents"). Then navigate to:
xcuserdata->username.xcuserdatad->xcschemes->ProjectName.xcscheme
Open it up in your favourite editor, and check to see if there's a:
simulatorIPadDisplay = "2.000000"
...for your required scheme
If none of that worked, then it may be an issue with your derived data (unlikely, but step 1 should have worked). Go to Organizer, and select the Projects tab. Then hit 'Delete...' for derived data. Do the same as before; run, close Xcode, check and re-run.
Well we really are in a pickle, that is the only method to set your preferred simulator display for a build scheme. You may need to resort to removing Xcode and re-installing, and trying the previous steps again.
What on earth is going on?! We've exhausted our methods, you may need to let Apple know about this issue.
Well, after a long session of "find all of my settings files and save them, delete Xcode and all of its settings files, reinstall Xcode, re-download simulators and dockets, replace settings files, etc., etc." I found myself in the same position. No Retina simulator for me.
The problem wasn't Xcode or the project file--the 5.0 simulator will simply not launch in Retina mode. The 5.1 and 6.0 simulators work fine, as I discovered when I switched to them in the compilation scheme. Switch back to 5.0 and I'm stuck in normal simulator mode. The reason I've been using the 5.0 simulator was to test lowest-common-denominator iOS features. That, and there is a bug in iOS 6.0 that affects large packet transfer via IPSec that hasn't been fixed yet.
So, I still don't know what the missing Derived Data status was all about, except that it's fixed now and I assume that reinstalling the app was the fix.

Base SDK Missing xcode 4.3.3

I used OSX 10.7.4 , Xcode 4.3.3 and iPad iOS 5.1.1 . I already run my app to iPad but the app cannot be open. i find out that my Xcode is base sdk missing. i also don't have the folder that can select to simulator. there's only folder for MacOSX10.4u.sdk MacOSX10.5u.sdk MacOSX10.6u.sdk only. How can i run my app perfectly.
Update:
this is the problem
and there's no iOS sdk
Head to your Project Settings, and under 'Summary' change 'Deployment Target' to whatever you like (say, '5.0'). If that doesn't work, select 'Manage Schemes' via the 'Product' menu and then 'Autocreate Schemes Now'.
Is this either one of your old projects or even some project you got from somewhere else (including even the sample projects that Apple provides)? You can fix this "Missing Base SDK" by selecting the project on the top of the panel on the left (in this example, it's one of Apple's samples, "Recipes", and then click on the "Validate Settings" button:
After doing that, you'll probably get a message about updating your project. Go ahead and you should be good:
If you just created the project, then it's something else. But this is the most common scenario for "missing base SDK".
I came here looking for a solution for XCode 3.2.6 but other answers did not seem to apply. Further experimentation found that Project -> Edit Active Target and then setting Base SDK on that page was just what I needed. Hope this helps the next guy that stumbles through.

"Base SDK Missing" after upgrading to Xcode 3.2.5

So I took the step upgrading to Xcode 3.2.5 (iPhone SDK 4.2) and now I cannot run to device. I always see this now in the dev environment:
In my current projects, when going to the project settings I can only set the Base SDK to iOS 4.2 but this doesn't change the "Base SDK Missing" problem. :/
I can however deploy to the simulator, and change which version I want the simulator to load as.
Does anyone know how to fix this?
If I create a new project I don't get this...
Thanks
I solved this problem, by doing this:
Project->Edit Project Settings->Build->Base SDK->Latest SDK (4.2)
Project->Edit Project Settings->Build->iOS Target Deployment->iOS 4.2
Project->Edit Active Target (myTarget)->Base SDK->Latest SDK (4.2)
Project->Edit Active Target (myTarget)->iOS Target Deployment->iOS 4.2
And, If you still have problems:
Click the box that says base SDK missing, and select:
Simulator -> Debug
That should do it.
You can double-click or right-click on your target and pull up it's Info. Click on the build tag and look for the setting for Base SDK. You probably want this set to Latest iOS, which is a new option and should prevent this from happening the next time you upgrade.
However, you might be better off doing this at the Project level, by selecting Project -> Edit Project Settings and following the steps above. You can also select the general tab under the project settings and set your Base SDK with the "Base SDK for all Configurations" drop down. That has the advantage of fixing a problem that sometimes crops up with your linked frameworks (if they are all in red in the sidebar, you have the problem).
I found that, with Xcode 3.2.5 after setting the Base SDK to Latest iOS in the Project and Target Build info settings, quitting and restarting Xcode automatically got rid of the "Base Missing SDK" message in the select widget.
Here's what you have to do:
Double click on the main project icon to open properties.
Under the General tab, set "Base SDK for all configurations" to "Latest iOS".
Under Build tab, set Base SDK to the same thing.
Repeat this step for all framework projects under your main project.
Finally, and this is the bit I was missing for an annoying week or so, double-click your TARGET (under "Targets") and perform the same steps.
Things should be back to normal - and since "Latest iOS" should hopefully keep you updated with each new SDK released, you won't have to go through all that again.
Finally - restart Xcode or otherwise cause the project file to be reloaded.
Unless you work with people who haven't upgraded yet and persist in submitting changed project files. Apply a similar penalty as you would for breaking a build until they get it. :-)
RESTarting is must folks .. if u won't restart your project (just close the project and then reopen it ) you will see the same thing " base sdk missing"... i also had the same trouble .. but restarting works..
I do not think you need to restart xCode, nor reopen your projects. Try this:
In the main project window, select Option-Cmd-E, choose build and "latest ios...".
Close the build window.
In the main project window, option-click the dropdown for Base SDK and you should see the latest build available.
Select that and you should be good to go.
Takes 5 seconds. I hope this helps..
This works fine for me. Just don't forget to restart Xcode.

Resources