Reputation: 72
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.
Upvotes: 2
Views: 2462
Reputation: 325
There are many reasons why this error occurs since you've migrated to Flutter 2.0 (null-safety).
You re-created the whole ios
and/or android
which will generate the new codes (or syntax) and files which might lead to an error like what you're facing.
For anyone who are planning to migrate please always keep a backup file for your internal configs in ios
and/or android
folders respectively.
iOS
and android
FOLDER BACK!You need to manually reconfig your files under those folders.
If you're using Firebase packages, you can add these lines in your Podfile inside the clause target 'Runner'
do:
# add the Firebase pod for Google Analytics
# or pod ‘Firebase/AnalyticsWithoutAdIdSupport’
# for Analytics without IDFA collection capability
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
pod 'Firebase/Analytics'
pod 'Firebase/DynamicLinks'
Follow some tips here
After that, make sure that you configured back other app's metadata like AppBundleName
and some permissions in info.plist
(might be optional) If you're gonna check the pubspec.yaml, there's a new line there which you need to add for new linting options. Pay attention to the spacing.
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
Then do what 99% stackoverflow
users always says with this matter :)
delete pubspec.lock
delete pods folder
delete Podfile.lock
flutter pub cache repair
flutter clean
flutter pub get
Upvotes: 2
Reputation: 2148
Please Try this steps :
if you have intel chip
if you have M1 chip
Upvotes: 0
Reputation: 4068
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
Upvotes: 0