I just upgraded my Flutter version to 1.22.0. After upgrading and making some changes for Firebase my Android app started working, but I am unable to build and run the iOS app on emulator or on physical device.
The terminal shows the following errors when I try to run the app in the emulator or physical device. The emulator runs on iOS 14 and the physical device is on 14.0.1.
Emulator: ld: symbol(s) not found for architecture x86_64
Actual device: ld: symbol(s) not found for architecture arm64
I also executed the following commands but still not working...
flutter clean && \
rm ios/Podfile ios/Podfile.lock pubspec.lock && \
rm -rf ios/Pods ios/Runner.xcworkspace && \
flutter run
Flutter Doctor:
[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.7 19H2, locale en-US)
• Flutter version 1.22.0 at /Volumes/demouser/Flutter/FlutterSDK/flutter
• Framework revision d408d302e2 (7 days ago), 2020-09-29 11:49:17 -0700
• Engine revision 5babba6c4d
• Dart version 2.10.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/demouserdemouser/Library/Android/sdk
• 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_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0.1, Build version 12A7300
• CocoaPods version 1.9.3
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.49.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.14.1
[✓] Connected device (1 available)
• AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• No issues found!
pubspec.yaml
name: demo
description: demo
version: 1.0.0+1
environment:
sdk: ">=2.5.2 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
firebase_auth: ^0.18.1+1
cloud_firestore: ^0.14.1+2
firebase_messaging: ^6.0.16
firebase_storage: ^5.0.0-dev.2
firebase_core: ^0.5.0
firebase_admob: ^0.10.0+1
intl_translation: ^0.17.10+1
http: ^0.12.2
xml: ^4.5.1
shared_preferences: ^0.5.12
flutter_staggered_grid_view: ^0.3.0
flutter_signin_button: ^1.0.0
image_picker: ^0.6.7+11
mlkit: ^0.15.1
cached_network_image: ^2.3.2+1
permission_handler: ^5.0.1+1
url_launcher: ^5.7.2
share: ^0.6.5+2
simple_connectivity: ^0.1.1
us_states: ^1.0.3
cloud_functions: ^0.6.0+1
email_validator: ^1.0.4
package_info: ^0.4.3
device_info: ^0.4.2+8
expandable: ^4.1.4
launch_review: ^2.0.0
xml2json: ^4.4.0
purchases_flutter: ^1.3.1
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.7.5
flutter_icons:
image_path: "icon/new_icon.png"
android: false
ios: true
Terminal's output:
> Launching lib/main.dart on physical iPhone in debug mode...
> Automatically signing iOS for device deployment using specified
> development team in Xcode project: 5ABCDEFG9 Running Xcode build...
> Xcode build done. 118.3s
> Failed to build iOS app Error output from Xcode build: ↳
> 2020-10-06 10:59:58.676 xcodebuild[7528:47880] DTDeviceKit: deviceType from a578d1d6cb0d414525f7dc4c6cee was NULL
> 2020-10-06 10:59:58.778 xcodebuild[7528:47881] DTDeviceKit: deviceType from a578d1d6cb0d414525f7dc4c6cee was NULL
> 2020-10-06 10:59:58.778 xcodebuild[7528:47881] DTDeviceKit: deviceType from a578d1d6cb0d414525f7dc4c6cee was NULL
> ** BUILD FAILED **
Xcode's output:
↳
/Volumes/driveD/Flutter/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.2/ios/Classes/FLTURLLauncherPlugin.m:153:57: warning: 'keyWindow' is deprecated: first deprecated in iOS 13.0 - Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes [-Wdeprecated-declarations]
.keyWindow.rootViewController];
^
In module 'UIKit' imported from /Volumes/driveD/projects/new/demo/ios/Pods/Target Support Files/url_launcher/url_launcher-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:134:51: note: 'keyWindow' has been explicitly marked deprecated here
#property(nullable, nonatomic,readonly) UIWindow *keyWindow API_DEPRECATED("Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes", ios(2.0, 13.0));
-------
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
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 physical’s iPhone.
It looks like this problem is coming due to RevenueCat API. When I comment out the import purchases_flutter in the pubspec.yaml file then I am able to install the app but it crashes at startup saying connection lost.
rm -f ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings fixed the issue for me
There are a couple of different answers for this here on stackoverflow. If I am not mistaken, the switch to channel "stable" solved the issue for me, last time.
I have a similar erro
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
I also having problems after I upgrade to 1.22.0, I had to also upgrade the flutterFire package, and that seems to be my problem.
the versions that I'm using on pubspec.yaml:
firebase_core: ^0.5.0
cloud_firestore: ^0.14.1+2
firebase_auth: ^0.18.1+1
firebase_analytics: ^5.0.0
cloud_functions: ^0.6.0+1
firebase_storage: ^4.0.1
firebase_crashlytics: ^0.1.0+3
firebase_messaging: ^7.0.2
when trying to run it says to update the CocoaPods spec by running pod repo update, done that, but still got the same error, then running pod install or pod update got the error
tried the commands: pod install --repo-update and pod update Firebase/Storage but still got the same error message
Just remove old flutter installed folder like [.cache] / [pub-cache] because you might have upgraded the flutter version but iOStools and other tools are pointing to older version and it causes these architecture issue.
Finally after doing lot of changes, I found out that the culprit was the purchases_flutter: ^1.3.1 package.
When I remove the package from my yaml file then it starts working. There is a bug already opened for it https://github.com/RevenueCat/purchases-flutter/issues/120.
Thank you every one for your time and help.
Related
i'm implementing a youtube player in my flutter app and when i run it the build will fail and it throws deprication error.
i'm currently using macbook mid 2012, so i can not use latest version of x code. my current version is at Version 12.4 . so in order to use flutter for ios i'm using flutter 2.5.
so now when i try to use youtube player it doesn't build the app.
Xcode build done. 43.0s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/InAppBrowser/InAppBrowserWebViewController.swift:562:13: warning: setter for 'statusBarStyle'
was deprecated in iOS 9.0: Use -[UIViewController preferredStatusBarStyle]
UIApplication.shared.statusBarStyle = UIStatusBarStyle(rawValue: previousStatusBarStyle)!
^
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/InAppWebView/InAppWebView.swift:521:31: warning: 'mediaPlaybackRequiresUserAction' was
deprecated in iOS 9.0
configuration.mediaPlaybackRequiresUserAction =
options.mediaPlaybackRequiresUserGesture
^
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/InAppWebView/InAppWebView.swift:932:31: warning: 'mediaPlaybackRequiresUserAction' was
deprecated in iOS 9.0
configuration.mediaPlaybackRequiresUserAction =
newOptions.mediaPlaybackRequiresUserGesture
^
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/InAppWebView/InAppWebViewOptions.swift:103:81: warning: 'mediaPlaybackRequiresUserAction' was
deprecated in iOS 9.0
realOptions["mediaPlaybackRequiresUserGesture"] =
configuration.mediaPlaybackRequiresUserAction
^
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/MyCookieManager.swift:260:44: error: cannot call value of non-function type 'String?'
domain = domainUrl.host()
^ ~~
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/MyCookieManager.swift:294:44: error: cannot call value of non-function type 'String?'
domain = domainUrl.host()
^ ~~
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/Types/URLCredential.swift:14:25: warning: comparing non-optional value of type '[Any]' to
'nil' always returns true
if certificates != nil {
~~~~~~~~~~~~ ^ ~~~
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/Util.swift:216:21: warning: immutable value 'j' was never used; consider replacing with '_'
or removing it
for j in ipv6.count...8 {
^
_
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/InAppBrowser/InAppBrowserWebViewController.swift:562:13: warning: setter for 'statusBarStyle'
was deprecated in iOS 9.0: Use -[UIViewController preferredStatusBarStyle]
UIApplication.shared.statusBarStyle = UIStatusBarStyle(rawValue: previousStatusBarStyle)!
^
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/InAppWebView/InAppWebView.swift:521:31: warning: 'mediaPlaybackRequiresUserAction' was
deprecated in iOS 9.0
configuration.mediaPlaybackRequiresUserAction =
options.mediaPlaybackRequiresUserGesture
^
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/InAppWebView/InAppWebView.swift:932:31: warning: 'mediaPlaybackRequiresUserAction' was
deprecated in iOS 9.0
configuration.mediaPlaybackRequiresUserAction =
newOptions.mediaPlaybackRequiresUserGesture
^
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/InAppWebView/InAppWebViewOptions.swift:103:81: warning: 'mediaPlaybackRequiresUserAction' was
deprecated in iOS 9.0
realOptions["mediaPlaybackRequiresUserGesture"] =
configuration.mediaPlaybackRequiresUserAction
^
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/MyCookieManager.swift:260:44: error: cannot call value of non-function type 'String?'
domain = domainUrl.host()
^ ~~
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/MyCookieManager.swift:294:44: error: cannot call value of non-function type 'String?'
domain = domainUrl.host()
^ ~~
/Users/mobix/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.5.0+2/ios/
Classes/Types/URLCredential.swift:14:25: warning: comparing non-optional value of type '[Any]' to
'nil' always returns true
if certificates != nil {
~~~~~~~~~~~~ ^ ~~~
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
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: Capabilities for Signing & Capabilities may not function correctly because its entitlements
use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in
target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
the package i'm using is youtube_player_flutter: ^8.0.0. the message indicates to in app web view.
if #available(iOS 10.0, *) {
configuration.ignoresViewportScaleLimits = options.ignoresViewportScaleLimits
var dataDetectorTypes = WKDataDetectorTypes.init(rawValue: 0)
for type in options.dataDetectorTypes {
let dataDetectorType = Util.getDataDetectorType(type: type)
dataDetectorTypes = WKDataDetectorTypes(rawValue: dataDetectorTypes.rawValue | dataDetectorType.rawValue)
}
configuration.dataDetectorTypes = dataDetectorTypes
configuration.mediaTypesRequiringUserActionForPlayback = options.mediaPlaybackRequiresUserGesture ? .all : []
} else {
// Fallback on earlier versions
configuration.mediaPlaybackRequiresUserAction = options.mediaPlaybackRequiresUserGesture
}
and in app web view options
if #available(iOS 10.0, *) {
realOptions["mediaPlaybackRequiresUserGesture"] = configuration.mediaTypesRequiringUserActionForPlayback == .all
realOptions["ignoresViewportScaleLimits"] = configuration.ignoresViewportScaleLimits
realOptions["dataDetectorTypes"] = Util.getDataDetectorTypeString(type: configuration.dataDetectorTypes)
} else {
realOptions["mediaPlaybackRequiresUserGesture"] = configuration.mediaPlaybackRequiresUserAction
}
i uncommented the platform: ios, '9.0' and replace at the end with
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['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
replacing these worked the other error (which is not included in this question) but it doesn't seem to work for these. how can i fix this? i haven't used xcode before so.
my flutter doctor
[✓] Flutter (Channel stable, 2.5.3, on Mac OS X 10.15.7 19H15 darwin-x64, locale en-ET)
• Flutter version 2.5.3 at /Users/mobix/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (1 year ago), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/mobix/Library/Android/sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• 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.10+0-b96-7281165)
[✓] VS Code (version 1.72.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.50.0
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • 63C29DC5-CD5A-411A-9BAA-C55FA3ED65B3 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome
106.0.5249.119
• No issues found!
thanks in advance
I'm facing this issue since last 2 days.
You don't need to download the X-code-14 version.
just open X-code and run the project it's showing an error then click on the
error and tap fix.
If you cannot have update the Xcode just replace every part of code inside ios/Classes/MyCookieManager.swift:
if #available(iOS 16.0, *) {
domain = domainUrl.host()
} else {
domain = domainUrl.host
}
with
domain = domainUrl.host
You just need to update your xcode version to 14 and that's all :)
https://github.com/pichillilorenzo/flutter_inappwebview/issues/1369
Here is the reference.
React Native application build was working recently, But now one critical package that I'm using as a part of the essential feature is started throwing errors on IOS build.
Following are the build error details, and after some search added a swift empty file to create a bridge but the results are still the same.
** BUILD FAILED **
The following build commands failed:
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'react-native-track-player' from project 'Pods')
CompileSwift normal x86_64 /Users/c0d3/Projects/Zeefa/gem-mobile-app/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/SwiftAudio/Classes/NowPlayingInfoController/NowPlayingInfoProperty.swift (in target 'react-native-track-player' from project 'Pods')
CompileSwift normal x86_64 /Users/c0d3/Projects/Zeefa/gem-mobile-app/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift (in target 'react-native-track-player' from project 'Pods')
CompileSwift normal x86_64 /Users/c0d3/Projects/Zeefa/gem-mobile-app/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/SwiftAudio/Classes/QueuedAudioPlayer.swift (in target 'react-native-track-player' from project 'Pods')
(4 failures)
Given is the react-native info response
System:
OS: macOS 12.2.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU # 2.60GHz
Memory: 162.65 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node
Yarn: Not Found
npm: 6.14.12 - ~/.nvm/versions/node/v14.16.1/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 17.0.1 - /usr/bin/javac
npmPackages:
#react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
The issue is with XCODE 13, till now I didn't get any workaround but when downgrading XCODE back to 12 and doing the same build it is working as expected.
For anyone stuck with the same issue, Until getting a proper solution I would suggest getting a MAC machine in AWS so that you can switch to any version of the OS and do the build. Make sure to delete or STOP the machine once the build is done as it is too costly.
https://aws.amazon.com/pm/ec2-mac
I cannot run Flutter for iOS simulator, I use iPhone XS Simulator. There is nothing issue when I run with Android Emulator.
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
While building module 'Flutter' imported from /Users/user/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity-0.4.8+1/ios/Classes/FLTConnectivityPlugin.h:5:
In file included from <module-includes>:1:
/Users/user/AndroidStudioProjects/app/ios/Pods/../Flutter/Flutter.framework/Headers/Flutter.h:54:10: fatal error: 'FlutterAppDelegate.h' file not found
#include "FlutterAppDelegate.h"
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/user/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity-0.4.8+1/ios/Classes/FLTConnectivityPlugin.m:5:
/Users/user/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity-0.4.8+1/ios/Classes/FLTConnectivityPlugin.h:5:9: fatal error: could not build module 'Flutter'
#import <Flutter/Flutter.h>
~~~~~~~^
2 errors generated.
Could not build the application for the simulator.
Error launching application on iPhone Xs.
This is flutter doctor detail.
[✓] Flutter (Channel beta, v1.14.6, on Mac OS X 10.14.6 18G87, locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.43.2)
[✓] Connected device (1 available)
Anyone can help me? thank you...
I'm having issues trying to add cloud_firestore dependence to any project I create. I've created fresh project which builds and runs in iOS (I haven't installed an android simulator yet). But when I add the cloud_firestore dependency line into the pubspec.yaml, get the dependency, and then try and build, I get the following error:
Launching lib/main.dart on iPhone X in debug mode...
Xcode build done. 2.3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Flutter/hello_world/hello_world/ios/Pods/leveldb-library/table/block.cc:13:10:
fatal error: 'util/coding.h' file not found
#include "util/coding.h"
^~~~~~~~~~~~~~~
1 error generated.
Could not build the application for the simulator.
My pubspec.xaml file:
name: hello_world
description: A new Flutter project.
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cloud_firestore:
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
I am working on a flutter project which uses local database. For local database I am using sqflite plugin https://pub.dartlang.org/packages/sqflite. My application is working fine without installing sqflite. However, as soon as I install sqflite. It stops running for ios. I am receiving below errors.
import
1 error generated.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
In file included from /Users/user/Documents/DEVELOPMENT/Flutter_Dev/Flutter_project/FlutterDatabaseSQFLite-master/ios/Runner/AppDelegate.m:1:
/Users/user/Documents/DEVELOPMENT/Flutter_Dev/Flutter_project/FlutterDatabaseSQFLite-master/ios/Runner/AppDelegate.h:2:9: fatal error: 'Flutter/Flutter.h' file not found
import
^~~~~~~~~~~~~~~~~~~
1 error generated.
/Users/user/Documents/DEVELOPMENT/Flutter_Dev/Flutter_project/FlutterDatabaseSQFLite-master/ios/Runner/main.m:2:9: fatal error: 'Flutter/Flutter.h' file not found
import
^~~~~~~~~~~~~~~~~~~
1 error generated.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
ld: file not found: /Users/user/Library/Developer/Xcode/DerivedData/Runner-ctqhqjwcexxoquevqxydctpmagio/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/AppDelegate.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Could not build the application for the simulator.
Error launching application on iPhone 8 Plus.
. And the strange thing is after this error, if I create new project of flutter it gives me below error.
/Users/user/Documents/DEVELOPMENT/Flutter_Dev/Flutter_project/local_db/ios/Runner/AppDelegate.h:1:9: fatal error: 'Flutter/Flutter.h' file not found import ^~~~~~~~~~~~~~~~~~~ 1 error generated. === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug === /Users/user/Documents/DEVELOPMENT/Flutter_Dev/Flutter_project/local_db/ios/Runner/main.m:1:9: fatal error: 'Flutter/Flutter.h' file not found #import ^~~~~~~~~~~~~~~~~~~ 1 error generated. === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug === In file included from /Users/user/Documents/DEVELOPMENT/Flutter_Dev/Flutter_project/local_db/ios/Runner/GeneratedPluginRegistrant.m:5: /Users/user/Documents/DEVELOPMENT/Flutter_Dev/Flutter_project/local_db/ios/Runner/GeneratedPluginRegistrant.h:8:9: fatal error: 'Flutter/Flutter.h' file not found #import ^~~~~~~~~~~~~~~~~~~ 1 error generated. === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug === ld: file not found: /Users/user/Library/Developer/Xcode/DerivedData/Runner-eqhuhphzvosrgvdilnpudqzvakju/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/AppDelegate.o clang: error: linker command failed with exit code 1 (use -v to see invocation) Could not build the application for the simulator. Error launching application on iPhone 8 Plus.
And the application stops working. Here is the output of flutter doctor command.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v0.8.7-pre.6, on Mac OS X 10.14 18A384a, locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.2)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
[✓] Android Studio (version 3.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.27.2)
[✓] Connected devices (1 available)
Please help me in this. Thanks in advance.
Try changing the Flutter channel from Master to Beta
In the terminal open the flutter directory and set the export path the type
flutter channel beta