美文网首页
Xcode Executable Not Found错误

Xcode Executable Not Found错误

作者: Linda_smile | 来源:发表于2022-01-26 10:26 被阅读0次

    编译后报错:Executable Not Found
    /Users/xxx/Library/Developer/Xcode/DerivedData/xxx-xxx/Build/Products/Debug-iphoneos/Test.app is not a valid path to an executable file. Please rebuild the project to ensure that all required executables are created. Check your project settings to ensure that a valid executable will be built.


    报错截图

    网上找的解决方法:
    方法1:TARGET -> Build Settings, search ‘VALID’.
    设置 VALID_ARCHS 的值,如果使用模拟器编译的话,添加 x86_64,如果使用真机编译的话设置成arm64。


    网图设置VALID_ARCHS

    方法2:Targets -> Build Settings, 搜索 plist
    把 Generate Info.plist File 设置为 No,
    把 Info.plist File 设置为你Info.plist的路径 ,可以找到工程中的plist文件直接拖入,自动填写好路径,但这是绝对路径换个电脑依旧会报错,所以要设置相对路径如图,设置$(SRCROOT)不行,试试 $(PROJECT_DIR)。

    (PROJECT_DIR)代表的是整个项目(SRCROOT)代表的是项目根目录下

    网图设置Info.plist File

    但是以上方法还是没有解决我的问题
    我的问题是PrefixHeader.h文件的路径有错误,造成的.需要设置Targets ->Build Setting 里面的
    prefix header 路径为 $(SRCROOT)/$(PROJECT_NAME)/PrefixHeader.h(相对路径) 如果PrefixHeader.h文件的路径不是直接在项目路径下,而是在二级目录下,二级目录的地址也要写写上.例如:$(SRCROOT)/$(PROJECT_NAME)/Class/PrefixHeader.h

    以上解决了报错.
    从报错的语句分析,大致可以猜测到某个初始文件的路径指向不对,造成不能启动.

    参考链接:https://blog.csdn.net/Morris_/article/details/120126706
    参考链接:https://blog.csdn.net/u010069091/article/details/122046312

    相关文章

      网友评论

          本文标题:Xcode Executable Not Found错误

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