Unable to run my iPhone 4 app in iPhone 5

Discussion in 'iOS Programming' started by Narendar Singh, Oct 4, 2012.

  1. Narendar Singh macrumors member

    Narendar Singh

    Joined:
    Jun 22, 2012
    Location:
    INDIA
    #1
    Initially I had Xcode 4.3.

    I have updated my Xcode to 4.5 version for iOS 6.

    If I try to run my app in iPad, I am getting following error:

    Xcode cannot run using the selected device.
    Choose a destination with a supported architecture in order to run on this device.


    Then I added one more architecture from settings, ie armv7s, before I had armv6 and armv7.

    Again if I run my app on iPad, I get another error for my ZBar library.

    ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/narendarsinghsaini/Desktop/MyApp/Classes/ZBarSDK/libzbar.a for architecture armv7s

    ld: warning: building for MacOSX, but linking against dylib built for iOS: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/libsqlite3.dylib/Users/narendarsinghsaini/Desktop/MyApp/Classes/ZBarSDK/libzbar.a
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Now I am expecting steps to overcome this issue :confused:
     
  2. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #2
    The first problem sounds like you have set the iOS target to 6 while the iPad may be at an older version. That won't work. Change the target OS to be the same or older than the device you want to test on.

    The linker issue is a simple fix if you can't recompile that library your self to contain both architecture binaries. Change the Architectures to just have armv7. It defaults to "$(ARCHS_STANDARD_32_BIT)" which represents "Standard (arv7,armv7s)" now. That is under your targets Build Settings tab. Click on it, choose Other... and set it to armv7.
     

Share This Page