Xcode 14.3 TurboModuleUtils.h: No such file or directory
Whenever new Xcode is released, I upgraded Xcode on my home before upgrading the machine in the office.
Last saturday, I noticed Xcode 14.3 was released, so I upgraded it immediately.
However I can’t build Kickgoing with Xcode 14.3 and I looking for the way to solve the problem.
XCode emit this error.
find: node_modules/react-native/ReactCommon/turbomodule/core/TurboModuleUtils.h: No such file or directory
Even with cleaning build caches, I can’t solve it.
clean build- X
remove DerivedData X
rm -rf node_modules X
I checked if turbomodule is on the path.
But I can’t find ReactCommon/turbomodule
instead of turbomodule, TurboModuleUtils exists.
react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h
I can’t find what’s wrong, so I tried another solutions specified to Pod.
rm -rf Pods
rm -rf Podfile.lock
However I can’t solve the problem.
Use XCode 14.2 Command Tools
I see the answer of similar questions, the answer is ‘use Xcode 14.2 intead of 14.3’. So I decided to use Xcode 14.2.
To use 14.2, Open Apple Download Page and search Xcode 14.2.
I Pressed View Details and Xcode 14.2.dmg to download XCode 14.2 Command Line Tools.
However I can’t see Xcode 14.2 in the Settings.
I had no chance, but to use Xcode instead of Command Line Tools. I downloaded XCode 14.2
And unachived and renamed to Xcode 14.2
I tried to build with Xcode 14.2 Command Line tools in Xcode 14.3.
But Xcode emit same build error.
So I retried with Xcode_14.2 and succeed.
I can’t find way to solve the error with Xcode 14.3 yet.
I asked to stackoverflow and react-native, but no reply.
Pre-Actions
I found a solution. The reason is pre-actions.
I found Pre-actions from project.
The script ran shell script to modify TurboModuleUtils.h
find node_modules/react-native/ReactCommon/turbomodule/core/TurboModuleUtils.h -exec sed -i "" -e '/folly/d' {} +
I removed the action and this error has gone.