skip to Main Content

I recently upgraded my Flutter application to version 3.24.1, and since then, I’ve been unable to run the app. I’m encountering the following Gradle issue:

You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply

You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future 
release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply

../../../AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.1.1/lib/src/guid.dart:32:9: Error: Type 'UnmodifiableUint8ListView' not found.
  final UnmodifiableUint8ListView bytes;
        ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.1.1/lib/src/guid.dart:32:9: Error: 'UnmodifiableUint8ListView' isn't a type.
  final UnmodifiableUint8ListView bytes;
        ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.1.1/lib/src/guid.dart:52:17: Error: Method not found: 'UnmodifiableUint8ListView'.    
    return Guid(UnmodifiableUint8ListView(guid));
                ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.1.1/lib/src/guid.dart:56:31: Error: Method not found: 'UnmodifiableUint8ListView'.    
  factory Guid.zero() => Guid(UnmodifiableUint8ListView(Uint8List(16)));
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.1.1/lib/src/guid.dart:100:17: Error: Method not found: 'UnmodifiableUint8ListView'.   
    return Guid(UnmodifiableUint8ListView(Uint8List.fromList(guidAsBytes)));
                ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/archive-3.4.10/lib/src/bzip2/bzip2.dart:5:7: Error: Method not found: 'UnmodifiableUint8ListView'.
      UnmodifiableUint8ListView(Uint8List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/archive-3.4.10/lib/src/bzip2/bzip2.dart:7:7: Error: Method not found: 'UnmodifiableUint32ListView'.
      UnmodifiableUint32ListView(Uint32List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/archive-3.4.10/lib/src/bzip2/bzip2.dart:9:7: Error: Method not found: 'UnmodifiableInt32ListView'.
      UnmodifiableInt32ListView(Int32List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^
Target kernel_snapshot_program failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script 'C:codeflutterpackagesflutter_toolsgradlesrcmaingroovyflutter.groovy' line: 1687

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:codeflutterbinflutter.bat'' 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 1m 21s
Running Gradle task 'assembleDebug'...                             82.2s
Error: Gradle task assembleDebug failed with exit code 1

I’ve tried cleaning the project and re-syncing Gradle, but the problem persists. I’ve also checked my build.gradle files for any outdated dependencies but haven’t found anything unusual.

flutter doctor -v

[√] Flutter (Channel stable, 3.24.1, on Microsoft Windows [Version 10.0.19045.4780], locale en-AE)
    • Flutter version 3.24.1 on channel stable at C:codeflutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5874a72aa4 (8 days ago), 2024-08-20 16:46:00 -0500
    • Engine revision c9b9d5780d
    • Dart version 3.5.1
    • DevTools version 2.37.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at C:UsersjamalAppDataLocalAndroidSdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = C:UsersjamalAppDataLocalAndroidSdk
    • Java binary at: C:Program FilesAndroidAndroid Studiojbrbinjava
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:Program FilesGoogleChromeApplicationchrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.2)
    • Visual Studio at C:Program FilesMicrosoft Visual Studio2022Community
    • Visual Studio Community 2022 version 17.5.33502.453
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2024.1)
    • Android Studio at C:Program FilesAndroidAndroid Studio
    • 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 17.0.11+0--11852314)

[√] VS Code (version 1.92.2)
    • VS Code at C:UsersjamalAppDataLocalProgramsMicrosoft VS Code
    • Flutter extension version 3.94.0

[√] Connected device (4 available)
    • SM G715FN (mobile) • R58RB0ZASKF • android-arm64  • Android 13 (API 33)
    • Windows (desktop)  • windows     • windows-x64    • Microsoft Windows [Version 10.0.19045.4780]
    • Chrome (web)       • chrome      • web-javascript • Google Chrome 127.0.6533.120
    • Edge (web)         • edge        • web-javascript • Microsoft Edge 128.0.2739.42

[√] Network resources
    • All expected network resources are available.

• No issues found!

Has anyone else encountered this issue after upgrading? What steps should I take to resolve this and successfully run my app?

2

Answers


  1. It is a known issue: https://github.com/jonataslaw/get_cli/issues/263

    You need to update win32 dart package.

    Go to your project and update the minimum Dart SDK version.
    For me, it is 3.5.0

    pubspec.yaml

    environment:
      sdk: ">=3.5.0 <4.0.0"
    

    Then clean pub cache:

    flutter pub cache clean
    

    And update outdated dart packages:

    flutter pub outdated 
    flutter pub upgrade
    

    In the logs you should see:

    > win32 5.5.4 (was 5.2.0)
    
    Login or Signup to reply.
  2. I fixed this issue by removing syncfusion package from my project

    first I tried by changing the flutter version but not fixed
    After reading https://github.com/jonataslaw/get_cli/issues/263 this blog found everyone saying syncfusion issues and I just changed the version then changed the error log then I removed the package and its working well

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search