Flutter : How to fix this "IgnoreLeaks" package error

217 Views Asked by At

I'm encountered with this error recently while working in AR application. Recent changes i did was: Added : firebase_core package Added : model_viewer_plus: ^1.7.0

I get following errors:

Launching lib\main.dart on sdk gphone x86 in debug mode...
Building with Flutter multidex support enabled.
../../../../../Pub/Cache/hosted/pub.dev/leak_tracker_testing-2.0.3/lib/src/leak_testing.dart:146:9: Error: No named parameter with the name 'notGCed'.
        notGCed: ignoredLeaks.notGCed.merge(
        ^^^^^^^
../../../../../Pub/Cache/hosted/pub.dev/leak_tracker-10.0.4/lib/src/leak_tracking/primitives/model.dart:130:9: Context: Found this candidate, but the arguments don't match.
  const IgnoredLeaks({
        ^^^^^^^^^^^^
../../../../../Pub/Cache/hosted/pub.dev/leak_tracker_testing-2.0.3/lib/src/leak_testing.dart:193:9: Error: No named parameter with the name 'notGCed'.
        notGCed: newNotGCed,
        ^^^^^^^
../../../../../Pub/Cache/hosted/pub.dev/leak_tracker-10.0.4/lib/src/leak_tracking/primitives/model.dart:130:9: Context: Found this candidate, but the arguments don't match.
  const IgnoredLeaks({
        ^^^^^^^^^^^^
../../../../../Pub/Cache/hosted/pub.dev/leak_tracker_testing-2.0.3/lib/src/leak_testing.dart:180:35: Error: The getter 'notGCed' isn't defined for the class 'IgnoredLeaks'.
 - 'IgnoredLeaks' is from 'package:leak_tracker/src/leak_tracking/primitives/model.dart' ('../../../../../Pub/Cache/hosted/pub.dev/leak_tracker-10.0.4/lib/src/leak_tracking/primitives/model.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'notGCed'.
    var newNotGCed = ignoredLeaks.notGCed.track([...notGCed, ...classes]);
                                  ^^^^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '..\..\flutter\bin\flutter.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 1s
Error: Gradle task assembleDebug failed with exit code 1


Exited (1).

I tried flutter clear , flutter pub get and also manually cleared the cache files. But nothing worked out.

Please help me out!

1

There are 1 best solutions below

0
0-shiva On

This issue is bagged because of conflicts between two packages.

Steps I followed to sort out:

  1. Firstly removed flutter sdk from windows (https://stackoverflow.com/a/72247943/16328198)

    Deleted flutter extension in android studio and remove the flutter sdk path from environment variable. Better restart the system.

  2. Removed the pub cache of /C:/../../AppData/Local/Pub/Cache

  3. Reinstalled sdk Official guide

  4. Run flutter --version. If this is Output, then flutter is installed successfully.

Hope this could help someone too.