I have made a lot of changes to my flutter app including updating packages to their latest/resolvable versions.
NOTE: My app builds perfectly fine in VScode when I run the app in debug
and if I use flutter run
. No problems there.
So, now it's time to archive and send my build to the Apple. I would normally do this by opening up Xcode, archiving my latest build and then using Xcode Organiser
to Distribute App
.
Problem is, the build fails in Xcode before it can archive. I get these errors in Xcode:
/Users/joshua/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.h /Users/joshua/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.h: No such file or directory
/Users/joshua/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/messages.g.h /Users/joshua/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/messages.g.h: No such file or directory
/Users/joshua/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.17/ios/Classes/FLTURLLauncherPlugin.h /Users/joshua/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.17/ios/Classes/FLTURLLauncherPlugin.h: No such file or directory
I've tried, flutter clean
, flutter pub get
, deleting /ios/Pods
and /ios/podfile.lock
. Running pod deintegrate
and pod install --repo-update
from the /ios
directory. I've tried running rm -rf ~/.pub-cache/hosted/pub.dartlang.org/
WHAT I TRIED (that you probably won't need to do):
I initially created a new flutter project with the same name. Then copy-pasted all my lib files over to the new project shell. Updated the config files where necessary. I still had the same issue!
HOW I SOLVED IT:
Turns out it was just an issue with an outdated package.
In my case, this package, flutter_native_timezone
, had stopped being updated and I found a package that was being updated (that was a fork from the outdated one). flutter_timezone
.
Note that I also made an effort to remove all unused packages and get all packages to their actual latest versions.