0

I searched over the internet for an image cropping code for my app and i found GKImagePicker

I downloaded it and it works fine from the example project, but when i add the files to my project i get two errors

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_GKImagePicker", referenced from: objc-class-ref in ViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

When i add GKImagepicker.m to the Compile Sources i get like 12 errors in it, Tried to remove the arm64 from Architectures, played a round in the Build settings , googled around for solutions but with no luck.

I`m using Xcode 6.3.2, Any idea how to solve this ? :)

Thanks in advance

aLFaRSi
  • 559
  • 2
  • 12
  • 29

2 Answers2

1

After long researches i found that i have to install GKImagePicker using cocoapods, and since i'm new to it i searched and figured it out

Follow these steps to install cocoapods and the GKImagePicker

Setup cocoapods on your mac:-

1- Open Terminal.

2- Make sure you have installed the Xcode command line tools

$ xcode-select —install

3- Install rvm stable and homeberw

$ \curl -sSL https://get.rvm.io | bash -s stable

4- Close then reopen Terminal.

5- Install ruby

$ rvm install 2.1

6- Switch to it

$ rvm use 2.1

7- Uninstall old cocoapods

$ sudo gem uninstall cocoapods

8- Install cocoapods

$ sudo gem install cocoapods

9- When installing is done setup cocoapods

$ pod setup

Setup new libraries to your project:-

1- Open Terminal

2- CD to your Xcode project folder And make sure you quit any opened Xcode projects

3- Create new Podfile

$ nano Podfile

4- Type the platform version that will be used in your project inside the Podfile : platform :iOS, ‘7.0’

5- Add the library you want like : pod 'GKImagePicker@robseward', '~> 0.0'

6- After your done, Save your settings by pressing command + x, then y (yes), then press Enter.

7- Install your new Podfile to your Xcode project

$ pod install

8- Open your Xcode project file and you will find new files and folders installed in it.

9- From now on never open your project from the .xcodeproj, instead open it from .xcworkspace.

10- Enjoy :)

Hope that was clear

Links for this instructions : One , Two and Three

Cocoapods Libraries

Community
  • 1
  • 1
aLFaRSi
  • 559
  • 2
  • 12
  • 29
0

The new Xcode 6.3.2 sets the architecture armv7,armv7s,and arm64 as default.

And sometimes the error "build failure “Undefined symbols for architecture x86_64”" may be caused by this. Because, some libs (not Apple's) were compiled for x32 originally and doesn't support x64.

So what you need, is to change the "Architectures" for your project target like this

NB. If you're using Cocoapods - you should do the same for "Pods" target. enter image description here

                                  (OR)

1.Architectures=$(ARCHS_STANDARD_32_BIT)

2.Build Active Architecture Only:YES

3.Valid Architectures armv6 armv7 armv7s arm64

Searching
  • 98
  • 1
  • 8