Home > Blockchain >  Flutter 2.5.1 - Could not build the application for the simulator
Flutter 2.5.1 - Could not build the application for the simulator

Time:09-21

I migrated my project from Flutter 1 to 2.5.1, and I countered this error

Result:

In file included from
/Users/Jeremy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.11/ios/Classes/FLT
URLLauncherPlugin.m:7:
/Users/Jeremy/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.11/ios/Classes/FLT
URLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found

#import <Flutter/Flutter.h>
        ^~~~~~~~~~~~~~~~~~~

1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
note: Removed stale file
'/Users/Jeremy/Library/Developer/Xcode/DerivedData/Runner-bkrpcbgqxwmjkngadaeegdgrlbut/Build/Products/
Debug-iphonesimulator/share/share.framework'

note: Removed stale file
'/Users/Jeremy/Library/Developer/Xcode/DerivedData/Runner-bkrpcbgqxwmjkngadaeegdgrlbut/Build/Products/
Debug-iphonesimulator/flutter_keyboard_visibility/flutter_keyboard_visibility.framework'

note: Removed stale file
'/Users/Jeremy/Library/Developer/Xcode/DerivedData/Runner-bkrpcbgqxwmjkngadaeegdgrlbut/Build/Products/
Debug-iphonesimulator/sqflite/sqflite.framework'

note: Removed stale file
'/Users/Jeremy/Library/Developer/Xcode/DerivedData/Runner-bkrpcbgqxwmjkngadaeegdgrlbut/Build/Products/
Debug-iphonesimulator/geocoding/geocoding.framework'

note: Removed stale file
'/Users/Jeremy/Library/Developer/Xcode/DerivedData/Runner-bkrpcbgqxwmjkngadaeegdgrlbut/Build/Products/
Debug-iphonesimulator/package_info_plus/package_info_plus.framework'

note: Removed stale file
'/Users/Jeremy/Library/Developer/Xcode/DerivedData/Runner-bkrpcbgqxwmjkngadaeegdgrlbut/Build/Products/
Debug-iphonesimulator/google_sign_in/google_sign_in.framework'

note: Removed stale file
'/Users/Jeremy/Library/Developer/Xcode/DerivedData/Runner-bkrpcbgqxwmjkngadaeegdgrlbut/Build/Products/
Debug-iphonesimulator/connectivity_plus/connectivity_plus.framework'

note: Removed stale file
'/Users/Jeremy/Library/Developer/Xcode/DerivedData/Runner-bkrpcbgqxwmjkngadaeegdgrlbut/Build/Products/
Debug-iphonesimulator/Runner.app'

note: Removed stale file
'/Users/Jeremy/Library/Developer/Xcode/DerivedData/Runner-bkrpcbgqxwmjkngadaeegdgrlbut/Build/Products/
Debug-iphonesimulator/geolocator_apple/geolocator_apple.framework'

note: Removed stale file
'/Users/Jeremy/Library/Developer/Xcode/DerivedData/Runner-bkrpcbgqxwmjkngadaeegdgrlbut/Build/Products/
Debug-iphonesimulator/google_maps_flutter/google_maps_flutter.framework'

All of my package/plugins are updated to nullsafety version, and I also did delete the ios folder and created a new one using flutter create . and i still get the same result.

CodePudding user response:

Remove the plugin from the pubspec.yaml and run flutter pub get.

Then add the plugin again and run flutter pub get.

or

flutter pub cache repair

CodePudding user response:

Please Try this steps :

if you have intel chip

  1. flutter clean
  2. Set updated latest pub libraries version in pubspec.yml file like firebase_core, google_ml_kit etc. and do 'get pub'
  3. Go to your Podfile and uncomment #platform :ios, '9.0' Then change the version to 10 platform :ios, '10.0'
  4. go to ios folder throuh terminal and do 'pod repo update'
  5. 'pod update' or 'pod install'

if you have M1 chip

  1. flutter clean
  2. Set updated latest pub libraries version in pubspec.yml file like firebase_core, google_ml_kit etc. and do 'get pub'
  3. Go to your Podfile and uncomment #platform :ios, '9.0' Then change the version to 10 platform :ios, '10.0'
  4. go to ios folder throuh terminal and do 'arch -x86_64 pod repo update'
  5. 'arch -x86_64 pod update' or 'arch -x86_64 pod install'
  • Related