Solved: TypeError: str.replace is not a function - theta-client demo-react-native iOS build error

When trying to build demo-react-native on iOS, encountered str.replace is not a function

yarn run ios

**yarn run v1.22.22**

$ react-native run-ios

**error** str.replace is not a function.

TypeError: str.replace is not a function

at inlineString (/Users/craig/Development/ricoh/2024/theta-client/demos/demo-react-native/node_modules/@react-native-community/cli-tools/build/errors.js:25:33)

I successfully used this solution on Stackoverflow.

I had to log into to apple.com again. Per the tip, I reselected Command Line Tools: Xcode 16.

I got further and encountered this error:

{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device, error:iOS 18.0 is not installed. To use with Xcode, first download and install the platform }

Installed iOS simulator 18

image

build still failing.

Tried pod install from ios directory. Failed

building theta-client.

theta-client % ./gradlew podPublishXCFramework

update pod repo and try pod install again

pod repo update

Updating spec repo `trunk`

craig@Craigs-MacBook-Air demo-ios % pod install

Analyzing dependencies

Downloading dependencies

Installing THETAClient 1.10.2 (was 1.10.0)

Generating Pods project

Integrating client project

Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

getting error about cmake

WARNING:C/C++: Could not execute cmake at '/Users/craig/brew/opt' to get version. Skipping.

though, cmake exists in brew/bin/cmake

trying brew update and brew upgrade

now finding cmake, but build still failing

disable flipper

in ios/Podfile disable flipper

it works

**info** Installing "**/Users/craig/Library/Developer/Xcode/DerivedData/DemoReactNative-gfpzbpthmvykvpavmbxdqvulctno/Build/Products/Debug-iphonesimulator/DemoReactNative.app** on iPhone 16 Pro"

**info** Launching "**com.ricoh.thetaeditor.--PRODUCT-NAME-rfc1034identifier-**"

**success** Successfully launched the app on the simulator

✨ Done in 51.78s.