I'm new to IOS programming and now experimenting with Swift. Everything was working fine until I tried to use facebook SDK. I added a new bridging header to import facebooksdk, and in my view controller I have
var fbl: FBLoginView = FBLoginView()
But this line gives me an error when deploying the app to my phone, and it crashes with app launch. The error code I get is:
dyld: Symbol not found: _OBJC_CLASS_$_NSHTTPCookieStorage
When using the simulator tho, everything works fine. What would be the reason for this error?
Did you import foundation?
import Foundation
Related
I have spent some time building a simple synth application. I have imported the following AudioKit packages into the app:
import AudioKit
import AudioKitEX
import DunneAudioKit
import SoundpipeAudioKit
The application builds and runs fine on my actual device, an iPhone 13 mini. However, when I test the app on the Xcode simulators, the app crashes before it is able to load any of the user interface.
I get the following message in the console:
2022-11-05 18:07:48.727337-0500 SYNTH-APP-BETA-1[65947:1665594] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x6000035ccda0> F8BB1C28-BAE8-11D6-9C31-00039315CD46
(lldb)
Also, when the app crashes, the following part of the code is highlighted in a red line. Specifically, the line that begins ft->lobits. I believe this is AudioKit code:
/* initialize constants in ftable */
int sp_ftbl_init(sp_data *sp, sp_ftbl *ft, size_t size)
{
ft->size = size;
ft->sicvt = 1.0 * SP_FT_MAXLEN / sp->sr;
ft->lobits = log2(SP_FT_MAXLEN / size);
ft->lomask = (1<<ft->lobits) - 1;
ft->lodiv = 1.0 / (1<<ft->lobits);
ft->del = 1;
return SP_OK;
}
Here is a screenshot:
Any help would be nice. Otherwise, I will probably restart the whole application and build on simulators much earlier in the process.
Thanks.
I've not seen this crash. I would start with the standard stuff: resetting Swift package caches, delete the app from the simulator, clean project, close and reopen Xcode. Also I'm not sure if you need to include import AudioKitEX on this level unless it throws some errors removing it.
When using the new Xcode 11 beta. I'm getting the following crash while running my app that uses MapKit. Xcode 10 works fine. Also creating a new project and adding a Map with Mapkit works fine.
A simple web search doesn't yield anything.
Any clues where to look to solve this problem?
Xcode 11 beta 1:
dyld: Symbol not found: _NavigationConfig_MapLocalizeLabels
Referenced from: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/MapKit.framework/MapKit
Expected in: /Users/Teameh/Library/Developer/Xcode/DerivedData/MyApp-dejdjcwzzweszweqllhjxqbarbsp/Build/Products/Debug-iphonesimulator/Navigation.framework/Navigation
in /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/MapKit.framework/MapKit
Xcode 11 beta 3:
dyld: Symbol not found: _NavigationConfig_MapLocalizeLabels
Referenced from: /System/Library/Frameworks/MapKit.framework/MapKit
Expected in: /Users/Teameh/Library/Developer/Xcode/DerivedData/MyApp-dejdjcwzzweszweqllhjxqbarbsp/Build/Products/Debug-iphonesimulator/Navigation.framework/Navigation
in /System/Library/Frameworks/MapKit.framework/MapKit
I've split my code up in multiple frameworks, one is called Navigation.framework, could that be the issue? This was not a problem with Xcode 10.
Update 1
As suggested by in the comments, this is not fixed by adding MapKit to the embedded frameworks. I thought system frameworks should not be added to the embedded frameworks, and this shows that that does not work.
Update 2
I've removed MapKit and all the code referencing it but still I get the same crash.
As you stated you have your own Navigation Framework.
Xcode is looking for _NavigationConfig_MapLocalizeLabels in your own Navigation Framework instead of Mapkit's Navigation framework.
Renaming your Navigation framework to something else should do the trick.
I have been learning Swift and had a recurring problem throughout. The playground, when run, doesn't finish running the code, even the default MyPlayground file. I get no output whatsoever.
I have searched online and others have the same problem as me but no answer. This happens for the default and built up files I have created previously.
I spoke to Apple on 3 separate occasions and got nothing and referred to the Developer forums and they haven't got an answer either.
Any ideas guys?
For example,
//: Playground - noun: a place where people can play
import Cocoa
var str = "Hello, playground"
print(str)
This is the default and when run, I don't get the output of str or anything in the Utilities view, it just says running MyPlayground at the top.
Thanks
What are you building for? iOS, macOS, or tvOS?
The default file for macOS is as you say:
import Cocoa
var str = "Hello, playground"
Which runs perfectly, with no errors.
But when I run your code built for iOS, Xcode throws an error:
Swift Compiler Warning: No such module `Cocoa`.
Either way, you cannot import Cocoa in playgrounds built for iOS, so don't import Cocoa, import UIKit instead. Besides, import UIKit is the default file when building for iOS. So I suspect you're running the default macOS file in an iOS build of playgrounds.
There is another question here which addresses the issue of importing Cocoa in Playgrounds.
Since you're having what looks like a null pointer exception, based on your comment, likely from the project trying to load a non-existent object, here are some troubleshooting steps:
Erase import Cocoa.
Type in import (Notice the space at the end.)
Type in C
If C doesn't come up with an autocomplete list with Cocoa in it, then it's not part of the build.
And this would explain the null pointer exception (EXC_BAD_ACCESS at 0x0.)
Next, in the same playground:
Erase the import Cocoa line
Type in import (space at the end.)
Type in UI and wait for an autocomplete list
If UI has the autocomplete option for UIKit, then Cocoa isn't part of the playground.
Which is why there is a null pointer error.
I am trying to send an update to an application built in Xcode 7, Swift 2.3. The application builds and runs fine with no issues, however, when I attempt to Archive I receive "Use of undeclared type 'MFMailComposeViewControllerDelegate'".
I figured it was just my old project giving me grief so I created a new project which had one class:
import UIKit
import MessageUI
class ViewController: UIViewController, MFMailComposeViewControllerDelegate {}
Again, it works when building and gives me the same error when archiving. I am currently using Xcode 8.0, any ideas??
I am writing an app for my iPad running 3.2.2 with XCode 3.2.3. It seems that the highest version of the iOS for iPad this version of XCode has is 3.2, but other apps load fine onto the phone so this doesn't seem to be an issue. I am attempting to make use of the new UITextChecker class. I have imported UIKit, and UITextChecker.h appears in the headers folder under the UIKit.framework icon. However, when I try to compile this code:
NSString *theLanguage = [[UITextChecker availableLanguages] objectAtIndex:0];
or simply this:
UITextChecker *textChecker;
XCode tells me that UITextChecker is undeclared. Any ideas what it going on here? Thanks!
James
Here is a picture of the UIViewController's header file:
For whatever reason, UIKit.h does not import UITextChecker.h. You can fix this by also adding the following line.
#import <UIKit/UITextChecker.h>