Unable to run a mixed-version program in flutter beta despite following official instructions - flutter

I have an existing project that I want develop into a web app, so I switched to the flutter beta channel. And since I also intend later to refactor my code for null-safety I started upgrading as many package dependencies as are available with null-safe revisions. For now my project has to be a mixed-version program.
I have followed the official Migrating incrementally and Testing or running mixed-version programs instructions but my IDE (IntelliJ) is still riddled with Dart Analysis null-safe errors and my project fails to build because of the same errors. (I have invalidated caches and restarted IntelliJ, to no effect.)
I have set the minimum SDK constraint in pubspec.yaml to 2.12.0-0; I've added // #dart=2.9 to the top of all Dart files I don’t want to consider for null-safe analysis at this point in the migration, including main.dart; and I am using the flutter run --no-sound-null-safety command.
Can someone recommend what can be done to run my project as a mixed-version program?

Related

Unable to strip the following libraries, packaging them as they are: libflutter.so

I saw this as part of the logs generated by Gradle when building an app in release mode in flutter. Does this have any side effects on the overall app?
libflutter.so is already the compiled form of flutter framework and other native scripts needed to run your app.
More specifically *.so files includes Dart language dependency, skia engine, flutter framework, platform related native code etc.
So their is no need to break them and compile them as they are already compiled. Hence it shows the message that cannot strip them packaging them as they are. This doesn't have any side effects. (*.so files are compiled form of code that are designed to run on linux distributions.) Android is also a linux distribution.
Hence there is no side effect on the app which you are building.

I get this error in my flutter app. migrate this app to the V2 embedding

I get this error in my Flutter Project,
C:\src\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in source_code... 34.3s
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
The plugin firebase_core requires your app to be migrated to the Android embedding v2. Follow the steps on https://flutter.dev/go/android-project-migration and re-run this command.
Process finished with exit code 1
Flutter Embedding Error
Since Flutter 1.12 the way how Flutter plugins communicate with the native Android side has been improved. Allowing plugins to better integrate with the native Android lifecycle.
Some plugins support both the new and the old structure, however many plugins (like firebase_core) dropped support for the legacy structure to ensure optimal integration with the Android system.
Apps created using Flutter 1.12 and higher automatically generate the correct Android integration logic, however Flutter applications created with an earlier version of Flutter need to be manually migrated. There are two options to fix this for your app:
The easiest solution is to delete the android folder in your project and let Flutter (using Flutter 1.12 or higher) recreate it for you by running the following command in the root folder of the Flutter project: flutter create --platform=android . (don't forget the . at the end of the command). You should only do this if you haven't made any custom changes to the Android code and of course make sure to make a backup first.
The more safe option is to manually migrate the Android project using the instructions provided on the GitHub Wiki page mentioned in the error message.
When following the instructions on the GitHub Wiki page make sure to keep an eye on all the details. Personally I forgot to update the <application android:name="MyApp" to the recommended <application android:name="${applicationName}" which resulted in the same error you are reporting.
What helped me was to create a new "dummy" application with the latest version of Flutter (for example flutter create --platforms=android test_app) and compare the files in the Android folder with the files of my current App and make changes where necessary.

VS Code testing tab no longer finds tests

After upgrading from Flutter 2.5.0 to Flutter 2.5.1, the testing tab in VS Code no longer finds all the tests for any of my Flutter projects. Instead, this is all I see:
I've tried downgrading back to 2.5.0, but no luck. Obviously, I can still use just use flutter test to run all the tests, but this isn't as nice as the testing UI that was previously available. Other developers on my teams have also run into this problem. I haven't seen any posts / info about it online or in the Flutter changelogs. My VS Code version is the exact same from before this became an problem. (VS Code version: 1.60.2)
Any help would be appreciated!
This is only a temporary fix. But if you downgrade the dart extension in VS Code, then it will bring back the older testing which can find / run all the tests.
Open the extensions tab in VS Code -> gear icon -> install another version... -> 3.26.0. After it finds the version, and you select it, you'll need to restart VS Code. Then the old testing should be available.

Flutter version used in project

Where can I see the flutter version used in a flutter project? Is there a file inside the project directory where I can see it? I think it is not specified inside the pubscpec.yaml file
So far, I think the specific version can not be found but only what versions can be used in a project. It can be found at the bottom part of pubscpec.lock file
pubspec.lock screenshot
It will not show version project wise. It will overall flutter version that you have installed in your system. For that:
Open your flutter project root directory in Command Prompt or Terminal type:
flutter --version command.
After typing the above command hit enter and You’ll see it will display us the currently installed flutter and Dart version in your computer and also tells us which version type we have installed like Stable or Beta.
Note: There is no such feature/command to check about which version of flutter you have used in Specific project.
Check this thread it will give you more idea:
https://github.com/flutter/flutter/issues/14230
All projects you run will use the flutter sdk installed in your machine/computer from where you specified its location from. So if the version the project uses don't match with the version you've and they conflict, you will have errors and if there is a huge gap and breaking changes, you'll need to either upgrade or downgrade the sdk. But most of the time, things are deprecated before they just become breaking changes and so you shouldn't have big issues. So the best thing to do is usually to upgrade. First check your sdk version via flutter --version. If its outdated, use flutter upgrade to upgrade it.
You can either run flutter --version to check flutter version installed on your machine or check it in your pubspec.lock file for current flutter version in your project
sdks:
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.16.0 <2.0.0"

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.