CocoaPods AmazonMobileHub Undefined symbols for architecture x86_64 - ios

I have a cocoa pods Swift project and Im trying to install the Amazon AWS Mobile Hub frameworks, copied the Sdks and the MobileHubHelper framework but is not building.
The error goes like this:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_AWSLambdaInvoker", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSCloudLogic.o)
"_OBJC_CLASS_$_AWSS3", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSContentManager.o)
(maybe you meant: _OBJC_CLASS_$_AWSS3ContentProvider)
"_OBJC_CLASS_$_AWSS3GetPreSignedURLRequest", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSContentManager.o)
"_OBJC_CLASS_$_AWSS3ListObjectsOutput", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSContentManager.o)
"_OBJC_CLASS_$_AWSS3ListObjectsRequest", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSContentManager.o)
From what I found it looks like it is not encourage to use the public SDKs with the mobile hub framework but to copy the ones given with the sample app but either way it does not work.
Any ideas will be appreciated.
Thanks!

Turns out that if you go to the Pods folder in your project and update the Pods-.debug.xcconfig and Pods-.release.xcconfig OTHER_LDFLAGS by removing the -ObjC param after ($inherited) the project builds and run.

Have you added $(inherited) to Other Linker Flags? Check by clicking on your project -> build settings -> type in the search bar: Other linker flags and expand Debug and on the right side where you'll see some paths, click on that and set it to $(inherited). Should work.

Related

Installing the segment-iOS analytics-iOS in xcode manually

I am trying to add analytics-iOS manually by directly adding the Analytics folder to the project making it as a group, after adding when I try to build the project I get error as "Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_SKProductsRequest", referenced from:
objc-class-ref in SEGStoreKitTracker.o
"_OBJC_CLASS_$_SKPaymentQueue", referenced from:
objc-class-ref in SEGStoreKitTracker.o "
and other 6 errors
I was able to solve this. There was a dependency on StoreKit framework which i had to add in Link Binaries with Libraries in Build Phase.

App failing to start after adding podfile 'FMDB', related to Amazon web services

