14

I've updated my project to iOS 9, my podfile, and all necessary files, but it will not build. The source of my grief is in the following error message:

Type arguments cannot be applied to non-parameterized class 'BFTask'

This is the only error that shows, but it shows up multiple times in both PFAnalytics.h and probably more importantly PFObject.h.

Could someone tell me what this means and please suggest a solution? I hope I have provided enough information, but if not, let me know!

**Update 01:** I couldn't post the screenshot of the errors because my reputations aren't enough.

The code samples are as follows: In PFObject.h and PFAnalytics.h, everywhere there is the following:

(BFTask PF_GENERIC(XXSOMECLASS *)*) someMethod; 

the error is thrown. This is no code of mine, it is PFObject.h and PFAnalytics.h as stated before. Examples of the functions throwing the error in PFObject.h are below

- (BFTask PF_GENERIC(NSNumber *)*)saveInBackground; 
- (BFTask PF_GENERIC(NSNumber *)*)saveEventually;
- (BFTask PF_GENERIC(NSNumber *)*)deleteInBackground;
+ (BFTask PF_GENERIC(NSNumber *)*)saveAllInBackground:(PF_NULLABLE NSArray *)objects;
+ (BFTask PF_GENERIC(NSNumber *)*)deleteAllInBackground:(PF_NULLABLE NSArray *)objects;
// .... etc

when clicking on the stop sign the suggestion is to delete PF_GENERIC(NSNumber *), resulting in a method like this

 - (BFTask *)xxsomeMethod; 

but that doesn't help as it just gets a lot messier

Update 02: The contents of my Podfile:

# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'

target: 'BMR' do 
    pod 'AFNetworking', '~> 2.6' 
    pod 'ParseFacebookUtils', '~> 1.8' 
    pod 'Parse' 
    pod 'ParseUI', '~> 1.1' 
    pod 'FBSDKCoreKit', '~> 4.6' 
    pod 'FBSDKLoginKit', '~> 4.6'
    pod 'JSQMessagesViewController', '~> 7.2'
    pod 'IDMPhotoBrowser', '~> 1.7' 
    pod 'RNGridMenu', '~> 0.1' 
    pod 'APHorizontalMenu', '~> 1.3' 
    pod 'ASIHTTPRequest', '~> 1.8' 
    pod 'AutoScrollLabel', '~> 0.4' 
    pod 'CJAMacros', '~> 2.1' 
    pod 'CrittercismSDK', '~> 5.3'
end
radiovisual
  • 6,298
  • 1
  • 26
  • 41
