piggyvault / piggyvault

Family finance management app.

Home Page:https://piggyvault.abhith.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upgrade Flutter project to 2.x and Null Safetty

wstagf opened this issue · comments

On build the project in stable version flutter (2.10.3 atualy), has many errors found.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:

  /Users/thiago/Projetos/piggyvault/src/Mobile/piggy_flutter/android/app/src/main/AndroidManifest.xml uses `android:name="io.flutter.app.FutterApplication"`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Build failed due to use of deprecated Android v1 embedding.
thiago@iMac-de-Master piggy_flutter % flutter run --ignore-deprecation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:

  /Users/thiago/Projetos/piggyvault/src/Mobile/piggy_flutter/android/app/src/main/AndroidManifest.xml uses `android:name="io.flutter.app.FutterApplication"`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

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
Launching lib/main.dart on SM A105M in debug mode...
Warning: The plugin app_settings requires Android SDK version 30.
Warning: The plugin flutter_local_notifications requires Android SDK version 30.
Checking the license for package Android SDK Build-Tools 28.0.3 in /Users/thiago/Library/Android/sdk/licenses
License for package Android SDK Build-Tools 28.0.3 accepted.
Preparing "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)".
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" ready.
Installing Android SDK Build-Tools 28.0.3 in /Users/thiago/Library/Android/sdk/build-tools/28.0.3
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" complete.
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" finished.
Checking the license for package Android SDK Platform 29 in /Users/thiago/Library/Android/sdk/licenses
License for package Android SDK Platform 29 accepted.
Preparing "Install Android SDK Platform 29 (revision: 5)".
"Install Android SDK Platform 29 (revision: 5)" ready.
Installing Android SDK Platform 29 in /Users/thiago/Library/Android/sdk/platforms/android-29
"Install Android SDK Platform 29 (revision: 5)" complete.
"Install Android SDK Platform 29 (revision: 5)" finished.
Checking the license for package Android SDK Platform 28 in /Users/thiago/Library/Android/sdk/licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
"Install Android SDK Platform 28 (revision: 6)" ready.
Installing Android SDK Platform 28 in /Users/thiago/Library/Android/sdk/platforms/android-28
"Install Android SDK Platform 28 (revision: 6)" complete.
"Install Android SDK Platform 28 (revision: 6)" finished.
Checking the license for package Android SDK Platform 30 in /Users/thiago/Library/Android/sdk/licenses
License for package Android SDK Platform 30 accepted.
Preparing "Install Android SDK Platform 30 (revision: 3)".
"Install Android SDK Platform 30 (revision: 3)" ready.
Installing Android SDK Platform 30 in /Users/thiago/Library/Android/sdk/platforms/android-30
"Install Android SDK Platform 30 (revision: 3)" complete.
"Install Android SDK Platform 30 (revision: 3)" finished.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:

  /Users/thiago/Projetos/piggyvault/src/Mobile/piggy_flutter/android/app/src/main/AndroidManifest.xml uses `android:name="io.flutter.app.FutterApplication"`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

../../../../../.pub-cache/hosted/pub.dartlang.org/platform-3.0.0/lib/src/interface/local_platform.dart:46:19: Error: Member not found: 'packageRoot'.
      io.Platform.packageRoot; // ignore: deprecated_member_use
                  ^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:1862:22: Error: Member not found: 'door_back'.
  'door_back': Icons.door_back,
                     ^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:1863:28: Error: Member not found: 'door_back_sharp'.
  'door_back_sharp': Icons.door_back_sharp,
                           ^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:1864:30: Error: Member not found: 'door_back_rounded'.
  'door_back_rounded': Icons.door_back_rounded,
                             ^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:1865:31: Error: Member not found: 'door_back_outlined'.
  'door_back_outlined': Icons.door_back_outlined,
                              ^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:1866:23: Error: Member not found: 'door_front'.
  'door_front': Icons.door_front,
                      ^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:1867:29: Error: Member not found: 'door_front_sharp'.
  'door_front_sharp': Icons.door_front_sharp,
                            ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:1868:31: Error: Member not found: 'door_front_rounded'.
  'door_front_rounded': Icons.door_front_rounded,
                              ^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:1869:32: Error: Member not found: 'door_front_outlined'.
  'door_front_outlined': Icons.door_front_outlined,
                               ^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:4902:31: Error: Member not found: 'pie_chart_outlined'.
  'pie_chart_outlined': Icons.pie_chart_outlined,
                              ^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:5951:25: Error: Member not found: 'six_ft_apart'.
  'six_ft_apart': Icons.six_ft_apart,
                        ^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:5952:31: Error: Member not found: 'six_ft_apart_sharp'.
  'six_ft_apart_sharp': Icons.six_ft_apart_sharp,
                              ^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:5953:33: Error: Member not found: 'six_ft_apart_rounded'.
  'six_ft_apart_rounded': Icons.six_ft_apart_rounded,
                                ^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.0.2/lib/IconPicker/Packs/Material.dart:5954:34: Error: Member not found: 'six_ft_apart_outlined'.
  'six_ft_apart_outlined': Icons.six_ft_apart_outlined,
                                 ^^^^^^^^^^^^^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script '/Users/thiago/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1102

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/thiago/flutter/bin/flutter'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4m 42s
Running Gradle task 'assembleDebug'...                            288,3s
Exception: Gradle task assembleDebug failed with exit code 1
thiago@iMac-de-Master piggy_flutter % 

@abhith What version Flutter use for build this project?

@wstagf I don't exactly remember the flutter version last I had before I upgraded to 2.10.2.
I recently tried to upgrade (flutter 2.10.2) and it got stuck because of a plugin open issue (this). And the progress was pushed to flutter-upgrade branch.

So, thought of waiting a bit more to resolve the plugin issue to go ahead with the upgrade.

And related to the Null Safety, yeah when I turned it on, there were so many issues with the code (of course), so thought of going little by little, again, waiting for the build to succeed to resolve them.

Yesterday I have some attents to update, but no success... Has libs no support nullsafety... In next weekend trying again.

What I'm trying at the moment is to,

  • Create a fresh flutter project
  • Then copy the old code and at least make it build successfully (without Null Safety at first)
  • Then look into the Null Safety

I think don`t work because onesignal uses deprecated plugin...

In this repo I commit my changes and attents. https://github.com/wstagf/piggyvault

The flutter upgrade was completed successfully and is building fine.
Flutter

Next is to look into Null Safety.
And it feels like it gonna take time since when I enabled it, the number of errors are around 624.