How to fix “IPA processing failed” error in xcode

2020-05-22 05:05发布

When I tried to create IPA file using Distribute APP option. It gave "IPA processing failed" error.

I have checked logs file: IDEDistribution.standard.log file.

2019-08-06 18:36:52 +0000 warning: Configuration issue: platform iPhoneSimulator.platform doesn't have any non-simulator SDKs; ignoring it Scanning IPA... 2019-08-06 18:36:52 +0000 Assertion failed: Expected 4 archs in otool output: /var/folders/4t/rpjk7pd55t16jfrd32y98gf0lb2t68/T/IDEDistributionOptionThinning.~~~a4cZJc/Payload/demo.app/Frameworks/AppAuth.framework/AppAuth: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 X86_64 ALL 0x00 DYLIB 23
3680 NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS Load command 0

10条回答
男人必须洒脱
2楼-- · 2020-05-22 05:23

You should check the Embed Frameworks under Xcode > build phases.

If your framework is introduced here, you can't use i386\x86_64 in your framework. Because the Embed Frameworks are copied to the application. To control the size of the application, the frameworks in the Embed Frameworks are required to be the most streamlined.

You can use Link Binary With Libraries to introduce your framework, as described here: https://github.com/Carthage/Carthage/issues/1046

Note that you need to add a new Run Script and add your framework to it, or it will crash.enter image description here

查看更多
疯言疯语
3楼-- · 2020-05-22 05:23

1.uncheck "Rebuild from bitcode", 2.click next fast fast fast. (speed is also important.)

enter image description here

if not , it will show IPA processing failed. enter image description here

查看更多
够拽才男人
4楼-- · 2020-05-22 05:28

We've solved this problem by setting Always Embed Swift Standard Libraries to NO in all frameworks, that are being used in our app.

查看更多
混吃等死
5楼-- · 2020-05-22 05:28

I had to select "Do not embed" in Frameworks to solve this

查看更多
迷人小祖宗
6楼-- · 2020-05-22 05:30
  1. Open Terminal


  2. Open your project drag path of respective framework to Terminal 
For example.

     cd /Users/xxxxx/Desktop/MyProject/ABC.framework


  3. Set your Framework name in below command and run

    
lipo -remove i386 ABC -o ABC && lipo -remove x86_64 ABC -o ABC

查看更多
疯言疯语
7楼-- · 2020-05-22 05:34

To solve similar problem on my end I used the following:

  • In app's target I went to the Build Phases
  • After the Embed Frameworks and Embed App Extensions sections I've added Run script with the following script:
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 script I took from here: https://medium.com/@maximbilan/ios-submission-unsupported-architectures-issues-733917a98cc3, credits goes to Daniel Kennet!

Also, be aware that this script could also cause compilation errors. In such case, here's the solution: Errors building Xcode Project after adding in Run Script fatal error: lipo: input file

On my end I also noticed that I have to turn off this script when compiling app locally (on development devices/simulator)

Hope that helps!

查看更多
登录 后发表回答