Why is Phonegap Facebook Plugin NOT working on 64-bit architectures? - ios

I am refering to the official FBConnect plugin from phonegap:
https://github.com/phonegap-build/FacebookConnect
Everything work fine when working with iphones not x64 (32 bits I assume)
But when launching the app on a 64 bit architecture, this plugin seems to cause trouble. Here is what I have:
ld: warning: directory not found for option '-L/Users/YohannM/Documents/phonegap-facebook-plugin-master/src/ios/frameworks'
ld: warning: ignoring file /Users/YohannM/Library/Developer/Xcode/DerivedData/MeetMyFriends-bpzkrmogtgawjxbckzcgadbbsksi/Build/Products/Debug-iphonesimulator/libCordova.a, file was built for archive which is not the architecture being linked (x86_64): /Users/YohannM/Library/Developer/Xcode/DerivedData/MeetMyFriends-bpzkrmogtgawjxbckzcgadbbsksi/Build/Products/Debug-iphonesimulator/libCordova.a
Undefined symbols for architecture x86_64:
"_CDVLocalNotification", referenced from:
-[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
"_CDVPluginHandleOpenURLNotification", referenced from:
-[AppDelegate application:handleOpenURL:] in AppDelegate.o
"_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_CLASS_$_CDVCommandQueue", referenced from:
_OBJC_CLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_CLASS_$_CDVPlugin", referenced from:
_OBJC_CLASS_$_FacebookConnectPlugin in FacebookConnectPlugin.o
_OBJC_CLASS_$_CDVDevice in CDVDevice.o
_OBJC_CLASS_$_CDVLocation in CDVLocation.o
"_OBJC_CLASS_$_CDVPluginResult", referenced from:
objc-class-ref in FacebookConnectPlugin.o
objc-class-ref in CDVDevice.o
objc-class-ref in CDVLocation.o
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_MainViewController in MainViewController.o
objc-class-ref in CDVDevice.o
"_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
_OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_METACLASS_$_CDVPlugin", referenced from:
_OBJC_METACLASS_$_FacebookConnectPlugin in FacebookConnectPlugin.o
_OBJC_METACLASS_$_CDVDevice in CDVDevice.o
_OBJC_METACLASS_$_CDVLocation in CDVLocation.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Of course, I have followed the instructions step by step and (I think) it was working fine previously (beofre I had to update XCode.
Can Anyone help me with this ? what should I do to have it working on my iphone 64 bits ?
Thanks

I've actually found the solution on another thread, there is one very complete one over there, but the one that worked the best for me wasn't in this thread. It was pretty straighforward:
They just released a new version 3.4.1 that address this issues.
Therefore I update a single file to point to the TAG 3.4.1:
/usr/local/lib/node_modules/cordova/platforms.js
line 24
from:
version: '3.4.0'
to:
version: '3.4.1'
Then you remove the iOS folder in your project and run:
cordova platform add ios
This will download the new template based on 3.4.1 with all the patches.
thank You #Fabrizio Giordano for pointing that out

Related

IOS architecture 64bits

Our phonegap app builds fine for the iphone simulator but generates linker errors when building the app on an iphone. the only thing that changed was installing testflight and a test app.
We already removed testflight and the test app, but the linker errors remain.
Any ideas on how to fix this?
We're on xcode 6.2 and ordova 3.4.0
Errors:
ld: warning: ignoring file /Users/gusph/Library/Developer/Xcode/DerivedData/momitSHDApp-evgpydfzbrlcmzazjhmquxttnqnq/Build/Products/Debug-iphoneos/libCordova.a, file was built for archive which is not the architecture being linked (arm64): /Users/gusph/Library/Developer/Xcode/DerivedData/momitSHDApp-evgpydfzbrlcmzazjhmquxttnqnq/Build/Products/Debug-iphoneos/libCordova.a
Undefined symbols for architecture arm64:
"_CDVPageDidLoadNotification", referenced from:
-[CDVSplashScreen pluginInitialize] in CDVSplashScreen.o
"_OBJC_CLASS_$_CDVWebViewDelegate", referenced from:
objc-class-ref in CDVInAppBrowser.o
"_OBJC_CLASS_$_CDVInvokedUrlCommand", referenced from:
objc-class-ref in CDVFile.o
"_CDVLocalNotification", referenced from:
-[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_MainViewController in MainViewController.o
objc-class-ref in CDVDevice.o
objc-class-ref in CDVFile.o
"_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_CLASS_$_CDVUserAgentUtil", referenced from:
objc-class-ref in CDVInAppBrowser.o
"_OBJC_CLASS_$_CDVCommandQueue", referenced from:
_OBJC_CLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_CLASS_$_CDVPlugin", referenced from:
_OBJC_CLASS_$_NotificationsNode in NotificationsNode.o
_OBJC_CLASS_$_CDVConnection in CDVConnection.o
_OBJC_CLASS_$_CDVCamera in CDVCamera.o
_OBJC_CLASS_$_CDVBattery in CDVBattery.o
_OBJC_CLASS_$_CDVLogger in CDVLogger.o
_OBJC_CLASS_$_CDVContacts in CDVContacts.o
_OBJC_CLASS_$_CDVDevice in CDVDevice.o
...
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
"_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
_OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
"_CDVPluginHandleOpenURLNotification", referenced from:
-[AppDelegate application:handleOpenURL:] in AppDelegate.o
-[CDVInAppBrowser openInSystem:] in CDVInAppBrowser.o
"_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_CLASS_$_CDVPluginResult", referenced from:
objc-class-ref in NotificationsNode.o
objc-class-ref in CDVConnection.o
objc-class-ref in CDVCamera.o
objc-class-ref in CDVBattery.o
objc-class-ref in CDVContacts.o
objc-class-ref in CDVDevice.o
objc-class-ref in CDVAccelerometer.o
...
"_OBJC_METACLASS_$_CDVPlugin", referenced from:
_OBJC_METACLASS_$_NotificationsNode in NotificationsNode.o
_OBJC_METACLASS_$_CDVConnection in CDVConnection.o
_OBJC_METACLASS_$_CDVCamera in CDVCamera.o
_OBJC_METACLASS_$_CDVBattery in CDVBattery.o
_OBJC_METACLASS_$_CDVLogger in CDVLogger.o
_OBJC_METACLASS_$_CDVContacts in CDVContacts.o
_OBJC_METACLASS_$_CDVDevice in CDVDevice.o
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This linker error message is the key:
.../libCordova.a, file was built for archive which is not the architecture being linked (arm64)
Static and dynamic libraries under OSX and iOS are fat in that they can hold code for multiple CPU architectures. That library doesn't have the arm64 architecture and therefore cannot be used.
The solution is to get a version that does support arm64. If you are building that library then you are not including the CPU architecture when building it.
From this link:
This means that starting at that time, Cordova-based apps
should be built using a version of Cordova that has 64-bit iOS support.
The first version of Cordova to include 64-bit for iOS is 3.4.1.
Therefore, to meet these requirements of the Apple App Store, you should be
using at least version 3.4.1 of Cordova before this February deadline.
Make sure you are using a version of Cordova that has the 64bit architecture built in. You appear to be currently using one without (an old version).
remove arm64 from Valid Architectures of CordovaLib Targets,
Also set 'NO' to Build Active Architecture Only,
Make same settings to Main app.

Problems building Twitter's Fabric API in Xcode

I'm trying to install Fabric and have followed the instructions (add Run Script Build Phase, Build, Drag files into project (copy off)) and all looks good.
However as soon as I try to run the app, I get a flood of errors:
ld: warning: directory not found for option '-F/Users/michael/Developer/Digicub/Mini2/MGBF2/APIs/ParseChat/Framework'
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_NSManagedObjectContext", referenced from:
objc-class-ref in TwitterKit(TFSScribe.o)
"_OBJC_CLASS_$_NSPersistentStoreCoordinator", referenced from:
objc-class-ref in TwitterKit(TFSScribe.o)
"_OBJC_CLASS_$_NSManagedObject", referenced from:
_OBJC_CLASS_$_TFSScribeEvent in TwitterKit(TFSScribeEvent.o)
_OBJC_CLASS_$_TFSScribeImpression in TwitterKit(TFSScribeImpression.o)
"_OBJC_CLASS_$_NSManagedObjectModel", referenced from:
objc-class-ref in TwitterKit(TFSScribe.o)
"_OBJC_CLASS_$_NSFetchRequest", referenced from:
objc-class-ref in TwitterKit(TFSScribe.o)
"_NSSQLitePragmasOption", referenced from:
-[TFSScribe _setupManagedObjectContext] in TwitterKit(TFSScribe.o)
"_NSInMemoryStoreType", referenced from:
-[TFSScribe _setupManagedObjectContext] in TwitterKit(TFSScribe.o)
"_OBJC_CLASS_$_NSEntityDescription", referenced from:
objc-class-ref in TwitterKit(TFSScribe.o)
"_OBJC_METACLASS_$_NSManagedObject", referenced from:
_OBJC_METACLASS_$_TFSScribeEvent in TwitterKit(TFSScribeEvent.o)
_OBJC_METACLASS_$_TFSScribeImpression in TwitterKit(TFSScribeImpression.o)
"_NSSQLiteStoreType", referenced from:
-[TFSScribe _setupManagedObjectContext] in TwitterKit(TFSScribe.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've retried a few times, uninstalling, reinstalling. Thought it might be clashing with Twitter.framework, but removing this doesn't have any effect. Any ideas how to resolve?
According to the comments by #rmaddy
Add CoreData framework worked.
Your bundle should look like this:

Cordova app fails again on linking after updating to cordova 3.4.1 iOS

When trying to build my app for archiving and updating to cordova 3.4.1 I get this linking error message. I solved something similar before but I am afraid to touch the build settings because x86_64 does not seem to be a supported architecture.
What can I do?
ld: warning: ignoring file /Users/bogdan/Library/Developer/Xcode/DerivedData/Eazybreak-ctqyotqyclrvjoghewxpdeoemnkd/Build/Products/Debug-iphonesimulator/libCordova.a, file was built for archive which is not the architecture being linked (x86_64): /Users/bogdan/Library/Developer/Xcode/DerivedData/Eazybreak-ctqyotqyclrvjoghewxpdeoemnkd/Build/Products/Debug-iphonesimulator/libCordova.a
Undefined symbols for architecture x86_64:
"_CDVLocalNotification", referenced from:
-[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
"_CDVPageDidLoadNotification", referenced from:
This is the error message I get (it's much longer of course).
Any help is appreciated.
Bogdan
Added full error log:
ld: warning: ignoring file /Users/bogdan/Library/Developer/Xcode/DerivedData/Eazybreak-ctqyotqyclrvjoghewxpdeoemnkd/Build/Products/Debug-iphonesimulator/libCordova.a, file was built for archive which is not the architecture being linked (x86_64): /Users/bogdan/Library/Developer/Xcode/DerivedData/Eazybreak-ctqyotqyclrvjoghewxpdeoemnkd/Build/Products/Debug-iphonesimulator/libCordova.a
Undefined symbols for architecture x86_64:
"_CDVLocalNotification", referenced from:
-[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
"_CDVPageDidLoadNotification", referenced from:
-[CDVSplashScreen pluginInitialize] in CDVSplashScreen.o
"_CDVPluginHandleOpenURLNotification", referenced from:
-[AppDelegate application:handleOpenURL:] in AppDelegate.o
"_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_CLASS_$_CDVCommandQueue", referenced from:
_OBJC_CLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_CLASS_$_CDVPlugin", referenced from:
_OBJC_CLASS_$_CDVDevice in CDVDevice.o
_OBJC_CLASS_$_CDVConnection in CDVConnection.o
_OBJC_CLASS_$_CDVNotification in CDVNotification.o
_OBJC_CLASS_$_CDVSplashScreen in CDVSplashScreen.o
"_OBJC_CLASS_$_CDVPluginResult", referenced from:
objc-class-ref in CDVDevice.o
objc-class-ref in CDVConnection.o
objc-class-ref in CDVNotification.o
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_MainViewController in MainViewController.o
objc-class-ref in CDVDevice.o
"_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
_OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_METACLASS_$_CDVPlugin", referenced from:
_OBJC_METACLASS_$_CDVDevice in CDVDevice.o
_OBJC_METACLASS_$_CDVConnection in CDVConnection.o
_OBJC_METACLASS_$_CDVNotification in CDVNotification.o
_OBJC_METACLASS_$_CDVSplashScreen in CDVSplashScreen.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Try removing x86_64 from Build Settings > Valid Architectures. I had a similar problem with arm64 architecture.

Xcode Not Deploying Phonegap App To 64bit Simulator Or Iphone 5s

I have a phonegap project that deploys just fine on Iphone 5 running IOS 7 and older Phones to like Iphone 4. It also deploys to the 4 inch simulator just fine. However if i try to deploy on any 64 bit simulator or Iphone 5S which is a 64bit phone, the build fails and I dont know why.
The error it gives is as below. "_CDVLocalNotification", referenced from:
-[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
"_CDVPluginHandleOpenURLNotification", referenced from:
-[AppDelegate application:handleOpenURL:] in AppDelegate.o
"_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_CLASS_$_CDVCommandQueue", referenced from:
_OBJC_CLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_CLASS_$_CDVPlugin", referenced from:
_OBJC_CLASS_$_CDVLogger in CDVLogger.o
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_MainViewController in MainViewController.o
"_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
_OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_METACLASS_$_CDVPlugin", referenced from:
_OBJC_METACLASS_$_CDVLogger in CDVLogger.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Go to Build Settings --> Architectures --> Valid Architectures
Remove arm64 from valid architectures section and try building.

Xcode 5 and phonegap: linker errors on building for device but not for simulator

Our phonegap app builds fine for the iphone simulator but generates linker errors when building the app on an iphone. the only thing that changed was installing testflight and a test app.
We already removed testflight and the test app, but the linker errors remain.
Any ideas on how to fix this?
We're on xcode 5 and phonegap 3.4.
Errors:
ld: warning: ignoring file /Users/c/Library/Developer/Xcode/DerivedData/s-fhgxmhdprdjvwahdbgwuagoragit/Build/Products/Debug-iphoneos/libCordova.a, file was built for archive which is not the architecture being linked (arm64): /Users/c/Library/Developer/Xcode/DerivedData/s-fhgxmhdprdjvwahdbgwuagoragit/Build/Products/Debug-iphoneos/libCordova.a
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_CDVWebViewDelegate", referenced from:
objc-class-ref in CDVInAppBrowser.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
"_OBJC_CLASS_$_CDVPlugin", referenced from:
_OBJC_CLASS_$_CDVDevice in CDVDevice.o
_OBJC_CLASS_$_CDVConnection in CDVConnection.o
_OBJC_CLASS_$_LowLatencyAudio in LowLatencyAudio.o
_OBJC_CLASS_$_CDVLogger in CDVLogger.o
_OBJC_CLASS_$_CDVInAppBrowser in CDVInAppBrowser.o
_OBJC_CLASS_$_InAppPurchase in InAppPurchase.o
"_OBJC_METACLASS_$_CDVPlugin", referenced from:
_OBJC_METACLASS_$_CDVDevice in CDVDevice.o
_OBJC_METACLASS_$_CDVConnection in CDVConnection.o
_OBJC_METACLASS_$_LowLatencyAudio in LowLatencyAudio.o
_OBJC_METACLASS_$_CDVLogger in CDVLogger.o
_OBJC_METACLASS_$_CDVInAppBrowser in CDVInAppBrowser.o
_OBJC_METACLASS_$_InAppPurchase in InAppPurchase.o
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_MainViewController in MainViewController.o
objc-class-ref in CDVDevice.o
"_CDVLocalNotification", referenced from:
-[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
"_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_CLASS_$_CDVPluginResult", referenced from:
objc-class-ref in CDVDevice.o
objc-class-ref in CDVConnection.o
objc-class-ref in LowLatencyAudio.o
objc-class-ref in CDVInAppBrowser.o
objc-class-ref in InAppPurchase.o
"_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_CLASS_$_CDVUserAgentUtil", referenced from:
objc-class-ref in CDVInAppBrowser.o
"_OBJC_CLASS_$_CDVCommandQueue", referenced from:
_OBJC_CLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
_OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
"_CDVPluginHandleOpenURLNotification", referenced from:
-[AppDelegate application:handleOpenURL:] in AppDelegate.o
-[CDVInAppBrowser openInSystem:] in CDVInAppBrowser.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This kind of problems occur while updating your Xcode but any third party tool you are using may not be updated with this architecture armv64.
So Click on your Project Navigator from XCode.
Click On Targets from your Project and click on BuildSettings from it.
Find Valid Architectures in it.
Just double click on that and remove armv64 from that.
Make sure there is armv7 and armv7s only.
In my case this worked for me.
Clean and build your project. It should work fine now.
Hope it helps you.
EDIT
Now, as of Feb 1st 2015, apple will not allow apps without arm64 architecture supported.
So make sure that all the apps submitted have arm64 support.
seems like we also unintentionally upgraded to xcode 5.1, causing the problem. phonegap 3.4 and xcode 5.1 are incompatible unless you make some changes.
here is the solution: http://shazronatadobe.wordpress.com/2014/03/12/xcode-5-1-and-cordova-ios/
Sorry if this might seem like a trite answer, but the following steps are usually what I always do when I see linker errors :
Ensure your code is up to date, with all the latest fixes and versions.
Make sure you update your submodules. In git : git submodule update --init --recursive
Please do a Clean Build Folder : Go to Product, Hover on Clean and press together (Command + Option) and click on "Clean Build Folder".
Rinse and Repeat.
In case you have any modules that are not being references correctly, head over to your Build Phases, REMOVE the modules that are troubling you and re-add them.

Resources