Testing out PDFTron / PDFNet - Symbol not found when adding libTools.a - ios

I am having a problem with libTools.a when following the PDFTron BLOG article, step 2: getting-started-on-ios
Step 1, works. I have a working PDF viewer, but no controls other then paging and zooming.
When I add the libTools.a library (the one that came in the SDK, or the one I built using Tools.xcodeproj, I receive the following error for every platform I try (simulator, ipad2, iphone6 - architecture name changes for each):
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_DraggableCollectionViewFlowLayout", referenced from:
objc-class-ref in libTools.a(ThumbnailsViewController.o)
ld: symbol(s) not found for architecture x86_64
The sample code is working fine. So it's my implementation in our application.
The rest of the project's 3rd party frameworks are managed with CocoaPods.
There has got to be something simple I am overlooking... Ideas?

Judging by the error message, it sounds like you may need to add /Lib/src/PDFViewCtrlTools/ThirdParty/DraggableCollectionView into your project. This is required for the ThumbnailsViewController.

It seems it doesn't find class for the Simulator on 64bit platform.
You can try to modify setting in <your target>/Build settings/Architectures/only active arch and set it to NO (it is YES by default in Debug) to be sure all platforms are build, even in Debug mode.

Related

Stripe integration error Xcode 6.2

To be specific i get this error when i build my project after adding the stripe framework.The project is for the iOS platform.
I have all the standard architectures added to my build settings namely
armv7,armv7s. This is the error logged,
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_STPAPIClient", referenced from:
objc-class-ref in PlaceOrderViewController.o
After this error came i added arm64 also. I got error from this class alone as i'm calling a method from STPAPIClient.h in the Stripe framework.I have tried everywhere on the internet including stack and found nothing that could solve the issue.Hope someone can provide insights as to why this is occurring.
Okay so the solution for me was to copy the entire stripe project, stripe.xcodeproj into my project. This would only bring that file so to bring all the classes in stripe project I copied the stripe workspace,stripe.xcworkspace into my project folder.
This solved all architecture related issues.

Cocoa Touch Framework architecture issue / production build

I built an iOS Framework.
After I added the framework to my project and run on my device, it worked fine. But when I try to run it on the Simulator, I got some error.
ld: warning: ignoring file MyFramework.framework/Framework, missing required architecture x86_64 in file MyFramework.framework/MyFramework (2 slices)
Also got this one:
Undefined symbols for architecture x86_64:
With a list of strings/methods and such that were referenced from.
How could I fix that?
Also, I want my Framework to run on all devices/simulators since iOS7+ (Production), I've read this post here that tells me to use lipo, but I understand that I have to create an Aggregate target. I just don't have this in my Other section of XCode 6.2.
How can I do this?
So, after 2 days of search, a lot of reading on the web and mostly at StackOverflow.com I found this question:
Xcode - symbol(s) not found for architecture x86_64 (iOS Lib)
Select your Target and in Build Setting it should look like that:
Now, select the Aggregate Target, click on the Build Settings and should look like that:
If you want to better understand how to create a framework, read this question and the answer of this question, there is a lot of information there, this is what helped me:
Running 1 of 1 custom shell scripts freeze
Enjoy and good luck!

Trouble adding -ObjC flag to iOS project

I have an iOS project which includes the Parse library. It has been working fine.
Today, I needed to add the Google Conversion Tracking SDK to my project. The instructions for adding this SDK require that I change my project settings to include the -ObjC linker flag.
When I did this, I could no longer compile my project. The errors I receive are of the form "Undefined symbols for architecture x86_64", and in every case the source of the error is something in the Parse SDK. Here is one example of the 6 errors I'm getting:
Undefined symbols for architecture x86_64:
"_ACAccountTypeIdentifierTwitter", referenced from:
-[PF_Twitter getLocalTwitterAccountAsync] in Parse(PF_Twitter.o)
I've never had to use the -ObjC flag explicitly before. My understanding is that this flag tells the compiler to link every class that was compiled even if it isn't explicitly referenced in the source code. Other than producing a larger executable, I can't see how this would cause a problem.
Appreciate any solutions or ideas.
Thanks.
I recently had a similar issue (not with parse though).
Open PF_Twitter and see what frameworks are included in it's header and implementation files. Then go to your target's Build Phases and add those frameworks in "Link Binary With Libraries".
If this doesn't help, other alternatives are discussed under this stack overflow question--
Undefined symbols for architecture arm64 Parse
Thanks. Adding the Social framework fixed the problem for me.

Undefined symbols for architecture i386 (RevMob)

I tried deleting everything RevMob ads related in my app, i didn't know how to do it properly so i firstly deleted the framework than erased all the line of code related to RevMob but now i have this error that i can fix:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_RevMobAds", referenced from:
objc-class-ref in AppDelegate.o
I found people having the same problem (not with RevMob but similar framework) but they we're searching to add it to the project, i'm trying to REMOVE it.
If you could tell me what to remove in order that error, that would be awesome. Thanks!
In a file (probably called) AppDelegate.m, you are possibly including RevMob headers are using its objects. If not in that file, then in a file it includes.
This error means that you had the headers at compile time to use RevMob, but you don't have the framework or library at link time (or the framework or library doesn't have the implementation of the object you are trying to use in the simulator build)

