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

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

Related

I got a error trying to compile VLC custom build (VVC) on macOS 11.4 with Xcode

I need some help with custom VLC build. I am running on macOS 11.4 Big Sur (inside virtual machine), trying to compile my custom VLC build of VVC (known as Versatile Video Codec), I checked everything software’s like Python, macOS SDK, CMake, Java and XCode (latest version, December 2021) before compiling. I got an error for this:
Command CompileXIB failed with a nonzero exit code
/usr/local/libo266dec/contrib/contrib-x86_64-apple-darwin20/breakpad/src/client/mac/Breakpad.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 12.2. (in target 'Breakpad' from project 'Breakpad')
/usr/local/libo266dec/contrib/contrib-x86_64-apple-darwin20/breakpad/src/client/mac/Breakpad.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 12.2. (in target 'breakpadUtilities' from project 'Breakpad')
** BUILD FAILED **
The following build commands failed:
CompileXIB /usr/local/libo266dec/contrib/contrib-x86_64-apple-darwin20/breakpad/src/client/mac/sender/Breakpad.xib (in target 'crash_report_sender' from project 'Breakpad')
(1 failure)
make: *** [.breakpad] Error 65
I followed the docs on https://github.com/TencentCloud/O266player
I tried build on macOS version of custom VLC, but it will not work.
Can you tell me why I got an error for this? Do I have to use previous version of macOS 10.15.6 and XCode 11.6, I don’t where is XCode old mirrors?
Also here's log file: https://pastebin.com/1gRZF1zz

FLUTTER - Error: No profiles for 'xxx' were found: Xcode couldn't find any iOS App

I am trying to run my flutter app on my ios simulator after including firebase_core in my project. It was working fine before including firebase_core: ^0.7.0. But now, my build is getting failed with the following errors.
Building com.xxx.xxx for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project:
CAV65P4ALS
Running pod install... 1.5s
Running Xcode build...
Xcode build done. 1.5s
Failed to build iOS app
Error output from Xcode build:
↳
objc[45442]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x205394188) and
?? (0x1145342b8). One of the two will be used. Which one is undefined.
objc[45442]: Class AMSupportURLSession is implemented in both ?? (0x2053941d8) and ??
(0x114534308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
↳
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
/Users/gauravdangi/Development/work/examples/xxx/ios/Pods/Pods.xcodeproj: warning: The iOS
deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
deployment target versions is 9.0 to 14.5.99. (in target 'path_provider' from project 'Pods')
/Users/gauravdangi/Development/work/examples/xxx/ios/Pods/Pods.xcodeproj: warning: The iOS
deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
deployment target versions is 9.0 to 14.5.99. (in target 'Flutter' from project 'Pods')
error: No profiles for 'com.xxx.xxx' were found: Xcode couldn't find any iOS App
Development provisioning profiles matching 'com.xxx.xxx'. Automatic signing is
disabled and unable to generate a profile. To enable automatic signing, pass
-allowProvisioningUpdates to xcodebuild. (in target 'Runner' from project 'Runner')
/Users/gauravdangi/Development/work/examples/xxx/ios/Pods/Pods.xcodeproj: warning: The iOS
deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
deployment target versions is 9.0 to 14.5.99. (in target 'shared_preferences' from project
'Pods')
/Users/gauravdangi/Development/work/examples/xxx/ios/Pods/Pods.xcodeproj: warning: The iOS
deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
deployment target versions is 9.0 to 14.5.99. (in target 'FMDB' from project 'Pods')
/Users/gauravdangi/Development/work/examples/xxx/ios/Pods/Pods.xcodeproj: warning: The iOS
deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
deployment target versions is 9.0 to 14.5.99. (in target 'image_picker' from project 'Pods')
I tried Signing in to get a Signing certificate in code and got the following error:
There are no devices registered in your account on the developer website. Plug in and select a device to have Xcode register it.
I have been trying to resolve this issue but no luck. Do I need a real iOS device just to run my app on the simulator?
Also, I have not purchased the apple developer account. Do I need to purchase it for testing my app on the simulator, because as far as I know, we need to purchase only if we decide to publish our app on the apple store.

project run in iOS simulator, but did not build project in react native

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.3.99. (in target 'Flipper' from project 'Pods')
** BUILD FAILED **
The following build commands failed:
Ld /Users/ramprasadsarkar/Library/Developer/Xcode/DerivedData/AwesomeProject-edxfscsdfjwsmicnfanfokvrokke/Build/Intermediates.noindex/AwesomeProject.build/Release-iphonesimulator/AwesomeProject.build/Objects-normal/arm64/Binary/AwesomeProject normal arm64
Please try the following.
If you are using terminal then set directory to your app folder.
or if you are using Vscode just open the terminal.
I hope you have already installed node.(did basic setup).
In terminal add follwing commands one by one, means use next commands only after completing 1 st command run.
npm install
cd ios
pod install
cd ..
npm run ios or npx react-native run-ios
Just check it works.

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.

Android Studio cannot run the Xcode Simulator

I am trying to simulate my Flutter app with the Xcode iPhone Simulator and I get this error. Before upgrading Android Studio and Xcode it was working fine.
Launching lib/main.dart on iPhone X in debug mode...
Starting Xcode build...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: Multiple commands produce '/Users/User/AndroidStudioProjects/my_app/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework':
1) Target 'Runner' has copy command from '/Users/User/AndroidStudioProjects/my_app/ios/Flutter/Flutter.framework' to '/Users/User/AndroidStudioProjects/my_app/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework'
2) That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
warning: ignoring duplicated output file: '/Users/User/AndroidStudioProjects/my_app/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework' (in target 'Runner')
note: Using new build systemnote: Planning buildnote: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone X.
Using:
macOS 10.13.6 (17G65)
Android Studio 3.2 Build #AI-181.5540.7.32.5014246, built on September 18, 2018
Xcode 10.0 (10A255)
Xcode Simulator 10.0 (SimulatorApp-869.5 CoreSimulator-572.2)
Should be fixed in master channel
https://github.com/flutter/flutter/issues/20685#issuecomment-421511890
Workarounds
There are two workarounds:
Option 1: Use the legacy build system . As noted by #gi097, open ios/Runner.xcworkspace, and change the build system to Legacy Build
System.
Option 2: Use the new Xcode 10 build system.
Open ios/Runner.xcworkspace
Select the Runner project in the project navigator sidebar.
In the main view, select the Runner target, then select the Build Phases tab.
Expand the Embed Frameworks phase and select Flutter.framework from the embedded frameworks list.
Click - to remove Flutter.framework from the list (be sure to keep App.framework).

Resources