Unknown type name 'SCNetworkReachabilityRef' - ios

Getting this error while building and running the project.
Unknown type name '**SCNetworkReachabilityRef**'
Unknown type name '**SCNetworkReachabilityFlags**'
I am using Xcode 9.2 with Swift 4.0
I have installed following pods into my Project which uses Cocoapod 1.6.0.
GoogleMaps
CardIO
QuickBlox
QMServices
QMChatViewController
Quickblox-WebRTC
TTTAttributedLabel
SDWebImage
SVProgressHUD
SearchEmojiOnString
IAlertView+Blocks
Alamofire
SwiftyJSON
Fabric
Crashlytics
QMServices
QuCore-ThirdParty
SAMKeychain
FunkyObjC (version 1.3)
Firebase/Core
List item
I try to troubleshoot the error! But didn't get the proper solution!
Can anyone please help me with this issue?

This is a way to figure out yourself
Select SCNetworkReachabilityFlags.
Press ⌘C to copy the string.
Press ⇧⌘0 (zero not o) to open the documentation.
Press ⌘V to paste SCNetworkReachabilityFlags into the search field.
You will see
On the right side there is the enclosing framework. SCNetworkReachabilityFlags belongs to SystemConfiguration
You have to #import a framework to be able to access its types.
So add
#import SystemConfiguration
in the file where the Reachability API is used.

You need to import SystemConfiguration.
Correspondingly Class names have been changed. You would get it as suggestion in Xcode.

Related

No such module 'Firebase' - Xcode and Swift Package Manager

I'm trying to incorporate Firebase Analytics into my SwiftUI project in Xcode. I've added the Firebase package using Swift Package Manager, and am able to call FirebaseApp.configure() to initialize my app in my UIApplicationDelegate class. Now I'm trying to log analytics events and am running into an issue.
My UIApplicationDelegate class is in an iOS-specific folder. I have a service class that is in a Shared folder (to be used across both iOS and macOS builds). In my service class, I've added a line that says:
import Firebase
However, when I go to build my iOS target I get an error saying:
No such module 'Firebase'
I don't know why this import statement would cause a problem, since I have the very same statement in my UIApplicationDelegate class. The only thing I could think of was that somehow my Shared classes don't know about Firebase? Maybe? When I view the iOS target in my project it shows that the FirebaseCrashlytics and FirebaseAnalytics frameworks have been added to it.
I'm at a loss as to what's happening. All other things I've found online are for Cocoapods, which I'm not using for dependency management. I'm leveraging the Swift Package Manager for this. Any help would be greatly appreciated!!
I had the same issue but the post below from GitHub should fix it:
https://github.com/firebase/firebase-ios-sdk/issues/9014#issuecomment-979489434
After installing the Firebase swift package, make sure you add the Firebase libraries to Frameworks:
TARGETS -> Your App -> General -> Frameworks, Libraries, and Embedded Content -> hit '+' to add the Firebase libraries you want:
I had the same error but with 'FirebaseCore'. I tried everything, but what worked for me was to add #_implementationOnly to import. So it should look like this:
#_implementationOnly import FirebaseCore
Here is the link that helped me and it says:
You could use #_implementationOnly import for the modules from the
third-party SDK if you aren't using anything from that SDK as part of
your module's public interface.

How to import native iOS framework in Kony IDE

Im trying to integrate an iOS framework in Kony. I've tried to follow the documentation to import a native framework using the Manage Native Function API(s) menu, however I get the following error: "Error while importing framework .zip extract error: undefined".
Any help is appreciated. Thanks!
I haven't imported for iOS. But below are the steps to import or add a native framework to the project.
We are using Kony Visualizer Enterprise 7.3. Please find the steps below.
Goto Edit -> Manage Native Function
Select Import option under IOS tab
Select the valid .zip IOS framework file which you need to import.
If you are getting error, please double check if the file is the right/valid one. Try to import any other framework zip to verify if it is working.
Alternative if you want to use existing one, please select Add
Hope this helps. Thanks.

'FBSDKLoginKit/FBSDKLoginKit.h' file not found (Facebook SDK for iOS v4.2 & Xcode 7)

