简体   繁体   中英

Building iOS app using Xcode works, but building the same app with xcodebuild command fails

Both new flutter and new react-native projects fail to build because the xcodebuild tool fails. They, however, succeed when I build the projects manually inside Xcode.

Apparently, the reason is because xcodebuild adds additional flag during the build, that, is:

export OTHER_CPLUSPLUSFLAGS=" -fmodule-map-file="/Users/aa/code/WW2/ios/Pods/Headers/Public/SSZipArchive/SSZipArchive.modulemap""

The result is that the build is failing because it cannot find the said module map, with the following error:

<unknown>:0: error: module map file '/Users/aa/code/WW2/ios/Pods/Headers/Public/SSZipArchive/SSZipArchive.modulemap' not found

The said module map is from a previous project (called WW2 ) which I moved. But the problem is that even newly-created projects are affected.

I wasted two days to solve this, even reading through the documentation about xcode build settings, but to no avail. What I'm trying to do is to find the source of this additional flag or configuration. I even used grep to find a file containing the particular flag, but it's not yet finished scanning my system.

So the problem is somehow the $PODS_ROOT variable is set to /Users/aa/code/WW2/ios/Pods , probably due to a canceled npm build. I only needed to restart the terminal and the problem is solved.

As a side note, I should have used the search function in the finder as it's much faster because it uses an index unlike grep.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM