Workflow to upgrade a Flutter project/application - flutter

I have several Flutter projects that I have been working with for some time. Some a rather new and others are older. I constantly upgrade my Flutter SDK and switch between stable and beta channels. Everything works but the newer projects have different file layouts, for example .gitignore in android/ios folders, new XCode config files etc.
How do I update an older project to the new layout so as if it was just generated with flutter create?
Also there is this .metadata file generated which makes no sense to me. It never gets updated and only has it's project_type read by flutter_tools during flutter create. What is this for, why is it not being updated to the correct channel/rev?
Due to my research for the former question, I have run flutter create . in an existing project which generates some new files. Is this the only way, together with manually diffing to a new pristine project? And why is the .metadata file still outdated?
If anyone has some insights or documentation links regarding this, that would be great. I didn't find anything.

Update:
Apparently one can update the initially generated Flutter configuration files by re-running flutter create ..
Old:
Somewhat answering my own question here.
On March 3rd a commit was added to Flutter that added the notion of migrations to the iOS template/configuration (https://github.com/flutter/flutter/commit/e491544588e8d34fdf31d5f840b4649850ef167a).
These migrations take care of bringing the XCode configuration files to the latest version.
This commit has been ported back until Flutter 1.15.x.
This a great step forward. Hopefully similar migrations will be added for Android configurations and basic project files in the future.

Related

Flutter: When I debug my App, my App creates this files

My App have a Problem so I Need to do flutter clean before I can debug my app.
So I do flutter clean and after that flutter run in my Terminal.
Then my App debug. After that flutter creates a new build folder, new .flutter-plugins and .flutter-plugins-dependencies.
Now I think the problem is not there but sometimes it creates the files.
Can I delete the files? And how can I fix it?
PS: I have the newest version of flutter and Xcode. And I work with VSCode and I work on a MacBook with the newest Version.
I'm not sure about this, but in one case I tried adding resource permission from info.plist(I messed with internal storage permission), I noticed similar behaviour.

Flutter device daemon #1: process exited during startup

the dart path is correct, the environment variable also fine but I can not figure what went wrong, I can not create or run flutter projects. I don't know what is the is please help me figure out this.
There could be chances that you've installed a Flutter before and Flutter took parts of the old version to initialize. Here is a related GitHub post.
Usually a workaround here is to remove or delete flutter_tools.stamp.
rm FLUTTER_ROOT/bin/cache/flutter_tools.stamp
But for most, replacing the existing Flutter SDK with the new one from the Flutter website works like charm.

Where can I find the latest Movesense Showcase app source?

According to https://www.movesense.com/news/2020/02/movesense-showcase-ios-app-is-now-open-source/ the showcase app source is open source. But the source code that’s there in the repo is at least couple of versions behind in terms of UI.
Is there an updated repo location for the latest? Our client is looking at the app in AppStore thinking the source code should be the same.
Well, the source code in the repository is exactly the same as has been used for generating and compiling the app store version. Could you please make sure you are using the master branch of this repo: https://bitbucket.org/suunto/movesense-mobile-lib/ ?
Also, please make sure that you are opening the folder MovesenseShowcase in xcode, not IOS-example (which is the old example app for iOS)
In addition, please make sure you are using Xcode 11 (latest) and following the instructions in readme.md

Add flutter web and desktop to existing flutter (android/ios) project in android studio

I know it maybe still early but I want to try and use full flutter existing cross-platform support in one project. Stability is not my main concern.
I have started a flutter project in android studio. Naturally I have (android/Ios) going smoothly. But I would love to add Web and desktop to the same project.
Please help me with and direction, or if there is solution any one has created however much experimental.
There is a migration guide for web here. I got it up and running on a very basic existing app.
Best way is to do it in a separate branch since it requires changing packages and I even deleted .packages and pubspec.lock files first. Then I ran pub get (not flutter packages get) to download the required packages and run some precompilers.

Obscure issue, Google AdMob SDK, XCode 8.2 + Cocoapods integration

I have come across a really strange issue that has kept me busy for over a week which i believe to be a bug with the GoogleAdMob SDK, Xcode 8.2, cocoapods or a combination of those.
I am posting it here, in hopes an engineer can confirm the bug and point our team in the right direction to resolution.
The problem goes like this:
Create an empty Xcode project
Add/Install GoogleAds-IMA-iOS-SDK-For-AdMob pod
Commit everything and delete the repository from local machine
Check out repository again
Hit Build. Project will fail to build with error ld: framework not found GoogleMobileAds
To fix, comment out the GoogleAds-IMA-iOS-SDK-For-AdMob pod and run pod update, then uncomment it again and run pod update again, project will build.
If you try to commit at this point, git will pick up no changes
Repeat steps 3 and 4, and you will be back at step 5
I have created a repository here https://github.com/piterwilson/testAdmob where the bug can be reproduced.
The 'fix' that i have found will not work for our team as we commit our code and send it to a Jenkins server that creates a lot of builds with different code signatures required by our business.
The Jenkins build always fails with ld: framework not found GoogleMobileAds
Extra information : This has only happened starting this year. Maybe because of Xcode 8.2 (?) but we can't be sure where the problem is exactly.
I created a PR that resolves the issue in a reliable manner: https://github.com/piterwilson/testAdmob/pull/1
The repository was missing the GoogleAdMobs binary. It's a rather large file (38M), so perhaps the submitter of the question has some local configuration that automatically ignores large files? The binary should have been in this commit: https://github.com/piterwilson/testAdmob/commit/a0834a4d2f2b82da98add1bc3c49d8c0c28ffd86 (at least that's when it appeared for me when I tried to reproduce the issue.)