XCODE Swift 5.0 Frameworks Problems -ObjC and FacebookSDK - ios

I'm developing an iOS (>=13.0) app, it's already on the App Store etc...
The problem is that today I've tried to implement the Facebook SDK to permit me to create ad on Facebook and Instagram, I've added the FacebookCore CocosPod and then, as the guide said, I've added on "Other Linker Flags" the flag "-ObjC", since I've added this flag nothing worked, nothing.
I've got several time this error:
ld: 665 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
and all my frameworks files became red.
I've tried to clean up my code, the project, the pod file, I've also removed some pods and the I've put them back because I read some treads where they said it could be a duplicate problem.
After returning to my original podfile I don't have this issue of "duplicate symbols..." but some components of the library (MDCSnackbarManager) don't work and all frameworks files still reds.
I honestly really need your help because I don't know what to do...
Thanks you, please help me.
UPDATE
I didn't solve the problem, since all the project seems to be corrupted and nothing works as should...
As I mentioned before I've tried to reload the project from a previous backup on GitHub.
Now I'm doing well, the project works and so I tried to check the differences between this project and the corrupted one, but nothing, they are identical in all shades, even the flags are all the same, I've checked all of them in both project.
I'm now pretty confused about the cause of all these problems, I'll figure out what happened and if I'll find something I will tell you.
If you have any idea I'll read it and try to figure out if it will work.
At the moment what I can tell you is to NOT set the flag "-ObjC" and install the FacebookCore pod, don't do that.

Related

Resolving Apple Mach-O Linker Error in swift and xcode 6.4 beta

My main.storyboard got accidentally deleted and when I re-added it to my project from the trash, I started receiving 27 Apple Mach-O Linker Errors. I think that it has something to do with my Parse/Stripe integration however I wasn't getting any of these problems prior to the deletion of my storyboard. If anyone could tell me how to love this or where I should look. I am not getting any compile error in any of my self-made classes. Furthermore, when building my project, before the errors are found I get 4 Apple Mach-O Linker Warnings which say that some directory isn't found. Many thanks
You might have to import your libraries inside to make sure it's all being referenced properly ie #import "header.h". Aside from that maybe make sure the O-linker has necessary -frameworks. Hope it's some help.

Getting compilation errors & warnings after install Soundcloud API through CocoaPods in Xcode

Having problems with the Soundcloud API.
I'm getting multiple Warnings & issues and I don't know what can I do to fix that.
Have I to change header search paths & other link flags? I tried the Terminal version of Installation as well and I got warnings & compilation errors
Appreciate your helping, I'm stuck trying to run propertly the Soundcloud API without warnings and I'm not able to do that.
I attach some screenshots.
Thanks
This looks a lot like a duplicate of XCode - iOS: Can't resolve conflict between CocoaLibSpotify and Parse framework.
I'm making a guess here, but are you doing -all_load?
Remove -ObjC and -all_load
Add -force_load <SoundCloudAPI library path> to load only libSoundCloudAPI.
After reading the github page, you may not need -force_load at all.
You may also need to adjust your warning level because of all the deprecated APIs.
It's working!!! Thanks for your help!! I'm very happy :D I was forcing the loading of the libraries without the prefix libPods that is added installing the project through CocoaPods. The trick to hidden the Deprecated functions was really helpful. After one day trying different settings, its running.
These are the linker flags I put in "Other Linker Flags"
-force_load $(BUILT_PRODUCTS_DIR)/libPods-OHAttributedLabel.a
-force_load $(BUILT_PRODUCTS_DIR)/libPods-CocoaSoundCloudUI.a
-force_load $(BUILT_PRODUCTS_DIR)/libPods-CocoaSoundCloudAPI.a
-force_load $(BUILT_PRODUCTS_DIR)/libPods-NXOAuth2Client.a
In "Header Search Paths" I put "./**"

iOS - GA - library not found

I am trying to add Google Analytics to my iOS app. I followed the step of Google's tutorial but now my projet doesnt compile and I have the following error message.
ld: library not found for -lGoogleAnalyticsServices
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I checked and the the library libGoogleAnalytics_debug.a is in my project folder so I dont understand where the problem comes from.
Does anyone have an idea how to fix this?
Many thanks
Go to your project > Build settings > search for the LIBRARY_SEARCH_PATHS and check their paths.
just put lGoogleAnalyticsServices.a near with myapp.xcodeproj, and drag library in your frameworks block in xcode
I also had this error and was able to fix it like this:
Go to the app project settings
Go to the General tab
Under Linked Frameworks and Libraries, drag libGoogleAnalyticsServices.a to be at the end of the list.
Order matters because if a dependency of said library isn't built first, Xcode won't be able to link it.

vimeo advanced api for iOS

I have used OA consumer class in my app and while trying to run it i got this error and i dint understand the problem. i have added -ObjC to other linker flags also. i have searched google but dint find any related to this. I have disabled the arc and do i need to add any linker flags or is there any other problem.
can you please tell me whether there is an error in code or do i have to change the linker settings
These are linker errors -- it's finding the headers just fine, but the library is missing at link time. Make sure the OA library is in the Linked Frameworks and Libraries list for your target.
I removed this error after lots of trails, the problem in my case is the corefoundation framework is corrupted, it has shown a small question mark on it, after i carefully read the exception, it says that some files are missing from the corefoundation framework, then i removed the framework and copied a new one from another project then the errors gone.
Note: while you are removing any file, don't just remove references , move it to trash, other wise the Xcode may give you a error file already exist and cannot be copied.

Linker error compiling PDFKit

I am trying to integrate PSPDFKit for iOS in my project and I have not been yet able to success. After downloading the Demo version, adding the framework to my project, adding all the required libraries and placing
#import <PSPDFKit/PSPDFKit.h>
on the 'prefix' file, I get an linker error:
ld: section __objc_const (address=0x00613EA8, size=4651232504) would make the output executable exceed available address range for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
NOTE: My project uses PSTCollectionView and I have successfully compiled PSPDFKit on a test project (created only for that effect).
I would really appreciate any help. Thanks in advance.
Apparently, you have too many included files in your PCH file.
Try removing some of them, and include those files only where you need them, not globally.
As far as I understand it, this is a bug in Apple's compiler/linker chain. Please file a radar at radar.apple.com with your failing project. A workaround is to use the source code as a subproject instead of the precompiled binary.
As soon as I can get my hands on such a project, I can experiment with the settings to see if there's any workaround. Seems to only happen under very specific combinations with other 3rd party code.

Resources