Flutter error building for iOS "ld: framework not found" - ios

I've been working for a few weeks on a Flutter app which I run on Android and iOS. It worked well until some days ago I upgraded the flutter version and some package dependencies, and it suddenly stopped building for iOS.
There have been multiple issues I have managed to solve, but I can figure out this one. Now, each time I try to build the iOS app I get:
ld: framework not found package_info_plus
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've tried cleaning the project with flutter clean and building again after performing a pub get, but it doesn't solve the issue. I don't depend directly on package_info_plus, but there is one of my packages which does.
I've also tried adding package_info_plus to my pub spec, but then I get the same error again with the package path_provider, which I'm already using.
I have search and try every solution, but nothing works. Could somebody help me?
In case it helps, here you have my pubspec.yaml:
name: app name
description: App description
version: 2.0.0+12
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
shared_preferences: ^2.0.7
provider: ^6.0.0
http: ^0.13.3
device_info: ^2.0.2
progress_state_button: ^1.0.3
uuid: ^3.0.4
universal_platform: ^1.0.0+1
drift: ^1.0.0
sqlcipher_flutter_libs: ^0.5.0
path_provider: ^2.0.3
path: ^1.8.0
flutter_local_notifications: ^9.1.4
flutter_native_timezone: ^2.0.0
progress_dialog: ^1.2.4
url_launcher: ^6.0.10
flutter_slidable: ^1.1.0
tuple: ^2.0.0
get_it: ^7.2.0
local_auth: ^1.1.7
date_util: ^0.1.4
date_picker_timeline: ^1.2.3
intl: ^0.17.0
file_picker_cross: ^4.4.2
share_extend: ^2.0.0
flutter_svg: ^0.22.0
dev_dependencies:
flutter_test:
sdk: flutter
drift_dev: ^1.0.0
build_runner: ^2.0.4
flutter:
uses-material-design: true
And the output of flutter doctor -v:
[✓] Flutter (Channel stable, 2.5.3, on macOS 12.0.1 21A559 darwin-arm, locale en-ES)
• Flutter version 2.5.3 at /Users/javierd/Android/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (7 weeks 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 31.0.0)
• Android SDK at /Users/javierd/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Users/javierd/Downloads/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 13.1, Build version 13A1030d
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Users/javierd/Downloads/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-7249189)
[✓] Connected device (3 available)
• iPhone 13 (mobile) • 8957D248-FB8E-4114-A3C1-E5DCF64FD39E • ios •
com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.0.1
21A559 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome
96.0.4664.55
• No issues found!
Thanks a lot in advance!

for me downgrade the package from the last version

Related

CocoaPods could not find compatible versions for pod "Flutter": In Podfile: Flutter (from `Flutter`)

After upgrade to flutter 3.1, I can build and run for android but I got the following error for ios. May I know what is the reason for this issue?
Aungs-MBP:ios aungmyooo$ pod install
Analyzing dependencies
firebase_analytics: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
Warning: firebase_app_id_file.json file does not exist. This may cause issues in upload-symbols. If this error is unexpected, try running flutterfire configure again.
firebase_crashlytics: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "Flutter":
In Podfile:
Flutter (from `Flutter`)
Specs satisfying the `Flutter (from `Flutter`)` dependency were found, but they required a higher minimum deployment target.
[✓] Flutter (Channel master, 3.1.0-0.0.pre.1279, on macOS 12.4 21F79
darwin-x64, locale en-GB)
• Flutter version 3.1.0-0.0.pre.1279 at /Users/aungmyooo/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ddeb0b99c5 (18 hours ago), 2022-06-16 13:53:23 -0700
• Engine revision f8c0dc87bc
• Dart version 2.18.0 (build 2.18.0-189.0.dev)
• DevTools version 2.14.0
[✓] Android toolchain - develop for Android devices (Android SDK
version 31.0.0)
• Android SDK at /Users/aungmyooo/Library/Android/sdk
• Platform android-32, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] 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.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 11.0.11+0-b60-7590822)
[✓] VS Code (version 1.68.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.42.0
[✓] Connected device (3 available)
• SM N975F (mobile) • RF8M82Y3K9A • android-arm64 • Android 12 (API 31)
• macOS (desktop) • macos • darwin-x64 • macOS 12.4 21F79 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 102.0.5005.115
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
In the ios folder -> PodFile. You will see that the version of platform is 9 and is commented. Please uncomment it and set the version to 11.0
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'

Android studio "flutter run" working but Run button not working

When I click the android studio run button, I get the following error and no matter how many methods I tried, it doesn't work, but when I type the "flutter run" command, it works.
Warning: CocoaPods not installed. Skipping pod install.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
Exception: CocoaPods not installed or not in valid state.
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-x64, locale
tr-TR)
• Flutter version 2.8.1 at /Users/aksoyhlc/flutter/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version
32.1.0-rc1)
• Android SDK at /Users/aksoyhlc/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.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.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 11.0.11+0-b60-7590822)
[✓] Connected device (2 available)
• Aksoyhlc iPhone’u (mobile) •----- •
ios • iOS 14.7.1 18G82
• Chrome (web) • chrome •
web-javascript • Google Chrome 97.0.4692.99
I had this issue sometimes, the only way i found was to uninstall cocoapods, reinstall it and relaunch the IDE. Check the steps todo here: https://stackoverflow.com/a/64000509/9043877