So I've been building a project using Amazon Web Services, and I decided I wanted to add local storage, so I added the podfile 'FMDB' (Using the instructional video found here: https://www.youtube.com/watch?v=D5tE61gzIVs). After adding the podfile, I get the following errors:
Undefined symbols for architecture x86_64:
"_AWSSNSErrorDomain", referenced from:
___88-[AWSPushManager interceptApplication:didRegisterForRemoteNotificationsWithDeviceToken:]_block_invoke.239 in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_AWSLambdaInvoker", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSCloudLogic.o)
"_OBJC_CLASS_$_AWSS3", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSContentManager.o)
(maybe you meant: _OBJC_CLASS_$_AWSS3ContentProvider)
"_OBJC_CLASS_$_AWSS3GetPreSignedURLRequest", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSContentManager.o)
"_OBJC_CLASS_$_AWSS3ListObjectsOutput", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSContentManager.o)
"_OBJC_CLASS_$_AWSS3ListObjectsRequest", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSContentManager.o)
"_OBJC_CLASS_$_AWSS3PreSignedURLBuilder", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSContentManager.o)
"_OBJC_CLASS_$_AWSSNS", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_AWSSNSCreatePlatformEndpointInput", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_AWSSNSGetEndpointAttributesInput", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_AWSSNSSetEndpointAttributesInput", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_AWSSNSSubscribeInput", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_AWSSNSUnsubscribeInput", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_GIDSignIn", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSGoogleSignInProvider.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
A lot of these I am not even using in my app either (such as AWSGoogleSignInProvider). I also tried to alter the content under "Other Linker Flags" by getting rid of -ObjC and adding "-force_load (Framework pathway)" for each AWS framework that I am using. When I do this however, I just get the error of linker command failed with exit code 1. I also tried to add all the podfiles found in the amazon sdk (found here: https://github.com/aws/aws-sdk-ios), but the following error still remained: "_OBJC_CLASS_$_GIDSignIn", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSGoogleSignInProvider.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation).
Does anybody know what I can do for this? Because I really need to utilize local storage along with my AWS database, but I'm not sure how I can fix these errors. Thank you.
Open the Pod file pod-projectname.debug.xcconfig and remove -ObjC from the OTHER_LDFLAGS. This fixes the issue.
This looks like a duplicate of the issue here...
https://forums.aws.amazon.com/message.jspa?messageID=754901
Please try the following...
If you are using Cocoa Pods, please make sure you have the "use_frameworks!" line in your Podfile, like this...
platform :ios, '8.1'
use_frameworks!
target 'MySampleApp' do
pod 'whateverpodyouwantgoeshere'
end
If you are not using Cocoa Pods, then please make sure your linker settings are set exactly as those are set in the AWS Mobile Hub sample app project download.

Issues updating Phonegap iOS app for 64-bit architecture

I have a phonegap app with many plugins that runs fine on iOS devices. However, I am currently using $(ARCHS_STANDARD_32_BIT) for architectures in xcode, and now believe I need to update it to be $(ARCHS_STANDARD) in the architecture setting and to include arm64 as a valid architecture per Apple's Feb 1, 2015 requirements.
When I try to run the project on an iPhone 6, I get 16 errors now, copied below. 2 questions:
1) Do I need to use the archs_standard and arm64 changes mentioned in the 1st paragraph?
2) How do I fix these issues so I can submit my app? Is it all issues with individual plugins I'm using? Do I need to find an updated version (or update myself) every plugin listed in the errors or is the issue related to something else? I don't see updates for 64-bit on a few of the plugins I've looked at, so not sure if this is what the issue is. I'm not very familiar with Obj C so appreciate any help here!
Thanks in advance for any help!
Error messages:
Undefined symbols for architecture arm64:
"_CDVPageDidLoadNotification", referenced from:
-[CDVSplashScreen pluginInitialize] in CDVSplashScreen.o
"_OBJC_CLASS_$_CDVInvokedUrlCommand", referenced from:
objc-class-ref in CDVFile.o
"_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
_OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_CLASS_$_CDVPlugin", referenced from:
_OBJC_CLASS_$_CDVLocation in CDVLocation.o
_OBJC_CLASS_$_FacebookConnectPlugin in FacebookConnectPlugin.o
_OBJC_CLASS_$_IonicKeyboard in IonicKeyboard.o
_OBJC_CLASS_$_CDVInAppBrowser in CDVInAppBrowser.o
_OBJC_CLASS_$_APPEmailComposer in APPEmailComposer.o
_OBJC_CLASS_$_CDVStatusBar in CDVStatusBar.o
_OBJC_CLASS_$_CDVVibration in CDVVibration.o
...
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
"_CDVLocalNotification", referenced from:
-[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
"_OBJC_CLASS_$_CDVViewController", referenced from:
l_OBJC_$_CATEGORY_CDVViewController_$_StatusBar in CDVStatusBar.o
_OBJC_CLASS_$_MainViewController in MainViewController.o
objc-class-ref in CDVFile.o
"_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_CLASS_$_CDVWebViewDelegate", referenced from:
objc-class-ref in CDVInAppBrowser.o
"_OBJC_CLASS_$_CDVCommandQueue", referenced from:
_OBJC_CLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_CLASS_$_CDVUserAgentUtil", referenced from:
objc-class-ref in CDVInAppBrowser.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 CDVLocation.o
objc-class-ref in FacebookConnectPlugin.o
objc-class-ref in CDVInAppBrowser.o
objc-class-ref in APPEmailComposer.o
objc-class-ref in CDVStatusBar.o
objc-class-ref in CDVLocalFilesystem.o
objc-class-ref in PushPlugin.o
...
"_OBJC_METACLASS_$_CDVPlugin", referenced from:
_OBJC_METACLASS_$_CDVLocation in CDVLocation.o
_OBJC_METACLASS_$_FacebookConnectPlugin in FacebookConnectPlugin.o
_OBJC_METACLASS_$_IonicKeyboard in IonicKeyboard.o
_OBJC_METACLASS_$_CDVInAppBrowser in CDVInAppBrowser.o
_OBJC_METACLASS_$_APPEmailComposer in APPEmailComposer.o
_OBJC_METACLASS_$_CDVStatusBar in CDVStatusBar.o
_OBJC_METACLASS_$_CDVVibration in CDVVibration.o
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
1) Do I need to use the archs_standard and arm64 changes mentioned in
the 1st paragraph?
Yes, you have to use $(ARCHS_STANDARD) and arm64 if you want to submit the app to the stores.
2) How do I fix these issues so I can submit my app? Is it all issues
with individual plugins I'm using? Do I need to find an updated
version (or update myself) every plugin listed in the errors or is the
issue related to something else? I don't see updates for 64-bit on a
few of the plugins I've looked at, so not sure if this is what the
issue is. I'm not very familiar with Obj C so appreciate any help
here!
The plugins are fine, the problem is the cordovaLib project. You have to change the cordovaLib project to $(ARCHS_STANDARD) too and rebuild the libCordova.a, or even better, use a cordova version greater than 3.4 that will include the 64 bits support.
EDIT:
More details from the link manihiki provided:
You will need to update the Build Settings in your project. The steps are mentioned in the issue and reproduced below:
//Update build settings for your project
Select your Project icon Choose Build Settings.
For “Architectures”, select $ARCHS_STANDARD – Standard architectures (armv7, armv7s, arm64)
For “Valid Architectures”, add “arm64″
//Update build settings for cordovaLib project
Select your CordovaLib.xcodeproj icon
In the Build Settings for the Project (not Target), delete *all* the conditional architecture settings (hover to see the minus sign). This is what is recommended by Apple in their Xcode 5.1 Release Notes.
For “Architectures”, select $ARCHS_STANDARD – Standard architectures(armv7, armv7s, arm64)
For “Valid Architectures”, add “arm64″
//Update build settings for the Target
In the Build Settings for the Target, delete *all* the conditional architecture settings (hover to see the minus sign).
For “Architectures”, select $ARCHS_STANDARD – Standard architectures (armv7, armv7s, arm64)
For “Valid Architectures”, add “arm64″
Some plugins might not work, you have to made this changes
On CordovaLib/Classes/CDVCommandQueue.m
change this
objc_msgSend(obj, normalSelector, command);
to this
((void (*)(id, SEL, id))objc_msgSend)(obj, normalSelector, command);
and on CordovaLib/Classes/CDVViewController.m
change this
if ((BOOL)objc_msgSend(plugin, selector, request, navigationType) == YES)
to this:
if (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, request, navigationType) == YES)
All the details can be found here https://shazronatadobe.wordpress.com/2014/03/12/xcode-5-1-and-cordova-ios/
I inherited a legacy PhoneGap/Cordova app and received many similar errors when changing the Architecture Build Setting to $(ARCHS_STANDARD).
I was able to successfully build after updating (removing and then adding) two PhoneGap plugins (out of nine total), and removing/adding the PhoneGap iOS platform each time. Specifically, the plugins were com.phonegap.plugins.barcodescanner and org.apache.cordova.geolocation. I targeted those two plugins by googling the classnames in the errors and determining which plugins they related to.
To "update" a plugin:
cordova plugin rm com.phonegap.plugins.barcodescanner
cordova plugin add com.phonegap.plugins.barcodescanner
To remove/add the PhoneGap/Cordova ios platform:
cordova platform remove ios
cordova platform add ios

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.

