Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such module "ParseFacebookUtilsV4" #59

Closed
Maxrencoret-zz opened this issue Aug 19, 2015 · 15 comments
Closed

No such module "ParseFacebookUtilsV4" #59

Maxrencoret-zz opened this issue Aug 19, 2015 · 15 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Milestone

Comments

@Maxrencoret-zz
Copy link

I've been following Parse.com instructions to integrate Facebook Parse Login and get an error "No such module "ParseFacebookUtilsV4"" when trying to import the framework in the AppDelegate.

I doubled check the "Link Binary with Libraries" and both ParseFacebookUtils are there.

Facebook SDK is working fine, Parse.frameworks works fine... the only problem is with ParseFacebookUtilsV4.framework and ParseFacebookUtils.framework.

Any ideas on how to fix this?

I replicated the same bug in a new project, following the same parse.com facebook integration instructions and get the same "No such module" error.

I've tried cmd+option+shift+K to reset Xcode caches...

Language: swift
Xcode version 6.4

Thanks

@nlutsenko
Copy link
Contributor

@maxrencoret Can you please confirm that you are using latest ParseFacebookUtilsV4.framework (or pod). At this time it's 1.8.1. This functionality was added in 1.8.0 and I just confirmed with 1.8.1 locally that it works.

The difference between ParseFacebookUtils and ParseFacebookUtilsV4 is that ***V4 supports and is built specifically for Facebook SDK v4. Meaning you don't need to use both at the same time.

@nlutsenko nlutsenko self-assigned this Aug 19, 2015
@Maxrencoret-zz
Copy link
Author

@nlutsenko I was using a previous version (1.75). I downloaded 1.8.1 but now get a different error:
"Could not build Objective-C module "ParseFacebookUtilsV4"
Any ideas?

@nlutsenko
Copy link
Contributor

Try these steps:

  • Quit Xcode
  • Clean build folder as well as ModuleCache (basically nuke ~/Library/Developer/Xcode/DerivedData)
  • Open Xcode and try building your project
  • If it fails, please paste the entire error message (Could not build module... is an outcome of something further)

@Maxrencoret-zz
Copy link
Author

@nlutsenko I deleted DeriveData but still get the same error. Looking into the error comes from another error:
"Umbrella header 'ParseFacebookUtilsV4.h' not found" in module.modulemap

@nlutsenko
Copy link
Contributor

Ow, got it... You are absolutely correct, will fix it soon.
Workarounds:

  • Create a ParseFacebookUtilsV4.h with contents #import <ParseFacebookUtilsV4/PFFacebookUtils.h> inside ParseFacebookUtilsV4.framework/Headers
  • Use CocoaPods instead of downloading the frameworks manually.

@Maxrencoret-zz
Copy link
Author

@nlutsenko I did the quick workaround and when calling
PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions) in the appDelegate I get an error:

