Cannot find interface declaration for 'AFURLSessionManager', superclass of 'AFHTTPSessionManager'? - ios

Recently i have moved my Xcode Project in to Xcode5.0.2 from the older version of Xcode 4.6.2
Now my project working normal in the 4.6.2 but when i exported in 5.0.2 its giving me compilation error AFURLSessionManager.h
/AFNetworking/AFNetworking/AFHTTPSessionManager.h:73:35: Cannot find interface declaration for 'AFURLSessionManager', superclass of 'AFHTTPSessionManager'
while there is no issue with AFHTTPSessionManager in Xcode 4.6.2
I have goggled the thing but cant find any solution. can any one please guide me on this problem??how to solve this.?

The issue appears to be a bug in the iOS compile-time version checking logic for these classes referenced in pull request 1486. I believe this has since been remedied. I'd suggest you retrieve the latest AFNetworking code and try again.

Related

Convert to Current Swift Syntax Failed - "No such module" (Swift 4, Xcode 9)

In Xcode 9, I am trying to do the automatic conversion to Swift 4.
It fails with the following message:
Convert to Current Swift Syntax Failed
Please ensure that all selected targets build successfully with the currently configured Swift version before attempting a migration.
It's complaining of a missing module. But when I do a regular build there are no issues. Not sure if this is relevant, but the module (which Xcode is complaining is missing) was already converted to Swift 4 earlier (in it's own project).
Note: No Cocoapods / Carthage used here.
Note: Two solutions tried (and worked) but do not address the underlying issue.
One solution is to do the conversion manually (change Swift version to 4 in build setting and apply Fix-Its one by one until no more build errors).
Another solution is to disable the third party framework (comment out all code where it's used), do the auto-migration, and then re-enable the framework. This could get pretty difficult with bigger projects.
I can't find any solution yet.
For now I fix manually setting Swift Language Version
After changing from 3.2 to 4.0 I compile and fix errors and warnings manually.
I'm waiting for a better solution!
I also got this problem while converting my project to Swift 4.0. Looks like problem appears when you try to convert target which imports a framework which is already in Swift 4.0. At your screenshot you try to convert 'RecipeTextParser' which imports 'SovaTools' which is already Swift 4.0.
I found dirty, but working solution. You can use older(Swift 3.2) version of 'SovaTools' when converting. You should NOT check it's mark in target selection window of conversion tool. Then, when 'RecipeTextParser' will be successfully converted you can use Swift 4.0 'SovaTools' version again.
I got this error and in my case one of my Pods(the one Xcode was complaining about) was a Swift 4 target and the rest were Swift 3.2. Looking at the build logs it looks like Xcode built that framework in one location and was searching for it in another. When I reverted that Pod to an older version(that used Swift3.2) the problem went away. Obviously a Xcode bug. HTH
Just update your pod and it will resolve the issue.
To update pod:
open terminal and go to your project directory
type pod update
This resolved my issue.
Xcode (Xcode 9) language migration feature is not as much accurate that it can migrate your complete code/project from one swift version to another with zero tolerance. It skips few code migration for us (developers). It may be bug or inaccuracy of tool. But you need to put some manual effort also, to completely migrate swift language version for your project/code.
Now, according to your snapshot, Xcode is showing and error for 'RecipeTextParser' framework. I think this is an external/third party framework. Another point to note, you've integrated this framework using CocoaPods:
Any one of following can be reason for failure of code migration:
CocoaPods locks framework (files) for editing. So language migration process may not be able to migrate (or identify) code for external/thirdparty framework.
In general terms, Framework is package of code files, so framework itself may not allow file/source code editing.
Suggestion as solution:
Update your cocoa pods as well as all frameworks integrated using cocoa pods compatible to latest swift language version.
If you've manually integrated/added external/third party frameworks, then you need to update/replace those also.
Some manual effort is required to completely migrate code between swift languages. I tried swift migration with above options and my all projects are now compatible with swift 4.

Compilation error when declaring a pointer to an array of pointers

I noticed the following code in one Objective-C library (https://github.com/VKCOM/vk-ios-sdk):
NSArray<NSString*> *scope;
It gives me compilation errors and I didn't find anything related to this issue on the issue tracker.
/Pods/VK-ios-sdk/library/Source/Views/VKAuthorizeController.h:36:57:
Expected '>'
Why? What am I doing wrong? How can I fix it?
Make sure you are using latest version of XCode. Lightweight generics are not supported in XCode 6x - I've just checked and receive the same error in XCode 6.1. Code compiled without issues with XCode 7.2.

Why do I get a lot of errors while adding Alamofire framework?

I try to add Alamofire framework for IOS using cocoapods and adding it directly to the project. I get a lot of compiler errors in both cases though I follow all the guides.
Perhaps somebody can help me?
What version of Xcode and Alamofire are you using?
I can see an error there for Do-While which was removed in Swift 2.0
I guess you need to Upgrade to Xcode 7. Then follow again the steps from Alamofire Readme Page on Github.
I personally prefer CocoaPod to add frameworks.

XCode 6.2 UIKit.h Foundation.h not found

I have recently updated version to xCode6.2 and previous one I was using xCode6.2 beta.
It works fine with all previous versions and xCode6.2 beta as well.
When I am update it's version, I have removed xCode beta completely and install new one. But it is getting this issue, and I have added UIKit, Foundation to libraries. No luck yet.
The thing what I have tried and suspicious additionally;
Check framework search path at build settings(nothing mentioning that)
Other LD Flags in build settings.
This is suspicious, because it's have keys -frameworks Foundation, -frameworks UIKit
Have not enough understandings about other LD flags this values, so tried to remove them, but nothing new.
When I open other project with new version of xCode, they are all working fine but just that project.
Can anybody help this?
It's probably better to simply uninstall xcode completely with appCleaner or such. And reinstall it.
I suspect it will work and you will save time otherwise spent searching for a solution.
After struggling a few hrs, I found the solution.
The error was because of the some path specified in OTHER_LD_FLAGS and OTHER_C_FLAGS have not changed.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk
It was like this but it should be iPhoneOS8.2.sdk according to the changes of xCode version

AFNetworking Not Working with Xcode 5.1.1 and Cocoapods - Redefinition Issues

I have a project I which I need to use AFNetworking so after downloading the source files, importing them manually and struggling for hours with no luck I figured I'd use Cocoapods as it should surely be easier. Unfortunately not, I'm now getting lots of issues regarding redefinition of Enumerators, Duplicate interface definition and property has a previous declaration.
If anyone can help me with why I could be getting this and how I can get rid of the error it would be much appreciated. I was under the impression it is meant to be easy using Cocoapods but as of yet I haven't seen that!

Resources