Xcode can't find XMPPFramework--how do you fix linker errors?

this must be a prevalent problem, but I'd appreciate any help. I have an Xcode 4.2 project that just won't build without errors. The issue is XMPPFramework for iOS. I have followed the directions on the wiki already.
I don't really understand at a deep level what is going on, but Xcode can't find my XMPPFramework (for iOS). Here is the error, and I don't know how to fix it. I have added the path to XMPPFramework in the project and target settings. My XMPPFramework files are located is at the root of my Xcode project already, yet Xcode can't seem to find the files. What is a user header path, framework path, and library search path? I have added the path to XMPPFramework to all of these fields without any benefit. I've used $(inherited) and $(SRCROOT) and checked the recursive button. All my points to whoever can help me fix this.
Undefined symbols for architecture i386:
"_ExtractFileNameWithoutExtension", referenced from:
-[AppDelegate_iPhone contextDidSave:] in AppDelegate_iPhone.o
-[AppDelegate_iPhone xmppStreamDidSecure:] in AppDelegate_iPhone.o
-[AppDelegate_iPhone xmppStreamDidConnect:] in AppDelegate_iPhone.o
-[AppDelegate_iPhone xmppStreamDidAuthenticate:] in AppDelegate_iPhone.o
-[AppDelegate_iPhone xmppStream:didNotAuthenticate:] in AppDelegate_iPhone.o
-[AppDelegate_iPhone xmppStream:didReceiveIQ:] in AppDelegate_iPhone.o
-[AppDelegate_iPhone xmppStream:didReceiveMessage:] in AppDelegate_iPhone.o
... "_OBJC_CLASS_$_DDLog", referenced from:
objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_DDTTYLogger", referenced from:
objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPStream", referenced from:
objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPReconnect", referenced from:
objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPRosterCoreDataStorage", referenced from:
objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPRoster", referenced from:
objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPvCardCoreDataStorage", referenced from:
objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPvCardTempModule", referenced from:
objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPvCardAvatarModule", referenced from:
objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPCapabilitiesCoreDataStorage", referenced from:
objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPCapabilities", referenced from:
objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPPresence", referenced from:
objc-class-ref in AppDelegate_iPhone.o "_OBJC_CLASS_$_XMPPJID", referenced from:
objc-class-ref in AppDelegate_iPhone.o
objc-class-ref in AccountViewController.o
objc-class-ref in AddBuddyViewController.o
objc-class-ref in ChatViewController.o
objc-class-ref in GroupChatViewController.o ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Nevermind, figured it out. You can't just drag and drop the files into the project. You must copy them into the project folder, then add them.
As an add-on, I would like to say, if you're using Xcode 4.6.1 or later, then the routine of copying files into project folder and dragging-dropping them to Xcode also won't resolve this Linker error.
The workaround here would be to create "Groups" yourself in the Xcode project(Right Click->New Group) and then add the respective files/folders into those groups by dragging-dropping them. Make sure, not to check "Copy files into source folder" option. However, make sure to check the "Add to target" option. To know what Groups to create, you can have a look at their sample XMPP project. Create them in same hierarchy, as shown in that project.
Also make sure you have included CoreData.framework and SystemConfiguration.framework into the Frameworks.
If somehow, you still fail to get it working, I would suggest you to have a look at sample XMPP project included in the XMPPFramework master copy you downloaded from their Git link. Check how they have arranged the files in groups and the folder structure of their project. Just follow the suite and you should be good.

Resources