Unable to open executable - xcode

2020-02-11 02:11发布

I'm getting this error...any idea how to solve it?

GenerateDSYMFile /Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator/PBTest.app.dSYM /Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator/PBTest.app/PBTest
    cd /Users/fmota/Documents/Developer/Protobuf/PBTest
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/usr/bin/dsymutil /Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator/PBTest.app/PBTest -o /Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator/PBTest.app.dSYM

error: unable to open executable '/Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator/PBTest.app/PBTest'

9条回答
疯言疯语
2楼-- · 2020-02-11 02:16

I had accidentally added the same source files to my Project in Xcode twice (a header and an implementation file. Look for clues in the error message as to which files might be duplicates.

Deleting the duplicate copy (Remove References, not Move to Trash) solved my issue.

查看更多
淡お忘
3楼-- · 2020-02-11 02:19

In my case, I was trying to compile external library into my code and some of test c files in this library was added on "Compile Sources" on "Build Phases" tab. These files also had main() function which was causing it show "duplicate symbol" message. Once I removed these files from Compile Sources, project compiled successfully.

查看更多
一纸荒年 Trace。
4楼-- · 2020-02-11 02:19

I solved this by deleting the path specified in both Header Search Paths and Library Search Paths, found under Targets - Build Settings - Search Paths. The application now builds and runs cleanly on the iOS simulator.

I do not yet have real-device testing capability, so we'll see what happens when I get to that point.

查看更多
可以哭但决不认输i
5楼-- · 2020-02-11 02:20

I was getting the same error dialog. It turns out I had two consts of the same name declared in different files and the compile was failing with no meaningful error output, only this problem. After doing the DWARF thing discussed here I was able to get better error output that helped me find the problem

查看更多
啃猪蹄的小仙女
6楼-- · 2020-02-11 02:20

And here's yet another cause: repeated use of [unowned self] inside of nested blocks.

查看更多
看我几分像从前
7楼-- · 2020-02-11 02:27

I have also faced that problem. I have closed, restarted Xcode; deleted the application from device and reinstalled it again, then the problem has gone.
Make sure the library and project files is truly included if it is not include it shows in red color in this type of case some time it is in original folder and not in project so delete it and add it again.

查看更多
登录 后发表回答