How to solve unsupported Architecture. Your executable contains unsupported architecture ' [x86_64, i386]

Source: Internet
Author: User
Tags unsupported

Today, after completing a demo that uses the Microsoft Oxford API to implement voice control, upload to itunes connection for an in-house test, and you get the wrong tip in the title.

Checked, this error message appears if you did not select iOS devices instead of the emulator when archive.

Another scenario is in my project: using some other structure that contains the x86_64, i386 framework.

Can be used at the terminal

$ lipo-info workspacepath/xxx.framework/xxx

command to check the frame.

The workaround is to generate binary when using a script to get rid of those unsupported structures.

Select Project->targets->build phases in Xcode to find the embed Framework.

Then in the Xcode menu bar Editor->add build phase->add Run Scrip build Phase.

The following figure:



Run Script appears below the EMBED framework.

Shell fill in:/bin/sh

Enter this script below:

App_path= "${target_build_dir}/${wrapper_name}"

# This script loops through the frameworks embedded in the application and

# removes unused architectures.

Find "$APP _path"-name ' *.framework '-type D | While Read-r FRAMEWORK

Do

framework_executable_name=$ (Defaults read "$FRAMEWORK/info.plist" cfbundleexecutable)

Framework_executable_path= "$FRAMEWORK/$FRAMEWORK _executable_name"

echo "Executable is $FRAMEWORK _executable_path"

Extracted_archs= ()

For ARCH in $ARCHS

Do

echo "Extracting $ARCH from $FRAMEWORK _executable_name"

Lipo-extract "$ARCH" "$FRAMEWORK _executable_path"-o "$FRAMEWORK _executable_path-$ARCH"

extracted_archs+= ("$FRAMEWORK _executable_path-$ARCH")

Done

echo "Merging extracted architectures: ${archs}"

Lipo-o "$FRAMEWORK _executable_path-merged"-create "${extracted_archs[@]}"

RM "${extracted_archs[@]}"

echo "Replacing original executable with thinned version"

RM "$FRAMEWORK _executable_path"

MV "$FRAMEWORK _executable_path-merged" "$FRAMEWORK _executable_path"

Done

The following figure is done:



then re-archive.


I was searching for this question, refer to here:

http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/#n1


Above.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.