Flutter/ fatal error: 'Flutter/Flutter.h' file not found - flutter

Hello i am having this error when I run my app.
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
In file included from /Users/daegilpyo/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.10/ios/Classes/FLTURLLauncherPlugin.m:7:
/Users/daegilpyo/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.10/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
5
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
Could not build the precompiled application for the device.
Error launching application on DAEGIL의 iPhone.
Exited (sigterm)
This is happening after I change the channel from stable to master..
I don`t know why I am having this error.
Plz let me know, I am waiting for you help..
this is flutter doctor - v
[✓] Flutter (Channel stable, 1.22.5, on macOS 11.0.1 20B50 darwin-x64, locale en-CA)
• Flutter version 1.22.5 at /Users/daegilpyo/Developer/flutter
• Framework revision 7891006299 (5 days ago), 2020-12-10 11:54:40 -0800
• Engine revision ae90085a84
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/daegilpyo/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/12.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.2, Build version 12B45b
• CocoaPods version 1.10.0
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/12.app/Contents
• Flutter plugin version 47.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (1 available)
• DAEGIL의 iPhone (mobile) • 00008020-0011243A2279002E • ios • iOS 14.2
• No issues found!

I had this problem a week ago, I removed the ios/Flutter folder from my directory and ran these commands and changed by deployment target to 11.0
-> flutter create
-> flutter pub cache repair
-> cd ios
-> pod init
-> pod install
After following these commands, I could build the iOS on the simulator and also create the archive.

The project absolute path don't have Space ' '.
My project path is '/Volumes/Macintosh Data/work/test/ios' then error, move to '/Users/macbook/Documents/workspace/test/ios' is OK.
if modify pubspec.yaml file dependencies, then redo:
rm -rf ./ios
flutter create -i swift .

Related

Flutter Jitsi meet IOS xcode build "PiPViewCoordinator?" error on Macbook M1 pro

I am getting this build error for IOS, while integrating jitsi_meet 4.0.0 in a flutter.
I am unable to run my application on simulator, as I am getting this PiPViewCoordinator error. Has anyone else faced issue before?
Xcode Build Error
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/gp/6s965rts4v58r8yxc4cxd5800000gn/T/flutter_tools.fVaWqL/flutter_ios_build_temp_dirc1d2Np/temporary_xcresult_bundle
Command CompileSwiftSources failed with a nonzero exit code
error: emit-module command failed with exit code 1 (use -v to see invocation)
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/jitsi_meet-4.0.0/ios/Classes/JitsiViewController.swift:8:41: error: cannot find type 'PiPViewCoordinator' in scope
fileprivate var pipViewCoordinator: PiPViewCoordinator?
^~~~~~~~~~~~~~~~~~
Command EmitSwiftModule failed with a nonzero exit code
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/jitsi_meet-4.0.0/ios/Classes/JitsiViewController.swift:8:41: error: cannot find type 'PiPViewCoordinator' in scope
fileprivate var pipViewCoordinator: PiPViewCoordinator?
^~~~~~~~~~~~~~~~~~
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/jitsi_meet-4.0.0/ios/Classes/JitsiViewController.swift:87:30: error: cannot find 'PiPViewCoordinator' in scope
pipViewCoordinator = PiPViewCoordinator(withView: jitsiMeetView)
^~~~~~~~~~~~~~~~~~
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/jitsi_meet-4.0.0/ios/Classes/JitsiViewController.swift:102:30: error: 'nil' requires a contextual type
pipViewCoordinator = nil
^
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/jitsi_meet-4.0.0/ios/Classes/JitsiViewController.swift:8:41: error: cannot find type 'PiPViewCoordinator' in scope
fileprivate var pipViewCoordinator: PiPViewCoordinator?
^~~~~~~~~~~~~~~~~~
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-2.3.4/ios/Classes/PathMonitorConnectivityProvider.swift:31:5: warning: result of call to 'ensurePathMonitor()' is unused
ensurePathMonitor()
^ ~~
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-2.3.4/ios/Classes/PathMonitorConnectivityProvider.swift:35:5: warning: result of call to 'ensurePathMonitor()' is unused
ensurePathMonitor()
^ ~~
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-2.3.4/ios/Classes/ReachabilityConnectivityProvider.swift:23:5: warning: result of call to 'ensureReachability()' is unused
ensureReachability()
^ ~~
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-2.3.4/ios/Classes/PathMonitorConnectivityProvider.swift:31:5: warning: result of call to 'ensurePathMonitor()' is unused
ensurePathMonitor()
^ ~~
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-2.3.4/ios/Classes/PathMonitorConnectivityProvider.swift:35:5: warning: result of call to 'ensurePathMonitor()' is unused
ensurePathMonitor()
^ ~~
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-2.3.4/ios/Classes/ReachabilityConnectivityProvider.swift:23:5: warning: result of call to 'ensureReachability()' is unused
ensureReachability()
^ ~~
Command CompileSwiftSources failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
/Users/tusharasodariya/git-projects/meet-app/ios/Pods/Pods.xcodeproj: 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 15.5.99. (in target 'ReachabilitySwift' from project 'Pods')
/Users/tusharasodariya/git-projects/meet-app/ios/Pods/Pods.xcodeproj: 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 15.5.99. (in target 'FMDB' from project 'Pods')
Result bundle written to path:
/var/folders/gp/6s965rts4v58r8yxc4cxd5800000gn/T/flutter_tools.fVaWqL/flutter_ios_build_temp_dirc1d2Np/temporary_xcresult_bundle
Uncategorized (Xcode): Command CompileSwiftSources failed with a nonzero exit code
Uncategorized (Xcode): Command EmitSwiftModule failed with a nonzero exit code
Swift Compiler Error (Xcode): Cannot find type 'PiPViewCoordinator' in scope
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/jitsi_meet-4.0.0/ios/Classes/JitsiViewController.swift:7:40
Swift Compiler Error (Xcode): Cannot find 'PiPViewCoordinator' in scope
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/jitsi_meet-4.0.0/ios/Classes/JitsiViewController.swift:86:29
Swift Compiler Error (Xcode): 'nil' requires a contextual type
/Users/tusharasodariya/.pub-cache/hosted/pub.dartlang.org/jitsi_meet-4.0.0/ios/Classes/JitsiViewController.swift:101:29
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro.
Flutter doctor -v
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-arm, locale en-IN)
• Flutter version 3.0.2 at /Users/tusharasodariya/fvm/versions/3.0.2
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cd41fdd495 (5 weeks ago), 2022-06-08 09:52:13 -0700
• Engine revision f15f824b57
• Dart version 2.17.3
• DevTools version 2.12.2
[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/tusharasodariya/Library/Android/sdk
• Platform android-32, build-tools 32.1.0-rc1
• ANDROID_HOME = /Users/tusharasodariya/Library/Android/sdk
• Java binary at: /Users/tusharasodariya/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8512546/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] Android Studio (version 2021.2)
• Android Studio at /Users/tusharasodariya/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8512546/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] VS Code (version 1.68.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.44.0
[✓] Connected device (4 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 12 (API 32) (emulator)
• iPhone 13 Pro (mobile) • 0FEE892A-E5DA-4405-BF13-B4103851E293 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.4 21F79 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 103.0.5060.114
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
Any solutions?
Add this line in Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
I managed to get it running again with the following steps:
flutter clean
pod repo update
cd ios
rm -rf Podfile.lock Pods/
cd ..
rm -rf pubspec.lock .packages .flutter-plungins
flutter pub cache repair
flutter packages get
cd ios
pod install
and finally starting the app from xcode

Flutter: Cant build app anymore since upgrade flutter and channel

Please help me!
The app was close to be finished and since I did run flutter upgrade to solve a bug I had to run:
flutter clean
flutter channel master
flutter upgrade
flutter run
and now its not starting anymore and the following code shows up..
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running Xcode build...
Xcode build done. 7,6s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/patrickmeyer/AndroidStudioProjects/my_fitness_challenge/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORPlatform.m:140:55: error: 'currentRadioAccessTechnology' is deprecated: first deprecated in iOS 12.0 [-Werror,-Wdeprecated-declarations]
networkCurrentRadioAccessTechnology = networkInfo.currentRadioAccessTechnology;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
serviceCurrentRadioAccessTechnology
In module 'CoreTelephony' imported from /Users/patrickmeyer/AndroidStudioProjects/my_fitness_challenge/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORPlatform.h:32:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.3.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTTelephonyNetworkInfo.h:154:61: note: 'currentRadioAccessTechnology' has been explicitly marked deprecated here
#property (nonatomic, readonly, retain, nullable) NSString* currentRadioAccessTechnology API_DEPRECATED_WITH_REPLACEMENT("serviceCurrentRadioAccessTechnology", ios(7.0, 12.0)) API_UNAVAILABLE(macos);
^
1 error generated.
PromisesObjC-crewhghtjvlepwbqltmbxkeqlsao
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
My flutter doctor looks good...
[✓] Flutter (Channel master, 1.26.0-2.0.pre.117, on Mac OS X 10.15.7 19H114
darwin-x64, locale de-DE)
• Flutter version 1.26.0-2.0.pre.117 at
/Users/patrickmeyer/Developer/flutter
• Framework revision 15c009b805 (17 hours ago), 2020-12-22 20:09:03 -0500
• Engine revision b7cd3f8e70
• Dart version 2.12.0 (build 2.12.0-173.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/patrickmeyer/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.10.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • 11ACA273-A0C3-405D-993A-A9AF9057887C • ios
• com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
• Chrome (web) • chrome •
web-javascript • Google Chrome 87.0.4280.88
• No issues found!
This could be because of compatible issues between flutter and Xcode version. Switch to the previous version and see if the error is there. Try other versions of flutter manually, using flutter version .
You can also run the program from Xcode, and try opening the emulator from there.
You can indeed use
flutter create .
to "repair" the current project to a limited degree.
If the ios/ or android/ folders are missing, they are created.
You can use this to switch native language Java/Kotlin, ObjC/Swift or to get the generated files updated to match newer Flutter versions by deleting the directories and running
flutter create . [options]
You need to re-apply previously made manual changes yourself though.

Exception: [!] Your app is using an unsupported Gradle project

I am trying to run my existing flutter application and I am getting this exception. How can I solve this issue?
Exception: [!] Your app is using an unsupported Gradle project. To fix this problem, create a new project by running flutter create -t app <app-directory> and then move the dart code, assets and pubspec.yaml to the new project.
Here are my Flutter doctor results:
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.4 19E287, locale en-EE)
• Flutter version 1.17.1 at /Users/varsik/Documents/flutterConfigurationFiles/flutter
• Framework revision f7a6a7906b (2 weeks ago), 2020-05-12 18:39:00 -0700
• Engine revision 6bc433c6b6
• Dart version 2.8.2
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/varsik/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.2.1, Build version 11B500
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (1 available)
• Pixel 3 XL • 8B8Y0VETV • android-arm64 • Android 10 (API 29)
• No issues found!
Maybe you removed a line from the
project/android/app/build.grade
Try adding this Piece of Code
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
after the line
apply plugin: 'com.android.application'
I resolve this issue by syncing project with gradle files.In android studio from menu open File option and click option sync project with gradle files.
Could you check this solution The project is using an unsupported version of Gradle
If you have the backup of your project than go to
project/android/app/build.grade
copy all the code and paste it to your project app/build.grade file.
Clean Project
Now Enjoy. Your error will not appear.
Thankyou.
For everyone landing here after making changes to the gradle for firebase or smth, it might seem stupid but check that the autoformat(if you have it enabled) didn't make funny things like putting spaces between "->" or "+=" turning them into "- >" or "+ ="

Flutter won't run on iOS after updating to 1.15.22-pre.18. Xcode build failing

I am writing a flutter app that was working fine up until tonight. It compiled and ran on both iOS simulator and iOS device. This evening, VSCode informed me there was a new version of Flutter so I upgraded. After the upgrade, Flutter Doctor told me to upgrade cocoapods, which I also did (after having to mess around with the Ruby 2.3 SDK since i'm on OSX 10.14.6. However, now my project won't build for either iOS simulator or iOS device.
I've tried 'flutter clean' but to no avail.
The error I get is:
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/lib/libSystem.tbd, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/lib/libSystem.tbd (4 slices)
ld: building for iOS, but linking in object file (/var/folders/fh/fs6qqn7x5_5c3bbq36ct4nj40000gn/T/debug_app-2d4374.o) built for iOS Simulator, file '/var/folders/fh/fs6qqn7x5_5c3bbq36ct4nj40000gn/T/debug_app-2d4374.o' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Command: xcrun clang -x c -arch x86_64 /var/folders/fh/fs6qqn7x5_5c3bbq36ct4nj40000gn/T/flutter_tools_stub_source.F8IoZt/debug_app.cc -dynamiclib -fembed-bitcode-marker -Xlinker -rpath -Xlinker #executable_path/Frameworks -Xlinker -rpath -Xlinker #loader_path/Frameworks -install_name #rpath/App.framework/App -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk -o /Users/paul/Documents/Development/flutter/scale_practice_app2/.dart_tool/flutter_build/eabd0dc878995215df4262cdd052ace8/simulator_framework
build failed.
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
It appears that your application still contains the default signing identifier.
Try replacing 'com.example' with your signing id in Xcode:
open ios/Runner.xcworkspace
Error launching application on Paul's iPhone XR.**
Here is the output of 'flutter doctor -v':
**[✓] Flutter (Channel master, v1.15.22-pre.18, on Mac OS X 10.14.6 18G3020, locale en-GB)
• Flutter version 1.15.22-pre.18 at /Users/paul/Apps/flutter
• Framework revision 8bff33e497 (2 hours ago), 2020-03-13 17:26:02 -0700
• Engine revision 9226a3881e
• Dart version 2.8.0 (build 2.8.0-dev.14.0 a303769fad)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/paul/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.9.1
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 43.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.43.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.8.1
[✓] Connected device (3 available)
• Paul's iPhone XR • 00008020-001B64482ED8003A • ios • iOS 13.3.1
• iPhone XR • 154A94BD-01CF-40B0-B25E-88073359CA3E • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
• macOS • macOS • darwin-x64 • Mac OS X 10.14.6 18G3020
• No issues found!
I followed some Google suggestions to re-create my pod files etc but that hasn't fixed it. I have also created a fresh Flutter project, copied in my .dart and assets files but the new project still won't build, with the same errors.
Any help would be greatly appreciated.
Complete uninstall and re-install of cocoapods, flutter, and xcode (including manually clearing out all preferences) worked.

CocoaPods could not find compatible versions for "edge_detection" building flutter iOS app

After trying to build a flutter app for iOS I got the following error:
$ flutter build ios --no-codesign
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.example.mmpgui for device (ios-release)...
Running pod install... 0,8s
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
...
[!] CocoaPods could not find compatible versions for pod "edge_detection":
In Podfile:
edge_detection (from `.symlinks/plugins/edge_detection/ios`)
Specs satisfying the `edge_detection (from `.symlinks/plugins/edge_detection/ios`)` dependency were found, but they required a higher
minimum deployment target.
...
Error output from CocoaPods:
[!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a
platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
First, I tried to follow the advice in the link and update the Pod file (ios/Pods/Pod)
by setting the platform version to 10.0
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
Now it compiled but I got lots of compilation errors:
$ flutter build ios --no-codesign
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.example.mmpgui for device (ios-release)...
Running pod install... 38.3s
Running Xcode build...
Xcode build done. 665.5s
Failed to build iOS app
Error output from Xcode build:
** BUILD FAILED **
...
error: the following command failed with exit code 0 but produced no further output
CompileC
/Users/administrator/Library/Developer/Xcode/DerivedData/Runner-gjlpspwywczpboarjfvvefatdons/Build/Intermediates.noindex/Pods.build/Release-iph
oneos/camera.build/Objects-normal/arm64/CameraPlugin.o
/Users/administrator/development/flutter/.pub-cache/hosted/pub.dartlang.org/camera-0.5.7+3/ios/Classes/CameraPlugin.m normal arm64 objective-c
com.apple.compilers.llvm.clang.1_0.compiler
/Users/administrator/development/flutter/.pub-cache/hosted/pub.dartlang.org/edge_detection-1.0.4/ios/Classes/HomeViewController.swift:29:49:
error: value of optional type 'UIImage?' must be unwrapped to a value of type 'UIImage'
var imagePath = saveImage(image:results.scannedImage)
^
/Users/administrator/development/flutter/.pub-cache/hosted/pub.dartlang.org/edge_detection-1.0.4/ios/Classes/HomeViewController.swift:29:49:
note: coalesce using '??' to provide a default when the optional value contains 'nil'
var imagePath = saveImage(image:results.scannedImage)
^
?? <#default value#>
/Users/administrator/development/flutter/.pub-cache/hosted/pub.dartlang.org/edge_detection-1.0.4/ios/Classes/HomeViewController.swift:29:49:
note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
var imagePath = saveImage(image:results.scannedImage)
Flutter doctor showed the following:
$ flutter doctor -v
[✓] Flutter (Channel master, v1.15.3-pre.37, on Mac OS X 10.14.6 18G3020, locale de-AT)
• Flutter version 1.15.3-pre.37 at /Users/sebastiankubeck/Software/flutter
• Framework revision 6dc3bfaa98 (2 days ago), 2020-02-07 18:28:02 -0800
• Engine revision 6158f03ef5
• Dart version 2.8.0 (build 2.8.0-dev.8.0 514a8d4c84)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/sebastiankubeck/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.8.4
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 40.2.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.41.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.8.0
[✓] Connected device (3 available)
• macOS • macOS • darwin-x64 • Mac OS X 10.14.6 18G3020
• Chrome • chrome • web-javascript • Google Chrome 80.0.3987.87
• Web Server • web-server • web-javascript • Flutter Tools
• No issues found!
The project was created with an older version of flutter and it seems that the ios directory is not updated correctly. Alternatively, it could be that my CocoaPods version is too new, so I tried 1.7.5, which wasn't successful either.