I am new to flutter and facing this issue. When I run app in debug mode the app runs fine but when I am running command.
I am new to flutter and facing this issue. When I run app in debug mode the app runs fine but when I am running command.
I am new to flutter and facing this issue. When I run app in debug mode the app runs fine but when I am running command
flutter build apk --release
I am getting this errors
Warning: You are using these overridden dependencies:
! http 0.12.2 (0.13.4 available)
! intl 0.17.0
Running "flutter pub get" in Food-Delivery---Customer... 5.8s
The plugin `google_maps_flutter` 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.
Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_place_picker-0.9.2/lib/src/components/prediction_tile.dart:29:51: Error: The getter 'title' isn't defined
for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/Flutter/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'title'.
final textColor = Theme.of(context).textTheme.title.color;
^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:432:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 {
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:440:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 {
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:451:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 {
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:463:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 {
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:475:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 {
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:487:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 {
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:499:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 {
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:510:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 {
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:521:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 {
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:532:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 {
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:544:15: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 {
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.1.0 1/lib/messages.dart:96:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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);
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.1.0 1/lib/messages.dart:98:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 {
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.1.0 1/lib/messages.dart:111:17: Error: The method 'setMockMessageHandler' isn't defined
for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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);
^^^^^^^^^^^^^^^^^^^^^
/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.1.0 1/lib/messages.dart:113:17: Error: The method 'setMockMessageHandler' isn't defined
for the class 'BasicMessageChannel<dynamic>'.
- 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('/C:/Flutter/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 'C:\Flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'C:\Flutter\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 30s
Running Gradle task 'assembleRelease'... 91.4s
Gradle task assembleRelease failed with exit code 1
CodePudding user response:
The issue comes from the google_maps_flutter
plugin, the version you are making use of is deprecated and your current SDK version does not allow the apk to build, your code could be correct, but the plugin definitely has bugs in its code, hence the errors, i'd recommend using an updated version of the plugin.
CodePudding user response:
You are getting overridden dependencies
because you may be overriding some dependency that you are already using. For example, if you are using path: 0.12.2 for http plugin and some other dependency use dependency_overrides to make sure that is using path: 0.13.4, it will present you that message.
And you are getting a deprecating message like
The plugin ```google_maps_flutter``` uses a deprecated version of the Android embedding.
It is because of the new flutter update. There is nothing you can do. Either use an other package or ask the package developer to fix the problem. This error is after version 2.5 of the flutter. OR or you could just switch to another package that can achieve the same task. Until the packages author update to v2 Android embedding