Home > OS >  After upgrading to Flutter 3.3.2. can not buld app due to 'open_file' plugin using a depre
After upgrading to Flutter 3.3.2. can not buld app due to 'open_file' plugin using a depre

Time:09-19

Upon upgrading to Flutter 3.3.2 I"m not able to build my application due to 'open_file' plugin using a deprecated version of Android embedding. Is there a way to migrate said plugin to Android V2 embedding as recommended in the below warning message? Or I have to downgrate to Flutter 2.x.x?

The plugin `open_file` uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib\main.dart on sdk gphone x86 arm in debug mode...
lib\main.dart:1
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:open_file


For solutions, see https://dart.dev/go/unsound-null-safety
2

FAILURE: Build failed with an exception.

Flutter doctor output

[√] Flutter (Channel stable, 3.3.2, on Microsoft Windows [Version 10.0.19044.2006], locale et-EE)
    • Flutter version 3.3.2 on channel stable at c:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e3c29ec00c (3 days ago), 2022-09-14 08:46:55 -0500
    • Engine revision a4ff2c53d8
    • Dart version 2.18.1
    • DevTools version 2.15.0

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\pavel\AppData\Local\Android\Sdk
    • Platform android-33, build-tools 30.0.3
    • ANDROID_SDK_ROOT = C:\Users\pavel\AppData\Local\Android\Sdk
    • Java binary at: c:\Android\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.8 10-b944.6842174)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.1.32407.343
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 4.2)
    • Android Studio at C:\Android
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8 10-b944.6842174)

[√] Android Studio
    • Android Studio at c:\Android
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = c:\Android
    • Java version OpenJDK Runtime Environment (build 11.0.8 10-b944.6842174)

[√] VS Code (version 1.71.2)
    • VS Code at C:\Users\pavel\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.48.0

[√] Connected device (4 available)
    • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)           • windows       • windows-x64    • Microsoft Windows [Version 10.0.19044.2006]
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 105.0.5195.126
    • Edge (web)                  • edge          • web-javascript • Microsoft Edge 105.0.1343.33

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

CodePudding user response:

You can upgrade the version of open_file you are using in your project. Check out the available versions that best fit your project here. You can also use the flutter pub upgrade --major-versions command to upgrade all your dependencies.

CodePudding user response:

solved by explicitly stating latest plugin version number in pubspec.yaml

open_file: ^3.2.1
  • Related