Xcode error when build project in flutter - xcode

I am new in flutter.I uses Xcode version-12.3 and flutter version Flutter 2.10.4.
when I build the project in Xcode I got an error Command PhaseScriptExecution failed with a nonzero exit code.
And when i try to build in terminal an error- Encountered error while building for device.
enter image description here
When I run the project in terminal it gives a warning:Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2
will it make any difference to build my project.

Related

XCode 14.0.1 error build: Command PhaseScriptExecution failed with a nonzero exit code (React Native project)

I'm trying to run my React Native project on XCode so that I can get it to run on my iOS device, everything works perfectly fine in VS Code and the Simulator software, but XCode simply refuses to build the project, throwing the error:
error build: Command PhaseScriptExecution failed with a nonzero exit code
This error occurs even when I try running an untouched new project (the example init project from react-native).
I tried these solutions:
deintegrating and reinstalling pods
running this command: npx react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ./ios/main.jsbundle
Locking and unlocking the "login" keychain, I wasn't able to lock the keychain in the first place, the option is greyed out. What could cause that?
run pod install in the ios directory
I use:
XCode 14.0.1
M1 Macbook Air
MacOS Big Sur 12.6
React Native 9.1.3 (at least that's what npx react-native -v says, but node modules -> react-native -> package.json in my project says it's 0.70.1)
If there are any more details you need please let me know, thanks.
EDIT: Here's a screenshot of the build's report in the report navigator
screenshot

My KMM project won't run on an iPhone emulator

I have a KMM project which runs perfectly on android, however when I open the project on Xcode for the IOS portion and try to run it on an emulator it does not compiler throwing the following error:
BUILD FAILED in 3s
Command PhaseScriptExecution failed with a nonzero exit code
What went wrong:
Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.
The app does run on my physical iPhone.
I have two questions:
How do I fix this?(if there is a fix)
Can I confidently work on my project without the emulator or should I take this error as a sign that there is something wrong with my project to the point of concern?
Kotlin Version: 1.5.31
Running on Mac with M1
using SQLDelight and Serialization dependencies.

grpc/grpc.h file not found error when building flutter project in xcode 11.5

grpc/grpc.h file not found error when building flutter project in xcode.
I reinstalled and updated all Cocoapods. No errors.
From Terminal, already ran flutter clean, flutter doctor (see below).
flutter build ios returns the following message:
Xcode build done. 5.4s
Failed to build iOS app
Error output from Xcode build:
** BUILD FAILED **
Xcode's output:
↳
In file included from
/Users/.../ios/Pods/gRPC-C++/src/cpp/thread_manager/thread_manager.cc:19:
In file included from
/Users/.../ios/Pods/gRPC-C++/src/cpp/thread_manager/thread_manager.h:27:
/Users/.../Documents/name_gifts_v2_working/ios/Pods/gRPC-C++/src/core/lib/gprpp/sync.h:22:10: fatal error:
'grpc/impl/codegen/port_platform.h' file not found
#include <grpc/impl/codegen/port_platform.h>
1 error generated.
Installing libgrpc++-dev and libgrpc-dev packages fixed this issue for me on Ubuntu. Try to find equivalent packages for your OS.

Flutter desktop embedding

Following these instructions
I tried to run a new project on macOS(desktop) using Android Studio.
I get the following error:
Launching lib/main.dart on macOS in release mode... Finished with
error: Unable to get Xcode project information: xcodebuild: error:
The directory
/Users/current.user/Work/Playground/testout/flutter_app2/macos does
not contain an Xcode project, workspace or package.
I get the same issue if I run in the terminal flutter run --release -d macOS
Running on a simulator/device, works fine.
It doesn't sound like you followed the instructions for running a project other than the FDE example. A newly created Flutter project doesn't have support for running on desktop; you need to add that.
See also flutter.dev/desktop#create for information on the state of create and run for desktop.

Getting error while running flutter project in simulator in debug mode

Error comes after running flutter run
The Xcode project does not define target "Runner" which is needed by
Flutter
tooling.
Open Xcode to fix the problem:
open ios/Runner.xcworkspace
Encountered error while building for device.
Just make sure that your app target called "Runner". It seems that flutter tooling relies on this target name.
Example

Resources