Undefined symbols for architecture x86_64:
"OBJC_CLASS$_PFErrorUtilities", referenced from:
objc-class-ref in ParseFacebookUtilsV4(PFFacebookUtils.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I think a way around this is by eliminating arm64 in BuildingSettings/Architectures but for appstore compliance I think I need it. I eliminated DerivedData but same still have the same error.
http://stackoverflow.com/questions/26036826/apple-mach-o-linker-error-on-xcode-6-0-1
Whats the best way to fix?

@nlutsenko
Copy link
Contributor

Are you using the latest Parse SDK?
This class exists in the SDK starting from 1.8.0, but is not available before.

@nlutsenko nlutsenko added this to the 1.8.2 milestone Aug 21, 2015
@nlutsenko nlutsenko added type:bug Impaired feature or lacking behavior that is likely assumed and removed needs repro labels Aug 21, 2015
@Maxrencoret-zz
Copy link
Author

@nlutsenko that fixed it, thanks!

@nlutsenko
Copy link
Contributor

Hey @maxrencoret, just wanted to let you know that new version of ParseFacebookUtilsV4 is available right now, which includes the fix for this issue. Let me know if there is anything else I can help you with.

@pigeondotdev
Copy link

Where can I download the *.framework binary for ParseFacebookUtils 1.8.5?

@sensiblecocoa
Copy link

The instructions are missing that you should also add 'FBSDKLoginKit.framework' to your project, which is why you're getting these errors. Hope this helps.

@plaudev
Copy link

plaudev commented Aug 23, 2016

@nlutsenko, I have tried for many hours now and still getting "No such module 'ParseFacebookUtilsV4'" in my AppDelegate.swift. Can you please help?

I'm using Parse iOS SDK v1.14.2. I have added a ParseFacebookUtilsV4.h file with this content right next to ParseFacebookUtils.h inside ParseFacebookUtilsV4.framework->Headers.

I have tried your cocoapods suggestion too but it did not work either. I'd like to get it to work without cocoapods if possible. Thanks

@esusslin
Copy link

@plaudev did you figure out a solution to this? I've been stuck in the same place for days!

@plaudev
Copy link

plaudev commented Dec 13, 2016

@esusslin hi, it's been a few months so memory a bit fuzzy. I think I must have sorted it out as my app now works. Exactly what I did to make it happen is not apparent at this moment. Let me offer the following. If they don't help please let me know & I'll review some more.

My imports in AppDelegate.swift:

import UIKit
import Parse
import Bolts
import FBSDKCoreKit
import FBSDKLoginKit
import ParseFacebookUtilsV4

My ParseStarterProject-Bridging-Header.h

#ifndef ParseStarterProject_Bridging_Header_h
#define ParseStarterProject_Bridging_Header_h

#import <ParseFacebookUtilsV4/PFFacebookUtils.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>

#endif

Within ParseFacebookUtilsV4.framework I have 2 header files.

ParseFacebookUtilsV4.h:

#import <ParseFacebookUtilsV4/PFFacebookUtils.h>

and PFFacebookUtils.h which is much longer file:

/**
 * Copyright (c) 2015-present, Parse, LLC.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

#import <Foundation/Foundation.h>

#import <Bolts/BFTask.h>

#import <Parse/PFConstants.h>
#import <Parse/PFUser.h>

#import <FBSDKCoreKit/FBSDKAccessToken.h>

#if TARGET_OS_IOS
#import <FBSDKLoginKit/FBSDKLoginManager.h>
#endif

NS_ASSUME_NONNULL_BEGIN

/**
 The `PFFacebookUtils` class provides utility functions for using Facebook authentication with `PFUser`s.

 @warning This class supports official Facebook iOS SDK v4.0+ and is available only on iOS.
 */
@interface PFFacebookUtils : NSObject

///--------------------------------------
/// @name Interacting With Facebook
///--------------------------------------

/**
 Initializes Parse Facebook Utils.

 You must provide your Facebook application ID as the value for FacebookAppID in your bundle's plist file
 as described here: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/

 @warning You must invoke this in order to use the Facebook functionality in Parse.

 @param launchOptions The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:].
 */
+ (void)initializeFacebookWithApplicationLaunchOptions:(nullable NSDictionary *)launchOptions;

#if TARGET_OS_IOS
/**
 `FBSDKLoginManager` provides methods for configuring login behavior, default audience
 and managing Facebook Access Token.
 
 @warning This method is available only on iOS.

 @return An instance of `FBSDKLoginManager` that is used by `PFFacebookUtils`.
 */
+ (FBSDKLoginManager *)facebookLoginManager;
#endif

///--------------------------------------
/// @name Logging In
///--------------------------------------

/**
 *Asynchronously* logs in a user using Facebook with read permissions.

 This method delegates to the Facebook SDK to authenticate the user,
 and then automatically logs in (or creates, in the case where it is a new user) a `PFUser`.

 @param permissions Array of read permissions to use.

 @return The task that has will a have `result` set to `PFUser` if operation succeeds.
 */
+ (BFTask<PFUser *> *)logInInBackgroundWithReadPermissions:(nullable NSArray<NSString *> *)permissions;

/**
 *Asynchronously* logs in a user using Facebook with read permissions.

 This method delegates to the Facebook SDK to authenticate the user,
 and then automatically logs in (or creates, in the case where it is a new user) a `PFUser`.

 @param permissions Array of read permissions to use.
 @param block       The block to execute when the log in completes.
 It should have the following signature: `^(PFUser *user, NSError *error)`.
 */
+ (void)logInInBackgroundWithReadPermissions:(nullable NSArray<NSString *> *)permissions
                                       block:(nullable PFUserResultBlock)block;

/**
 *Asynchronously* logs in a user using Facebook with publish permissions.

 This method delegates to the Facebook SDK to authenticate the user,
 and then automatically logs in (or creates, in the case where it is a new user) a `PFUser`.

 @param permissions Array of publish permissions to use.

 @return The task that has will a have `result` set to `PFUser` if operation succeeds.
 */
+ (BFTask<PFUser *> *)logInInBackgroundWithPublishPermissions:(nullable NSArray<NSString *> *)permissions;

/**
 *Asynchronously* logs in a user using Facebook with publish permissions.

 This method delegates to the Facebook SDK to authenticate the user,
 and then automatically logs in (or creates, in the case where it is a new user) a `PFUser`.

 @param permissions Array of publish permissions to use.
 @param block       The block to execute when the log in completes.
 It should have the following signature: `^(PFUser *user, NSError *error)`.
 */
+ (void)logInInBackgroundWithPublishPermissions:(nullable NSArray<NSString *> *)permissions
                                          block:(nullable PFUserResultBlock)block;

/**
 *Asynchronously* logs in a user using given Facebook Acess Token.

 This method delegates to the Facebook SDK to authenticate the user,
 and then automatically logs in (or creates, in the case where it is a new user) a `PFUser`.

 @param accessToken An instance of `FBSDKAccessToken` to use when logging in.

 @return The task that has will a have `result` set to `PFUser` if operation succeeds.
 */
+ (BFTask<PFUser *> *)logInInBackgroundWithAccessToken:(FBSDKAccessToken *)accessToken;

/**
 *Asynchronously* logs in a user using given Facebook Acess Token.

 This method delegates to the Facebook SDK to authenticate the user,
 and then automatically logs in (or creates, in the case where it is a new user) a `PFUser`.

 @param accessToken An instance of `FBSDKAccessToken` to use when logging in.
 @param block       The block to execute when the log in completes.
 It should have the following signature: `^(PFUser *user, NSError *error)`.
 */
+ (void)logInInBackgroundWithAccessToken:(FBSDKAccessToken *)accessToken
                                   block:(nullable PFUserResultBlock)block;

///--------------------------------------
/// @name Linking Users
///--------------------------------------

/**
 *Asynchronously* links Facebook with read permissions to an existing `PFUser`.

 This method delegates to the Facebook SDK to authenticate
 the user, and then automatically links the account to the `PFUser`.
 It will also save any unsaved changes that were made to the `user`.

 @param user        User to link to Facebook.
 @param permissions Array of read permissions to use when logging in with Facebook.

 @return The task that will have a `result` set to `@YES` if operation succeeds.
 */
+ (BFTask<NSNumber *> *)linkUserInBackground:(PFUser *)user
                                   withReadPermissions:(nullable NSArray<NSString *> *)permissions;

/**
 *Asynchronously* links Facebook with read permissions to an existing `PFUser`.

 This method delegates to the Facebook SDK to authenticate
 the user, and then automatically links the account to the `PFUser`.
 It will also save any unsaved changes that were made to the `user`.

 @param user        User to link to Facebook.
 @param permissions Array of read permissions to use.
 @param block       The block to execute when the linking completes.
 It should have the following signature: `^(BOOL succeeded, NSError *error)`.
 */
+ (void)linkUserInBackground:(PFUser *)user
         withReadPermissions:(nullable NSArray<NSString *> *)permissions
                       block:(nullable PFBooleanResultBlock)block;

/**
 *Asynchronously* links Facebook with publish permissions to an existing `PFUser`.

 This method delegates to the Facebook SDK to authenticate
 the user, and then automatically links the account to the `PFUser`.
 It will also save any unsaved changes that were made to the `user`.

 @param user        User to link to Facebook.
 @param permissions Array of publish permissions to use.

 @return The task that will have a `result` set to `@YES` if operation succeeds.
 */
+ (BFTask<NSNumber *> *)linkUserInBackground:(PFUser *)user
                                withPublishPermissions:(NSArray<NSString *> *)permissions;

/**
 *Asynchronously* links Facebook with publish permissions to an existing `PFUser`.

 This method delegates to the Facebook SDK to authenticate
 the user, and then automatically links the account to the `PFUser`.
 It will also save any unsaved changes that were made to the `user`.

 @param user        User to link to Facebook.
 @param permissions Array of publish permissions to use.
 @param block       The block to execute when the linking completes.
 It should have the following signature: `^(BOOL succeeded, NSError *error)`.
 */
+ (void)linkUserInBackground:(PFUser *)user
      withPublishPermissions:(NSArray<NSString *> *)permissions
                       block:(nullable PFBooleanResultBlock)block;

/**
 *Asynchronously* links Facebook Access Token to an existing `PFUser`.

 This method delegates to the Facebook SDK to authenticate
 the user, and then automatically links the account to the `PFUser`.
 It will also save any unsaved changes that were made to the `user`.

 @param user        User to link to Facebook.
 @param accessToken An instance of `FBSDKAccessToken` to use.

 @return The task that will have a `result` set to `@YES` if operation succeeds.
 */
+ (BFTask<NSNumber *> *)linkUserInBackground:(PFUser *)user withAccessToken:(FBSDKAccessToken *)accessToken;

/**
 *Asynchronously* links Facebook Access Token to an existing `PFUser`.

 This method delegates to the Facebook SDK to authenticate
 the user, and then automatically links the account to the `PFUser`.
 It will also save any unsaved changes that were made to the `user`.

 @param user        User to link to Facebook.
 @param accessToken An instance of `FBSDKAccessToken` to use.
 @param block       The block to execute when the linking completes.
 It should have the following signature: `^(BOOL succeeded, NSError *error)`.
 */
+ (void)linkUserInBackground:(PFUser *)user
             withAccessToken:(FBSDKAccessToken *)accessToken
                       block:(nullable PFBooleanResultBlock)block;

///--------------------------------------
/// @name Unlinking Users
///--------------------------------------

/**
 Unlinks the `PFUser` from a Facebook account *asynchronously*.

 @param user User to unlink from Facebook.
 @return The task, that encapsulates the work being done.
 */
+ (BFTask<NSNumber *> *)unlinkUserInBackground:(PFUser *)user;

/**
 Unlinks the `PFUser` from a Facebook account *asynchronously*.

 @param user User to unlink from Facebook.
 @param block The block to execute.
 It should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
 */
+ (void)unlinkUserInBackground:(PFUser *)user block:(nullable PFBooleanResultBlock)block;

///--------------------------------------
/// @name Getting Linked State
///--------------------------------------

/**
 Whether the user has their account linked to Facebook.

 @param user User to check for a facebook link. The user must be logged in on this device.

 @return `YES` if the user has their account linked to Facebook, otherwise `NO`.
 */
+ (BOOL)isLinkedWithUser:(PFUser *)user;

@end

NS_ASSUME_NONNULL_END

@plaudev
Copy link

plaudev commented Dec 13, 2016

@esusslin I found my notes from that time. Hope this helps - please let me know either way. Here goes...

I started from scratch from the [latest Parse github version here](https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/releases). (Edit: please check if there is a more up-to-date one.) Initially just replacing contents of my `ParseFacebookUtilsV4.h`  and `PFFacebookUtils.h`  by copying & pasting text from github files DID NOT work. I had to delete my entire `ParseFacebookUtilsV4.framework`  and replace it wholesale to make it work. 
As an aside, the compile does have one warning (not error). For some reason the Framework Search Paths  in Build Settings has a spelling mistake in it. Apparently one of the environment variables (I think `$(inherited)` )  is the culprit. Specifically, somehow something is spelling what should be `/Users/username/...`  as `/User/username/...` , ie not in plural form. But I've looked everywhere and tried & tried to fix it but could not. It is something I may have to live with for now until a solution pops up. For now though, elimination of the `$(inherited)` variable will compile without errors or warnings.
I have just been able to login with facebook (Edit: from actual device). But there is a caveat. It does NOT work on the simulator even if I log into facebook in safari before running the app.

However I have since been able to make my app sign in with facebook even on the emulator. I'm not recalling exactly what I had to do though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

6 participants