xcodebuild failure clang:error no such file or directory:

前端 未结 9 2228
伪装坚强ぢ
伪装坚强ぢ 2021-01-01 21:50

Having a problem when building with xcodebuild. My project/app builds fine with the Xcode - gui. It simply isn\'t finding/building the libcryptopp library which is part of t

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-01 22:50

    My xCode info is:

    image

    I faced similar errors during xcode building projects (native swift, flutter, react native, native script) in which I got error messages related to clang compilar. Errors like:

    • clang-4.0: error: no such file or directory: '/Users/xxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxxxxxxxxxxxx/Index/Data Store'
    • clang-4.0: error: cannot specify -o when generating multiple output files
    • others

    Despite of errors related with DerivedData for native apps can be fixed by deleting the directory and, eventually, restart xCode and even restart the machine... in this case, you will see that after deleting the directory and start building process again, the error comes back.

    Then, is the moment of checking the clang installation by running clang --version. The normal output will be something like:

    image

    as you can see the InstalledDir is incorrect for xCode. In my case, some days ago I needed to install Anaconda app (R, Python, etc) and, now, I remember that I had to install some dependencies and one of them was clang and its installation was altered. To fix this problem (in my case that I will not need anaconda any more): (edited)

    1.- Delete anaconda and all its dependencies (I recommend to use App Cleaner). 2.- Re-install xCode

    After reinstalling xCode, if you type again clang --version, you'll get this:

    image

    More info at: https://github.com/flutter/flutter/issues/32457#issuecomment-496161092

    Hopefully, this info helps some else.

    Best

提交回复
热议问题