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

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.

Related

Flutter IOS build problem can't do flutter build ipa

hope u can help me, I've been stuck for days now with this problem. With the Android build I had no problems, but when I try to do flutter build ipa I get the following error:
Running Xcode build...
Xcode archive done. 74,4s
Failed to build iOS app
Error (Xcode): ../../.pub-cache/hosted/pub.dev/titled_navigation_bar-4.1.0/lib/src/navigation_bar.dart:83:11: Error: No named parameter with the name 'overflow'.
Encountered error while archiving for device.
I've tried several things like:
-flutter clean
-flutter pub cache repair
I've also tried to remove the package and install de pubs again, I've tried downgrading flutter... pretty much everything I've found here but no luck.
Thanks in advance.

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

Xcode error when build project in flutter

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.

Flutter Apple silicon fatal Shared_preferences error: 'Flutter/Flutter.h' file not found

I am using an Apple Silicon mac for my Flutter project and I have an issue after passing my program to my new computer.
Xcode's output:
↳
In file included from /Users/gorkem/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12+4/ios/Classes/FLTSharedPreferencesPlugin.m:5:
/Users/gorkem/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.12+4/ios/Classes/FLTSharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
error: the following command failed with exit code 1 but produced no further output
CompileC /Users/gorkem/Library/Developer/Xcode/DerivedData/Runner-ghjviwzylhbejhfsayqxcrbfzwyc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/local_auth.build/Objects-normal/x86_64/FLTLocalAuthPlugin.o /Users/gorkem/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/local_auth-0.6.3+4/ios/Classes/FLTLocalAuthPlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
Command CompileSwift failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'shared_preferences' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'vibration' from project 'Pods')
I think that the problem comes from the file flutter.h inside the shared preferences package.
Here's one of the part of the problem. If you need more, I can edit it anytime.
I already did many things related to this issue but apparently, it didn't work. If you have a recommendation, I'l listen to it.
BTW, I tried flutter clean and then rerun, tried to update all the packages. None of them work.
Try removing CocoaPod from your project
cd ios
pod deintegrate
flutter clean
flutter run
If this doesn't work try reinstalling flutter or switch to beta channel

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.

Resources