iOS开发记录(持续更新)

问题及解决办法

  1. 问题描述:编译错误
    fatal error: lipo: can’t open input file: /Users/username/DerivedData/AppName/Build/Products/Debug-iphonesimulator/xxx.framework/xxx(No such file or directory)fatal error: lipo: can’t open input file: /Users/username/DerivedData/AppName/Build/Products/Debug-iphonesimulator/xxx.framework/xxx(No such file or directory)
    Command PhaseScriptExecution failed with a nonzero exit code

    解决办法:选择模拟器编译一次,再选择真机编译一次。

  2. 问题描述:编译错误
    ld: warning: ignoring file /Users/user_name/proj_path/framework/xxx.framework/xxx, missing required architecture x86_64 in file /Users/user_name/proj_path/framework/xxx.framework/xxx (2 slices)
    Undefined symbols for architecture x86_64:
    OBJC_CLASS$_xxxxx”, referenced from:
    objc-class-ref in xxViewController.o
    OBJC_CLASS$_xxxxxx”, referenced from:
    objc-class-ref in xxViewController.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    解决办法:在Project target里“Build Settings”的“Valid Architectures”添加“i386” ,去掉arm64,留下armv7,armv7s还有新添加的i386就可以了

    参考:https://blog.csdn.net/itolfn/article/details/47299339

  3. 问题描述:编译错误
    fatal error: ‘xxx/xxx.h’ file not found
    #import

    解决办法:重新引用第三方库
    iOS开发记录(持续更新)_第1张图片

  4. 问题描述:编译失败
    ld: framework not found xxx
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    解决办法:除了网上的其他方法之外,在Finder中查找一下framework是否完整(有可能部分文件被git忽略了,没有上传到服务器)
    在这里插入图片描述

  5. 问题描述:添加 .scn 文件到 art.scnassets 编译失败
    Command CodeSign failed with a nonzero exit code
    /scntool: -1: Could not load ModelIO.framework ((null))
    /scntool: -1: Could not load SceneKit.framework ((null))
    /scntool: -1: Could not load PhysicsKit.framework ((null))
    /scntool: -1: Could not load Jet.framework ((null))
    /scntool: -1: Could not load SpriteKit.framework ((null))

    解决办法:命令行进入工程目录,执行命令 xattr -rc .

    参考:https://stackoverflow.com/questions/37830758/code-signing-error-whenever-i-try-replacing-stock-files-in-new-scenekit-applicat/40846829

你可能感兴趣的:(IT)