hermt2
hermt2

Reputation: 874

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.

Upvotes: 1

Views: 363

Answers (2)

Andrew C
Andrew C

Reputation: 406

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.

Upvotes: 0

Mobile Developer
Mobile Developer

Reputation: 5760

Open the Pod file pod-projectname.debug.xcconfig and remove -ObjC from the OTHER_LDFLAGS. This fixes the issue.

Upvotes: 0

Related Questions