rutorrent-flutter icon indicating copy to clipboard operation
rutorrent-flutter copied to clipboard

Fails to run (Android)

Open Tatsh opened this issue 2 years ago • 1 comments

Commit is 7c5c8f9a2f0535963f7782e5626961561c5c5dd1. How to fix?

 $ flutter run
Launching lib/main.dart on Pixel 5 in debug mode...
../../.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.2.0/lib/messages.dart:100:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
 - 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
        channel.setMockMessageHandler(null);
                ^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.2.0/lib/messages.dart:102:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
 - 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
        channel.setMockMessageHandler((dynamic message) async {
                ^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.2.0/lib/messages.dart:114:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
 - 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
        channel.setMockMessageHandler(null);
                ^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.2.0/lib/messages.dart:116:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
 - 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('flutter/packages/flutter/lib/src/services/platform_channel.dart').
Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
        channel.setMockMessageHandler((dynamic message) async {
                ^^^^^^^^^^^^^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script '/home/tatsh/dev/rutorrent-flutter/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1005

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/tatsh/dev/rutorrent-flutter/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 6s
Running Gradle task 'assembleDebug'...                              7.1s
Exception: Gradle task assembleDebug failed with exit code 1

Tatsh avatar Oct 14 '21 02:10 Tatsh

Hello Tatsh, I have also faced same kind of issue in a previous flutter project of mine, basically the is some sort of problem in the Pubspec.Lock file of your pubspec.yaml. you just need to clear the Cache by running flutter clean. After that some clear sort of errors will occur regarding your dependencies or Sdk version. for dependency related issue you can simply run Pub get and Pub upgrade in pubspec.yaml. for errors related to SDK version, you will need to change some seetings as: File>Project Structure and select the latest SDK verion in tools.

AarizAnsari avatar Nov 22 '21 13:11 AarizAnsari

The project has been updated extensively in the last 2 years (check wiki for more info). The default branch is now the "main" branch. All issues for previous versions are being removed.

AbdulMalikDev avatar Sep 10 '22 17:09 AbdulMalikDev