XCode13.4 run old flutter project failed to build iOS app - ios

I just upgraded to Xcode 13.4 in macOS Monterey 12.4, running a flutter project got this error:
Unhandled exception:
ProcessException: No such file or directory
Command: /Users/taoli-blue/fvm/versions/2.10.3/bin/flutter assemble --no-version-check --output=/Users/taoli-blue/Library/Developer/Xcode/DerivedData/Runner-fjqqglukmistzcemtudzjrvxvsvk/Build/Products/Debug-dev-iphoneos/ -dTargetPlatform=ios -dTargetFile=/Users/taoli-blue/taoli/flutter_taoli_app/lib/main_dev.dart -dBuildMode=debug -dIosArchs=arm64 -dSdkRoot=/Applications/Xcode13.3/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk -dSplitDebugInfo= -dTreeShakeIcons=false -dTrackWidgetCreation=true -dDartObfuscation= -dEnableBitcode= --ExtraGenSnapshotOptions= --DartDefines= --ExtraFrontEndOptions= -dCodesignIdentity=21E6A88880ED32FA5B3525F5134308364DAB1434 debug_ios_bundle_flutter_assets
_ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:487:7)
_runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:632:18)
Process.runSync (dart:io-patch/process_patch.dart:68:12)
Context.runSync (file:///Users/taoli-blue/fvm/versions/2.10.3/packages/flutter_tools/bin/xcode_backend.dart:92:42)
Context.buildApp (file:///Users/taoli-blue/fvm/versions/2.10.3/packages/flutter_tools/bin/xcode_backend.dart:448:34)
Context.run (file:///Users/taoli-blue/fvm/versions/2.10.3/packages/flutter_tools/bin/xcode_backend.dart:51:9)
main (file:///Users/taoli-blue/fvm/versions/2.10.3/packages/flutter_tools/bin/xcode_backend.dart:17:5)
delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
Command PhaseScriptExecution failed with a nonzero exit code
And I totally don't know how to resolve this error.
Any one could help me?

Related

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

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

'UserAgent.h' file not found flutter firebase iOS

I am working on flutter application with firebase, when i use the firebaseAuth plugin application give the following error
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 131.2s
Failed to build iOS app
Error output from Xcode build:
↳
2020-02-28 16:05:06.832 XCBBuildService[68423:382033] Failed to remove:
/Users/apple/Library/Developer/Xcode/DerivedData/Runner- hfqwisipukhnqobtbsvjhfltdbgs/Build/Intermediates.noindex/XCBuildData/1be627f6c729f1a388e5fec96804d392-manifest.xcbuild: unlink(/Users/apple/Library/Developer/Xcode/DerivedData/Runner-hfqwisipukhnqobtbsvjhfltdbgs/Build/Intermediates.noindex/XCBuildData/1be627f6c729f1a388e5fec96804d392-manifest.xcbuild): No such file or directory (2)
2020-02-28 16:05:07.269 XCBBuildService[68423:382033] Failed to remove: /Users/apple/Library/Developer/Xcode/DerivedData/Runner-hfqwisipukhnqobtbsvjhfltdbgs/Build/Intermediates.noindex/XCBuildData/1be627f6c729f1a388e5fec96804d392-desc.xcbuild: unlink(/Users/apple/Library/Developer/Xcode/DerivedData/Runner-hfqwisipukhnqobtbsvjhfltdbgs/Build/Intermediates.noindex/XCBuildData/1be627f6c729f1a388e5fec96804d392-desc.xcbuild): No such file or directory (2)
* BUILD FAILED *
Xcode's output:
↳
/Users/apple/Library/Android/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.15.5+2/darwin/Classes/FLTFirebaseAuthPlugin.m:7:9: fatal error: 'UserAgent.h' file not found
#import "UserAgent.h"
^~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
i am using these libraries-
firebase_auth: ^0.15.5+2
firebase_storage: ^3.1.1
cloud_firestore: ^0.13.4
anyone have idea how to solve this error?, i have already done following things
flutter clean
deleted podfile.lock
deleted pods folder
pod deintegrate
pod repo update
pod install
but don't help me to solve this error
We were struggling with the same error. It seems it's a firebase_auth dependency bug (firebase_core v0.4.4+2).
First, run flutter clean, then change your dependencies on pubspec.yaml to
dependencies:
firebase_auth: 0.15.4
dependency_overrides:
firebase_core: 0.4.4
Hope it helps!

Cordova build failed for ios after installing pushwoosh notifications plugin

We have done ios app using cordova.We used pushwoosh plugin to send push notifications.Recently we have updated pushwoosh plugin from version 3.6.5 to 6.2.2 (https://github.com/Pushwoosh/pushwoosh-phonegap-plugin). After installing new version we are not able to build project.
cordova plugin add pushwoosh-cordova-plugin#6.2.2
After installing
cordova build ios
We are getting below error
The following build commands failed:
CpResource www/plugins/com.pushwoosh.plugins.pushwoosh/www/PushNotification.js build/emulator/ITCPapyra.app/PushNotification.js
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/apple/ITCPapyra/platforms/ios/cordova/build-debug.xcconfig,-project,ITCPapyra.xcodeproj,ARCHS=i386,-target,ITCPapyra,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/apple/ITCPapyra/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/apple/ITCPapyra/platforms/ios/build/sharedpch
ERROR building one of the platforms: Error: /Users/apple/ITCPapyra/platforms/ios/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /Users/apple/ITCPapyra/platforms/ios/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
We are using cordova version 5.2.0, node version 4.4.7 .Please help how to solve this issue and build our project success.
You may not have the required environment or OS to build this project
Which environment do you use?

Error "Command failed with exit code 66" running ios simulator on meteor app

I am trying to run a simulation for ios of my meteor app, following all the steps:
meteor install-sdk ios
meteor add-platform ios
meteor run ios
But when I run the latter it gives me the following error:
Error while running for mobile platforms: Error running
/Users/ivanmac/.meteor/packages/meteor-
tool/.1.0.41.azxhr5++os.osx.x86_64+web.browser+web.cordova/meteor-tool-
os.osx.x86_64/tools/cordova-scripts/cordova.sh
xcodebuild: error: 'test_app.xcodeproj.xcodeproj' does not exist.
Error: /Users/ivanmac/Desktop/test_app/.meteor/local/cordova-
build/platforms/ios/cordova/build: Command failed with exit
code 66
at ChildProcess.whenDone
(/Users/ivanmac/.meteor/packages/meteor-
tool/.1.0.41.azxhr5++os.osx.x86_64+web.browser+web.cordova/meteor-tool-
os.osx.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/cordova-
lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
Running command: /Users/ivanmac/Desktop/test_app/.meteor/local/cordova-
build/platforms/ios/cordova/build
Build settings from command line:
ARCHS = i386
CONFIGURATION_BUILD_DIR =
/Users/ivanmac/Desktop/test_app/.meteor/local/cordova-
build/platforms/ios/build/emulator
SDKROOT = iphonesimulator8.1
VALID_ARCHS = i386
Only post I found on the internet talking about this was solved by changing the path, which I tried but didn't help. I'm using Meteor 1.0.3.2 and my xcode is on version 6. Does anyone have any idea of what might be happening?
Update to question
I just found out that if I run the .xcodeproj file on the cordova/ios folder manually the project runs fine, so I guess the path to look for the file to run on xcode when I run "meteor run ios" has an error.
Open platforms/ios/cordova/build and change
XCODEPROJ=$( ls "$PROJECT_PATH" | grep .xcodeproj )
PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
to
XCODEPROJ=$( ls "$PROJECT_PATH" | grep --color=never .xcodeproj )
PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
Source: phonegap build ios exception with HelloWorld Application

Error while adding phone gap platform with Xcode 6.0-beta

When i using command
cordova platform add ios
I am getting this issues
Creating ios project...
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Cordova can only run in Xcode version 4.6 or greater.
Error: /Users/ykorshev/.cordova/lib/ios/cordova/3.5.0/bin/create: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
Xcode beta 6 with Xcode command line developer tools are installed. I am using Mac OS X v10.9.3
use this:
sudo xcode-select -s /Applications/Xcode6-Beta.app/
this works fine for me

Resources