React Native (Expo) - error: generate-pch command failed with exit code 1 - ios

Building a React Native Expo app (prebuild on iOS, not using Expo Go) and running into this esoteric error that I can't seem to find elsewhere on the internet.
I'll post it here for the next unlucky React Native dev, and perhaps I'll find a solution and post that too.
expo run:ios output:
⚠️ (../../Library/Developer/Xcode/DerivedData/MyProject-epxolwjjgmimbdefugnlecrdysuv/Build/Intermediates.noindex/PrecompiledHeaders/MyProject-Bridging-Header-2vyenlvwppgam.dia:1:1)
Command PrecompileSwiftBridgingHeader failed with a nonzero exit code
^ Could not read serialized diagnostics file: error(in target 'MyProject' from project 'MyProject')
❌ error: generate-pch command failed with exit code 1 (use -v to see invocation)
› 1 error(s), and 1 warning(s)
Failed to build iOS project. "xcodebuild" exited with error code 65.
Xcode build output:
<unknown>:0: error: error opening input file '/Users/jh/Code/MyProject/ios/MyProject/MyProject-Bridging-Header.h' (No such file or directory)
<unknown>:0: error: cannot open file '/Users/jh/Library/Developer/Xcode/DerivedData/MyProject-epxolwjjgmimbdefugnlecrdysuv/Build/Intermediates.noindex/PrecompiledHeaders/MyProject-Bridging-Header-e8n926ydzbc0.dia' for diagnostics emission (No such file or directory)
/Users/jh/Library/Developer/Xcode/DerivedData/MyProject-epxolwjjgmimbdefugnlecrdysuv/Build/Intermediates.noindex/PrecompiledHeaders/MyProject-Bridging-Header-e8n926ydzbc0.dia:1:1: warning: Could not read serialized diagnostics file: error("Failed to open diagnostics file") (in target 'MyProject' from project 'MyProject')
Command PrecompileSwiftBridgingHeader failed with a nonzero exit code
Expo SDK version 44. I'm on a 2022 Mac Studio M1.

Okay, found the solution!
I had used npx react-native-rename to rename my project, but it didn't rename the Swift bridging header.
It's located in ios/MyProject/<oldname>-Bridging-Header.h.
renamed: ios/MyProject/OldName-Bridging-Header.h -> ios/MyProject/MyProject-Bridging-Header.h
While I was doing this, I also discovered that several of my bundle identifiers hadn't been moved over either. Do a codebase search for com.yourorganization.youroldbundlename to find & replace those too.
The locations I had to update:
./ios/MyProject.xcodeproj/project.pbxproj
./ios/MyProject/Info.plist
./app.json

Related

No such module 'Amplify' & Could not read serialized diagnostics file: error("Invalid diagnostics signature")

I'm trying to compile an Xcode project. I'm getting 2 runtime errors:
No such module 'Amplify'
&
/Users/????????/Library/Developer/Xcode/DerivedData/screener_app-gkvpndyzdgqrsreqyokgisatdzav/Build/Intermediates.noindex/screener_app.build/Debug-iphonesimulator/screener_app.build/Objects-normal/x86_64/AuthButtonView.dia:1:1: warning: Could not read serialized diagnostics file: error("Invalid diagnostics signature") (in target 'screener_app' from project 'screener_app') Command CompileSwift failed with a nonzero exit code
The screenshot is seen below.
I have tried a handful of things:
cleaned build folder
install/update pods
removed derived data
I'm not sure what to do from here. Any advice is appreciated.
Edit: I am seeing that the workspace is compiling but the project folder is not.

Oracle JET : Unable to build ojet hybrid project after upgrading xcode to Version 12.0 (12A7209)

This morning I updated my xcode to Version 12.0 (12A7209) and since then I am not able to build the project for ios
Replication steps
ojet create testapp --template=navbar
cd testapp
ojet add hybrid
ojet build ios
Getting the below error
.........
In module 'Foundation' imported from /Users/hellonuh/Desktop/testapp/hybrid/platforms/ios/build/emulator/include/Cordova/CDVAppDelegate.h:20:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:595:1: note: 'stringByAddingPercentEscapesUsingEncoding:' has been explicitly marked deprecated here
- (nullable NSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)enc API_DEPRECATED("Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid.", macos(10.0,10.11), ios(2.0,9.0), watchos(2.0,2.0), tvos(9.0,9.0));
^
3 warnings and 3 errors generated.
Cordova compile finished.
Error: Error: Command failed: cordova compile ios --debug --emulator
** BUILD FAILED **
The following build commands failed:
CompileC /Users/hellonuh/Library/Developer/Xcode/DerivedData/testapp-hfsgwahghfnpzecdcshskgzlpyep/Build/Intermediates.noindex/testapp.build/Debug-iphonesimulator/testapp.build/Objects-normal/x86_64/CDVWKWebViewEngine.o /Users/hellonuh/Desktop/testapp/hybrid/platforms/ios/testapp/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewEngine.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
xcodebuild: Command failed with exit code 65
Please help

xcodebuild build command fails in Xcode 11.5

when build the app in xcode 11.5 generate this issue.
LOG: I hope can help me!! Regards!!
warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'B7_MOCHA' from project 'B7_MOCHA')
warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'B7_MOCHA' from project 'B7_MOCHA')
warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open
diagnostics file (in target 'B7_MOCHA' from project 'B7_MOCHA')
:0: error: unable to execute command: Killed: 9
:0: error: compile command failed due to signal 9 (use -v to see invocation)
Command CompileSwiftSources failed with a nonzero exit code
this a picture from console log:
the other console show this issue
/Users/dverdugo/Library/Developer/Xcode/DerivedData/B7_MOCHA-asiprqvqhlstshfnhycalolsjhxs/Build/Intermediates.noindex/B7_MOCHA.build/Debug-iphoneos/B7_MOCHA.build/Objects-normal-asan/arm64/TAG_CHAT.dia:1:1: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file
I hope can help me!! Regards!!
Sometimes the best thing you need to do is
-Close xcode.
-Restar the Mac
-check if the pods you are using installed well.
and for the second error, maybe you deleted some file in the folder of your project so xcode is looking for it and can't find it.

Nativescript application builds fine for android but not for IOS

Here is the logs I get when I try to build ios:
Project successfully prepared (ios)
Configure firebase
Building project...
Xcode build...
/Users/me/Desktop/vt/vt_tv/front/Native/App/platforms/ios/Pods/ASBPlayerSubtitling/ASBPlayerSubtitling/ASBPlayerSubtitling.m:41:1: warning:
method possibly missing a [super awakeFromNib] call [-Wobjc-missing-super-calls]
}
^
// Then I get a long list of my icon resources
warning: 'UILaunchImages' has been deprecated, use launch storyboards instead. (in target 'App' from project 'App')
error: cannot parse the debug map for '/Users/me/Desktop/vt/vt-tv/front/Native/App/platforms/ios/build/Debug-iphonesimulator/App.app/App': Is a directory
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-52.200.1/rsync/rsync.c(244) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning build
note: Constructing build description
** BUILD FAILED **

Phonegap Command failed with exit code 74

Trying to build my Phonegap app in the terminal and getting these errors. Where do I go from here? Is there a way to identify the code 74?
xcodebuild: error: Unable to read project
cannot be opened because the project file cannot be parsed.
Error: phonegap Command failed with exit code 74.
After doing some research I believe it's because I was linking to: xmlns:gap="http://phonegap.com/ns/1.0">
but I should have been linking to:
xmlns:cdv="http://cordova.apache.org/ns/1.0">

Resources