Search code examples
iphonexcodeios7ios5ios6

Need Solution How to solve this error


I don't know how to solve this error..
Can anyone tell me the solution please?

Ld /Users/BSE-Pothi/Library/Developer/Xcode/DerivedData/SHY-bvernmxskqctscfrkgfpzjxkwywb/Build/Products/Debug-iphonesimulator/SHY.app/SHY normal i386
cd /Users/BSE-Pothi/Desktop/SHY
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -L/Users/BSE-Pothi/Library/Developer/Xcode/DerivedData/SHY-bvernmxskqctscfrkgfpzjxkwywb/Build/Products/Debug-iphonesimulator -F/Users/BSE-Pothi/Library/Developer/Xcode/DerivedData/SHY-bvernmxskqctscfrkgfpzjxkwywb/Build/Products/Debug-iphonesimulator -filelist /Users/BSE-Pothi/Library/Developer/Xcode/DerivedData/SHY-bvernmxskqctscfrkgfpzjxkwywb/Build/Intermediates/SHY.build/Debug-iphonesimulator/SHY.build/Objects-normal/i386/SHY.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/BSE-Pothi/Library/Developer/Xcode/DerivedData/SHY-bvernmxskqctscfrkgfpzjxkwywb/Build/Intermediates/SHY.build/Debug-iphonesimulator/SHY.build/Objects-normal/i386/SHY_dependency_info.dat -o /Users/BSE-Pothi/Library/Developer/Xcode/DerivedData/SHY-bvernmxskqctscfrkgfpzjxkwywb/Build/Products/Debug-iphonesimulator/SHY.app/SHY

Undefined symbols for architecture i386:
  "_aspectFit", referenced from:
      -[BSE_Add_Pro renderPageAtIndex:inContext:] in BSE_Add_Pro.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Solution

  • It's most likely that you're using a framework/library in your app that has no simulator-compiled component.

    When you build for the simulator your app is compiled for the i386 architecture (x86_64 if you're using 64 bit). This means that any libraries or frameworks you use must include include in its binary compiled versions for each architecture you wish to build for.

    Find the framework that the symbol is from and run this command in terminal:

    lipo -i /path/to/framerwork/binary
    

    and it will print out the architectures that are compiled into that binary. If i386 is not included you won't be able to use it in the simulator. If it's your framework, you can recompile it for simulator and create a 'fat' binary containing ARM and i386 binaries. If it's not your framework, then you'll have to ask the distributor for a version that works with the simulator.