How to upgrade your flutter project (app) to the latest flutter version after null safety?

I want to upgrade my project which is on Flutter 2.0 to the latest version of flutter (2.5).
I have already seen this question which is most relevant.
How do I upgrade an existing Flutter app?
In my Mac, I have Flutter upgraded to 2.5. You can see the output of flutter doctor -v below:
[✓] Flutter (Channel stable, 2.5.0, on macOS 11.5.2 20G95 darwin-arm, locale
en-PK)
• Flutter version 2.5.0 at /Users/ahmad/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4cc385b4b8 (9 days ago), 2021-09-07 23:01:49 -0700
• Engine revision f0826da7ef
• Dart version 2.14.0
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/ahmad/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.11.0
[✓] 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-7249189)
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • 57868E1C-4871-4185-A797-383121736AB8 • ios
• com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
• Chrome (web) • chrome •
web-javascript • Google Chrome 93.0.4577.82
• No issues found!
I have searched over the internet about it. Mostly, I see two things, either how to upgrade to null-safety (which means from earlier versions to 2.0) or how to upgrade Flutter sdk in your system.
I have tried running flutter upgrade command which says I'm up-to-date.
I have also tried running flutter pub upgrade.
Both do not change the version of flutter in the pubspec.lock file inside my project which says at the end of file:
sdks:
dart: ">=2.14.0 <3.0.0"
flutter: ">=2.0.0"
Please guide me how can I upgrade my project to the latest version.
Thanks in advance :)
The Flutter project will have the same version as your system does. If you have the latest Flutter version on your system, then the app built from that system will have the latest version.
For example, if your system has Flutter 2.8 (latest while answering) and you build an app through it, your app is based on 2.8.
You're using flutter: >=2.0.0 which basically tells your app to use 2.0.0. Usually using the flutter sdk constraint is only used in plugins. It's okay to leave this out, if you remove flutter: >=2.0.0 it will automatically use your SDK version

Flutter stuck on running xcode build not build

I'm using beta channel, Android and Web version is currently running but when I run on IOS it stuck on Running Xcode Build. I waited 20 minutes and nothing happend.
What I tried:
I changed beta channel to master, clean and upgrade
I deleted Xcode/Derived Data
Xcode Updated latest version
Switched old build system
These didn't work.
Flutter doctor -v output:
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• 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)
[✓] VS Code (version 1.53.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.19.0
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • 025247E3-C767-4FE2-81DB-6F10C7D45D5B • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.146
• No issues found!
pupspec.yaml
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: '>=2.7.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
#State Managment and Many Thing
get: ^3.24.0
#Firebase Packages
firebase_core: '0.7.0'
firebase_auth: '^0.20.0+1'
firebase_storage: ^7.0.0
cloud_firestore: '^0.16.0'
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true

Cocoapods seems to install wrong pod version

Cocoapods seems to install a wrong pod version.
Here is an example line from my pubspec.yaml:
webview_flutter: ^1.0.7
When running pod install, this is what I see:
Installing webview_flutter (0.0.1)
In my flutter/.pub_cache/hosted/pub.dartlang.org/ I see the only the following versions:
webview_flutter-0.3.24
webview_flutter-1.0.7
When building with XCode, I get a few warnings from webview_flutter that point to the correct 1.0.7 version, so it seems the right pod is being used despite the cocoapods output. However, this is really confusing. Any thoughts how to solve this would be greatly appreciated.
I have tried re-installing cocoapods, deintegrating pods and building again, cleaning, updating pod repo, deleted Podfile.lock etc usual suspects.
Here's my environment:
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.7 19H15 darwin-x64, locale en-FI)
• Flutter version 1.22.5 at /Users/ilonamooney/Documents/dev/flutter
• Framework revision 7891006299 (10 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 30.0.2)
• Android SDK at /Users/ilonamooney/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/ilonamooney/Library/Android/sdk
• 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
[!] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] Connected device (1 available)
• Ilona’s iPhone (mobile) • a12e6e165529c7307dfdb723f37e02f3901f17d0 • ios • iOS 14.2```

Resources