aws-amplify / aws-sdk-ios

AWS SDK for iOS. For more information, see our web site:
https://aws-amplify.github.io/docs
Other
1.68k stars 884 forks source link

AWS 2.1.1 Undefined symbols for architecture errors #190

Closed nasirmehmood closed 9 years ago

nasirmehmood commented 9 years ago

I have integrated latest SDK 2.1.1 using CocoaPods 0.37.1 and I am getting these errors

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_AWSS3GetPreSignedURLRequest", referenced from:
      objc-class-ref in MyFile.o
  "_OBJC_CLASS_$_AWSServiceManager", referenced from:
      objc-class-ref in MyFile.o
  "_OBJC_CLASS_$_AWSS3PreSignedURLBuilder", referenced from:
      objc-class-ref in MyFile.o
  "_OBJC_CLASS_$_AWSServiceConfiguration", referenced from:
      objc-class-ref in MyFile.o
  "_OBJC_CLASS_$_AWSStaticCredentialsProvider", referenced from:
      objc-class-ref in MyFile.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please provide help about it.

yosuke-matsuda commented 9 years ago

Can you share your Podfile and your import statements?

nasirmehmood commented 9 years ago

Podfile

source 'https://github.com/CocoaPods/Specs.git'

pod 'AWSCore'
pod 'AWSAutoScaling'
pod 'AWSCloudWatch'
pod 'AWSDynamoDB'
pod 'AWSEC2'
pod 'AWSElasticLoadBalancing'
pod 'AWSKinesis'
pod 'AWSLambda'
pod 'AWSMachineLearning'
pod 'AWSS3'
pod 'AWSSES'
pod 'AWSSimpleDB'
pod 'AWSSNS'
pod 'AWSSQS'
pod 'AWSCognito'

And here's how I am using it

#import AWSS3/AWSS3.h

AWSStaticCredentialsProvider *credentialsProvider = [[AWSStaticCredentialsProvider alloc] initWithAccessKey:appDelegate.AMAZON_ACCESS_KEY_ID secretKey:appDelegate.AMAZON_SECRET_KEY];

AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionCNNorth1 credentialsProvider:credentialsProvider];
[AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;
yosuke-matsuda commented 9 years ago

We are not able to reproduce the issue.

The import statement should be

#import <AWSS3/AWSS3.h>

instead of

#import AWSS3/AWSS3.h

Please make sure you are opening the Xcode workspace file instead of the project file. Also, how is your Target set up in your Xcode project? If you are not using the first target, you have to update your Podfile based on this guides.

It may help to cleanly install the pods as well.

nasirmehmood commented 9 years ago

I was doing the same as you have mentioned above. Seems like problem was somewhere else. I had to manually link the libraries and then it worked. (screenshot attached) screen shot 2015-05-17 at 5 54 22 pm

Thanks