I follow all the steps in This Tutorial and/or Facebook SDK Documentation to install Facebook Login on my App, but when I run the code I get an error. although Facebook mention I can just use import (Swift) to include the framework, I try to do it the old fashion as well with Objective-C Bridge Header.
Error:
'FBSDKLoginKit/FBSDKLoginKit.h' file not found
ScreenshotAs you can see the bridge.h is being read by the compiler, but due to internal file error it will throw error.
Bridge.h In Xcode 6 you don't require bridge header file, I could just do it with import
#import <FBSDKLoginKit/FBSDKLoginKit.h>
This problem is due to Xcode 7 Beta, I have tried to do it on Xcode 6 and it worked perfectly with just an import FBSDKLoginKit. Can anyone tell me a hack around this? or if there is a way to convert my Swift 2 code back to 1.4 and work on Xcode 6.
I had the same problem.
Managed to sort the directory by adding the Facebook SDK in "Framework Search Path".
Target -> Build Settings -> Framework Search Paths -> + /Users//Documents/FacebookSDK
it works!
=]
For those using cocoapods the solution for me was actually adding FBSDKCoreKit to podfile:
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
The facebook documentation is incomplete, they dont mention anything about including FBSDKCoreKit pod reference.
For [login,sharekit,corekit].h file not found error , My solution was:
changing framework searchpath of RCTFBSDK (inside library of the project)
~/Documents/FacebookSDK
to
$(HOME)/Documents/FacebookSDK
I have the same issue and recognized, that my old XCode 6 projects worked with the Facebook frameworks.
So i try the following workaround and that fixed the problem. however i don't know why:
Facebook iOS SDK 4.2
Create a fresh project in XCode 6
Link the Facebook Frameworks to your project as described in the docs
Close the project and reopen it in XCode 7
The "To Swift 2 Converter" should open within the project - Convert the project to Swift 2
Run the project - in my case everything works fine.
After that i copied my "old" Swift 2 Files into the new project. The app starts without any issues.
I observed the changes by the converter, but can't recognized any change depending the Facebook frameworks.
Had the same issue, instead of updating the search path
I solved it by removing the Frameworks from the project and then adding them checking the Copy items if needed box
My header files looks this
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
You can simply put ~/Documents/FacebookSDK in Framework Search Paths and it will work for any user
this is a known bug: https://developers.facebook.com/bugs/362995353893156/
Check out this solution: Facebook iOS8 SDK build module error for FBSDKCoreKit

Parse API 1.6.4 - cannot build project

