Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Type Mismatch Error in agent_dart Causing Build Failure #63

@ideasidus

Description

@ideasidus

I tried to build a test demo for Flutter, but it throws an exception

I tried the agent_dart package in the error message below with both 1.0.0-dev.8, which is a requirement of secp256r1: 0.1.0-dev.7, and 1.0.0-dev.22, the most recent version, but only 1.0.0-dev.20 was available in the dependency check.

Does agent_dart need any modification or do I need to use a specific flutter & dart version?

Attempted Solutions:

  • I tried using different versions of agent_dart (1.0.0-dev.8 and 1.0.0-dev.22), but the issue persists.

Desired Outcome:

I would appreciate any guidance on resolving this type mismatch error and successfully building my Flutter project.

Environment:

  • Flutter version: 3.19.3
  • Dart version: 3.3.1
  • agent_dart version: 1.0.0-dev.20

Error Message:

PS C:\Users\user\FlutterProjects\magic-flutter\magic_demo> flutter run
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
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/go/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/go/flutter-gradle-plugin-apply

../../../AppData/Local/Pub/Cache/hosted/pub.dev/agent_dart-1.0.0-dev.20/lib/archiver/encoder.dart:162:8: Error: The return type of the method 'SingingBlockZipFileEncoder.close' is 'void', which does not match the return type, 'Future<void>', of the overridden method, 'ZipFileEncoder.close'.
 - 'Future' is from 'dart:async'.
Change to a subtype of 'Future<void>'.
  void close() {
       ^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/archive-3.5.1/lib/src/io/zip_file_encoder.dart:235:16: Context: This is the overridden method ('close').
  Future<void> close() async {
               ^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\user\flutter\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy' line: 1419

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions