美文网首页
fatal error: lipo: can't open in

fatal error: lipo: can't open in

作者: 塞北孤雁 | 来源:发表于2021-04-07 11:56 被阅读0次

    fatal error: lipo: can't open input file: /Users/xxxx/Library/Developer/Xcode/DerivedData/xxxx-hbrpjfklispwrhcdyebqvnnnlyyh/Build/Products/Debug-iphoneos/Wifi.app/Frameworks/SQLite.framework/SQLite-arm64 (No such file or directory)

    fatal error: lipo: can't open input file: /Users/xxxx/Library/Developer/Xcode/DerivedData/xxxx-hbrpjfklispwrhcdyebqvnnnlyyh/Build/Products/Debug-iphoneos/Wifi.app/Frameworks/Kingfisher.framework/Kingfisher-arm64 (No such file or directory)

    运行之前的项目,发现第一次能运行成功,第二次再运行就失败,报以上错误,初步判断应该是缓存引起的,删除生成缓存的文件夹,可以运行,但是第二次还是报错,网上找了一圈办法,试了都不起作用,最后删除运行的脚本代码,问题解决,记录一下。TARGETS -> Build Phases -> Run Script 删除里面的脚本代码

    APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
    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
    

    把这些删除之后,清理一下工程(cmd + shift + k),重新运行,问题解决

    相关文章

      网友评论

          本文标题:fatal error: lipo: can't open in

          本文链接:https://www.haomeiwen.com/subject/suzykltx.html