Google Analytics Library IOS

When i add google analytics library, i have this warning
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_NSAttributeDescription", referenced from:
objc-class-ref in libGoogleAnalytics.a(GAICoreDataUtil.o)
objc-class-ref in libGoogleAnalytics_debug.a(GAICoreDataUtil.o)
"_OBJC_CLASS_$_NSFetchRequest", referenced from:
objc-class-ref in libGoogleAnalytics.a(GAIDataStore.o)
objc-class-ref in libGoogleAnalytics_debug.a(GAIDataStore.o)
"_NSSQLiteErrorDomain", referenced from:
l003 in libGoogleAnalytics.a(GAIDataStore.o)
Please help me
Add libGoogleAnalytics.a to your target setting [Build phases]-[Link Binary with Libraries]. Also check if libsqlite3.0dylib (where GA stores tracking data) and CFNetwork.framework are added there as they are required for Google Analytics/iOS (version 2.0 beta 3).
P.S. For Google Analytics/iOS version 3.0 CoreData framework is required instead.
I had have the same issue on NSAttributeDescription. In documentation this function is from CoreData.framework, so I have added this framework and no more errors on that issue.
Problem related to Google Analytics SDK for iOS v2 migration.
I am not sure which topic to write it to as there is no exact problem--I've bumped into and solved by my own--found (this one seems to be the closest (not sure if I should open a new one)), but might be helpfull for someone.
Problem:
I have my previous (1.5.1) SDK installed in "SDKs/GoogleAnalytics SDK" separate folder. On v2 migration I've placed the new files into "SDKs/GoogleAnalytics SDK v2". After following all the instructions about migration (from Google site) (and, in details, that was just removing the previous references to the files from the first folder and adding the new ones from the new one), I started to get the following error message on compilation:
Undefined symbols for architecture armv7: "_OBJC_CLASS_$_GAI",
referenced from:
objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code
1 (use -v to see invocation)
I went trough first pages of googling (and stackoverflowing) and the most popular solution suggested was "to set 'Build active architecture only' property to 'YES'" (my active architectures are "armv7 armv7s"). But that DID NOT HELP at all.
Solution:
However, a miracle happened. I've noticed that there is an old directory "SDKs/GoogleAnalytics SDK" was listed in linker pathes. So, after that directory removing (as I don't know where the list of the directories exists in settings) everything started to compile and work like a charm (also setting 'Build active architecture only' to 'YES' was not necessary for me).
Add -lGoogleAnalyticsServices in Build settings -> Other Linker Flags
I had similar errors as above, actually more (SDK 2.0 beta 4). After adding the Analytics library/headers, linking with these two frameworks solved the issues:
CoreData.framework and SystemConfiguration.framework
I followed this tutorial. It says to add
#import "GAI.h"
#import "GAIFields.h"
into the NameofTheProject-Prefix.pch file.
And additionally to CoreData.framework and SystemConfiguration.framework add libz.dylib
It solved all issues.
I was having this issue because i didn't add the libGoogleAnalytics_debug.a file. The problem just got resolved as i added this file and built the project again.
I had an ODD odd issue. For some reason libGoogleAnalytics.a was in Copy Bundle Resources when it was supposed to be in Link Binary With Libraries
Hopefully that helps someone.
Had similar issue after migrating to SDK 2.0 beta 4. Resolved by removing old GA library path from My Build Settings > Library Search Paths as pointed by Adri.
If using Cocoapods make sure Other linker flags has only $(inherited) flag and remove any child architecture flags.
For framework search paths and Library search paths also set only $(inherited) flag.
Inside the header bridging file put the #import <Google/Analytics.h>
I followed all suggestions and I was still getting an error on XCODE 5.1.1.
For me the error was in target > Build Setting > Architecture > Architectures.
I replaced the value with ARCHS_STANDARD_32_BIT and the error was gone.
Maybe the libGoogleAnalytics lib was not compiled for 64 BIT architecture.
Hope this will help someone. Or get latest lib which is compiled for 64 Bit.

Resources