I downloaded the new iOS Parse API (1.6.4) and tried to build my project. When I do, I get this error:
Undefined symbols for architecture arm64" "_BFTaskMultipleExceptionsException", referenced from:
___53+[PFObject(Private) deleteAllAsync:withSessionToken:]_block_invoke214 in Parse(PFObject.o)
___65+[PFObject(Private) _deepSaveAsync:withCurrentUser:sessionToken:]_block_invoke311 in Parse(PFObject.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Screenshot:
Temporary workaround for Parse 1.6.4 and Facebook SDK 3.23:
Add to your AppDelegate.m or another class following constant after imports and before implementation section:
NSString *const BFTaskMultipleExceptionsException = #"BFMultipleExceptionsException";
#interface IPAppDelegate ()
#end
#implementation IPAppDelegate
It should solve the problem until it'll be solved on Parse/Facebook side.
--
Update: This solution is only for Facebook and Parse SDK versions that listed above and these versions right now are outdated.
New Parse SDK 1.7.4 works correct with new Facebook SDK 4.0 and there shouldn't be such a problem.
I was able to figure out the URL for anyone that needs Parse iOS v1.6.3.
https://parse.com/downloads/ios/parse-library/1.6.3
I can confirm that everything compiles properly using 1.6.3.
Placing
NSString *const BFTaskMultipleExceptionsException = #"BFMultipleExceptionsException";
in the App Delegate as suggested by Sergey Surkov in between the imports and the implementation and then adding libstdc++.6.dylib in build phases worked for me. Please also view https://stackoverflow.com/a/27628797/1036945
I've had the exact same problem using the latest SDKs from Parse (1.7.4) and Facebook (4.2.0). The problem is caused by the Bolts.framework included in both Parse and Facebook SDKs. For some reason the Bolts framework in Parse is always newer than the one included in the Facebook SDK.
After many-many attempts at installing, removing and re-installing these SDKs, using the drag and drop method and via Cocoapods, I finally managed to overcome this issue by undertaking the following steps:
I removed completely any instance of the Parse, Facebook and Bolts frameworks from my project;
I re-added the FBSDKCoreKit framework (and the ShareKit and LoginKit for the needs of my project) following the steps on the Facebook developer page: https://developers.facebook.com/docs/ios/getting-started/
Make sure NOT to copy the items to your project.
I re-added the Parse framework to the project using the drag-and-drop method. I also added the ParseFacebookUtilsV4 framework because I needed it to create users via Facebook Login.
This was the most important step that solved everything: I added the Bolts.framework provided by Parse by dragging it to the project, but making sure NOT to copy it to the project (just like with the FBSDKCoreKit framework, I deselected the "Copy items into destination group's folder." option. If you copy it to the project folder, the project won't build.
These steps finally solved all my problems.
if you are using cocoapods try pod update Bolts
EDIT2: FacebookSDK Update 3.23.2 resolves this issue and includes Bolts 1.1.4: https://developers.facebook.com/resources/facebook-ios-sdk-3.23.2.pkg
EDIT:
Drop -ObjC "Other Linker Flag" from your Build settings.
Bolts.framework is not necessary with Parse if Facebook SDK is integrated.
As of Facebook iOS SDK 3.14 bolts.framework is included. https://developers.facebook.com/docs/ios/upgrading-3.x
Try removing your manual instance of bolts.framework.
Just to put the record straight.
The issue is caused because of a conflict with the Bolts framework between the Facebook SDK Bolts and the Parse bolts framework. A temporary solution to get around this issue is to use Cocoapods for your Facebook SDK dependency which will help while a fix is worked on.
The bug has been acknowledged by Facebook & is being assigned to the appropriate team for fixing.
Please follow https://developers.facebook.com/bugs/383331175179417/ for the updates.
make sure the facebook sdk framework and bolts framework (comes with fb sdk) is imported into your project.
i got similar error ("...is not a dylib" and "Undefined symbols for architecture") because i dragged the whole parse folder ("parse-library-1.7.4-2") into my xcode project, when i should have dragged only the frameworks i needed ("Bolts.framework" and "Parse.framework"). deleted the parse folder, dragged over the two frameworks, then everything works as expected :)
I had the exact same problem. Updating Bolts to 1.1.4 solved it for me (Bolts was 1.1.3 before).
If you use cocoapods, change or add this line to your podfile
pod 'Bolts', '1.1.4'
If not, just download it here : https://github.com/BoltsFramework/Bolts-iOS/releases
Try downloading the latest SDK and replacing all of the Parse frameworks with the latest version.

How to properly use Bolts Framework code along with Parse and Facebook?

So,
I am building this iOS 8 app where I am using both Facebook and Parse Frameworks simultaneously. I am aware that Bolts framework is included in the latest Facebook SDK. I am attempting to use BFTasks with Parse code to make it easier to handle async taks, such as the following:
PFQuery *userQuery = [PFUser query];
[[userQuery findObjectsInBackground] continueWithSuccessBlock:^id(BFTask *task){
}];
However, including the Facebook and Parse SDKs alone won't let me access the code above via Xcode auto completion. It will even crash if I attempt to run something like the above.
On the other hand, if I try to include the Bolts Framework into the project and import the headers #import <Bolts/Bolts.h>, it will let me access the methods via auto-completion, but Xcode will complain saying that the there are duplicate binaries of the Bolts Framework.
Can anyone explain how to go about this or send me a link on a tutorial or something? I might be overlooking something simple.
Thanks a lot in advance
I was able to get it going using cocoapods. So I installed bolts using cocoapods and then manually added the Parse and Facebook SDK.
I couldn't figure out how to do it otherwise
I was having a problem with linker errors after upgrading to Parse SDK 1.9 -- references included BFTask and multiple references. Also using FB SDK 3.24 and one version using 4.7. Same problem. No cocoapods. I finally resolved it by importing both FB SDK and Bolts from the FB default location -- with no copy files provision AND importing JUST Parse and ParseFacebookUtils frameworks (not their Bolts framework) with the copy files to destination = YES. So - it appears - XCode should access Bolts from the FB SDK location when needed, but NOT see the Parse Bolts framework because Parse has been copied to the app's folder, but the Parse Bolts was not. So no double reference to Bolts. See if this helps.

Resources