user2565629
  • 163
  • 1
  • 5
  • I recently [opened an issue with the Parse-iOS repo](https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/297) with the same issue. – radiovisual Sep 19 '15 at 23:42
  • Did you update or install any new software before you got this behavior? I updated my XCode command Line tools, installed mongodb, and yeoman, then I noticed this behavior in XCode. It could be unrelated, but it might help. – radiovisual Sep 21 '15 at 14:11
  • Can you post the contents of your `Podfile` ? – radiovisual Sep 21 '15 at 14:17
  • Podfile:# Uncomment this line to define a global platform for your project # platform :ios, '8.0' target 'BMR' do pod 'AFNetworking', '~> 2.6' pod 'ParseFacebookUtils', '~> 1.8' pod 'Parse' pod 'ParseUI', '~> 1.1' pod 'FBSDKCoreKit', '~> 4.6' pod 'FBSDKLoginKit', '~> 4.6' pod 'JSQMessagesViewController', '~> 7.2' pod 'IDMPhotoBrowser', '~> 1.7' pod 'RNGridMenu', '~> 0.1' pod 'APHorizontalMenu', '~> 1.3' pod 'ASIHTTPRequest', '~> 1.8' pod 'AutoScrollLabel', '~> 0.4' pod 'CJAMacros', '~> 2.1' pod 'CrittercismSDK', '~> 5.3' end – user2565629 Sep 21 '15 at 20:26
  • Thanks. I added the podfile to your question to make it easier to read. – radiovisual Sep 21 '15 at 21:13
  • thanks. sorry about that – user2565629 Sep 21 '15 at 21:15
  • No problem. Is there any chance you can share your Xcode project with me privately? If privacy is a concern, you can remove anything sensitive, or I will gladly sign a NDA. I would like to compare our projects and see if I can catch the similarities. The team at Parse is having trouble finding the cause, so we need more information. – radiovisual Sep 22 '15 at 10:46
  • any luck? same problem here after upgrading parse – bmurmistro Sep 23 '15 at 02:12
  • @bmurmistro, no luck so far, but I am sending the Parse team a stripped-down version of my XCode project so they can take a look at what is happening. You can [follow along with progress on github](https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/297). Maybe you can join in on the conversation on github and help us narrow the problem down. – radiovisual Sep 23 '15 at 19:11
  • @bmurmistro, are you willing to share your project with the Parse team as well? The more data they have the faster they can solve this problem. – radiovisual Sep 23 '15 at 19:13
  • @radiovisual I can't share at the moment, but I can tell you that it broke somewhere between version 1.8.3 and 1.8.5. I roll back to 1.8.3 and I'm good! Also, I'm using cocoapods too. – bmurmistro Sep 24 '15 at 00:09
  • I'd like to share my project with the Parse team as well – user2565629 Sep 24 '15 at 00:09
  • Looks like a solution may have been found, and the answer provided by [Cyprian](http://stackoverflow.com/a/32681016/3960969) may be the correct answer. [Refer to the issue on github](https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/297#issuecomment-142766941) for more information. – radiovisual Sep 24 '15 at 01:34

3 Answers3

7

Make sure that you don't have a duplicate version of the Bolts.framework.

If you are using both Parse SDK and Facebook SDK you will encounter a problem where Parse SDK contains an older version of Bolts (currently 1.1.5) and the FB SDK has the newest version of Bolts SDK (>= 1.2.2)

Once you remove an older version of the Bolt.framework that comes with Parse SDK you should be fine.

To check what version of Bolts.SDK you have simply go to the Bolts.framework file, right - click and choose "Get Info".

radiovisual
  • 6,298
  • 1
  • 26
  • 41
Cyprian
  • 9,423
  • 4
  • 39
  • 73
  • I don't install the frameworks manually. I install parse via cocoapods. Here are the relevant pods that I add: pod 'ParseFacebookUtils', '~> 1.8' pod 'Parse' pod 'ParseUI', '~> 1.1' pod 'FBSDKCoreKit', '~> 4.6' pod 'FBSDKLoginKit', '~> 4.6' When I run pod install (or update), it adds the current version of Bolts "Using Bolts (1.2.2)" I still get the same errors – user2565629 Sep 21 '15 at 01:31
  • This is actually the correct answer. If you are pulling in the FacebookSDK from the framework files AND you are pulling in the Facebook-iOS-SDK via Cocoapods, then there is a good chance that you have two versions of the `Bolts.framework`, it worked for me. I was pulling in the FacebookSDK and the Facebook-iOS-SDK via Cocoapods, so as soon as I deleted the file: `FacebookSDK/Bolts.framework` the errors went away. See [the issue on github](https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/297) for more information. – radiovisual Sep 24 '15 at 01:32
  • Here is my solution courtesy of Nikita Lutsenko. THANKS! If you double check your `Framework Search Paths` build setting for BMR target – you will see that `/Users/xxxxx/Documents/FacebookSDK` path is there. Even though you don’t have it explicitly added to your project – Xcode will still look for frameworks in that folder, and if it finds anything (say in our case outdated version of Bolts.framework) - it will attempt to use that in some cases. Solution for your problem – remove that line from `Framework Search Paths` or delete Bolts.framework from anywhere in that folder. – user2565629 Oct 11 '15 at 20:23
0

You have two Bolts.framework, old from FacebookSDK and new from Parse. So go to the FacebookSDK folder from where you added the FacebookSDK into the xcode and delete the Bolts.framework. Keep the new Bolts.framework and everything will be fine now.

If you still is not able to find the old Bolts.framework find the class file showing error and right click it and select show in finder and traceback the facebook folder from the finder and make sure it is in Facebook SDK folder and delete the Bolts.framework. Make sure you don't delete the new Bolts.framework you added from Parse SDK folder.

maxshuty
  • 9,708
  • 13
  • 64
  • 77
Joshua Cleetus
  • 624
  • 6
  • 14
0

I had the same problem (spent a few hours investigating whats going on). I messed up old FacebookSDK framework with the one I installed via cocoapods

  1. Check the following path ~/Documents/FacebookSDK to see if there are some outdated SDK
  2. Remove any import of Facebook SDK #import <FacebookSDK/FacebookSDK.h>
  3. Install it via cocoapods
    pod 'FBSDKCoreKit' pod 'FBSDKLoginKit' pod 'FBSDKShareKit'
    or add the new framework manually.
Mike.R
  • 2,824
  • 2
  • 26
  • 34