0

1 year ago I developed an application. The latest update I published was 2 months ago. Since then, I switched from a MacBook Pro 2017 to an Apple Air M1. Today, I wanted to make some updates to this app so I cloned my private Git repository, installed the required tools (Flutter, Android Studio, ...) I am unable to launch the app. Many developers seem to encounter the issue and a flutter clean + flutter get commands seem to fix it but not for me.

I ran a few commands and here are the logs :

flutter run -d emulator-5554 --verbose command :

/opt/homebrew/Caskroom/flutter/2.2.3/flutter/.pub-cache/hosted/pub.dartlang.org/chewie-0.9.10/lib/src/chewie_player.dart:83:7: Error: No named
parameter with the name 'resizeToAvoidBottomPadding'.
resizeToAvoidBottomPadding: false,
^^^^^^^^^^^^^^^^^^^^^^^^^^
/opt/homebrew/Caskroom/flutter/2.2.3/flutter/packages/flutter/lib/src/material/scaffold.dart:1466:9: Context: Found this candidate, but the arguments
don't match.const Scaffold({
                  ^^^^^^^^ 
/opt/homebrew/Caskroom/flutter/2.2.3/flutter/.pub-cache/hosted/pub.dartlang.org/chewie-0.9.10/lib/src/chewie_player.dart:276:17: Error: The method
'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart'
('/opt/homebrew/Caskroom/flutter/2.2.3/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
context.inheritFromWidgetOfExactType(_ChewieControllerProvider)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/opt/homebrew/Caskroom/flutter/2.2.3/flutter/.pub-cache/hosted/pub.dartlang.org/chewie_audio-1.0.0+1/lib/src/chewie_player.dart:101:17: Error: The
method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart'
('/opt/homebrew/Caskroom/flutter/2.2.3/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
context.inheritFromWidgetOfExactType(_ChewieAudioControllerProvider)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Persisting file store
Done persisting file store
Target kernel_snapshot failed: Exception
#0 KernelSnapshot.build (package:flutter_tools/src/build_system/targets/common.dart:291:7)
<asynchronous suspension>
#1 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:828:9)
<asynchronous suspension>
#2 Future.wait.<anonymous closure> (dart:async/future.dart)
<asynchronous suspension>
#3 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:766:32)
<asynchronous suspension>
#4      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:595:16)
<asynchronous suspension>
#5      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:318:32)
<asynchronous suspension>
#6      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27)
<asynchronous suspension>
#7      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#8      CommandRunner.runCommand (package:args/command_runner.dart:196:13)
<asynchronous suspension>
#9      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9) <asynchronous suspension>
#10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19) <asynchronous suspension>
#11     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5) <asynchronous suspension>
#12     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9) <asynchronous suspension>
#13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19) <asynchronous suspension>
#14     main (package:flutter_tools/executable.dart:91:3) <asynchronous suspension>
"flutter assemble" took 12 390ms.
 
#0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:335:7) <asynchronous suspension>
#2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27) <asynchronous suspension>
#3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#4      CommandRunner.runCommand (package:args/command_runner.dart:196:13) <asynchronous suspension>
#5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9) <asynchronous suspension>
#6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19) <asynchronous suspension>
#7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5) <asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9) <asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19) <asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:91:3) <asynchronous suspension> 
ensureAnalyticsSent: 102ms
Running shutdown hooks
Shutdown hooks complete
exiting with code 1
> Task :app:compileFlutterBuildDebug FAILED
1 actionable task: 1 executed
FAILURE: Build failed with an exception.
* Where:
Script '/opt/homebrew/Caskroom/flutter/2.2.3/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/opt/homebrew/Caskroom/flutter/2.2.3/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 15s
Running Gradle task 'assembleDebug'... (completed in 16,0s)
Exception: Gradle task assembleDebug failed with exit code 1
 "flutter run" took 18 686ms.
 
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:663:9)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27) <asynchronous suspension>
#3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19) <asynchronous suspension>
#4      CommandRunner.runCommand (package:args/command_runner.dart:196:13) <asynchronous suspension>
#5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9) <asynchronous suspension>
#6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19) <asynchronous suspension>
#7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5) <asynchronous suspension>
#8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9) <asynchronous suspension>
#9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19) <asynchronous suspension>
#10     main (package:flutter_tools/executable.dart:91:3) <asynchronous suspension>
           
           
ensureAnalyticsSent: 91ms
Running shutdown hooks
Shutdown hooks complete
exiting with code 1

flutter doctor -v command :

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-arm, locale fr-FR)
    • Flutter version 2.2.3 at /opt/homebrew/Caskroom/flutter/2.2.3/flutter
    • Framework revision f4abaa0735 (il y a 8 semaines), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/kamil.hammouche/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.2

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 11.0.10+0-b96-7249189)

[✓] Connected device (1 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 12 (API 31) (emulator)

! Doctor found issues in 1 category.

Did someone encounter this issue an has an idea on how to fix it ?

Best regards,

  • Try updating your dependencies. – Tushar Patel Aug 24 '21 at 06:07
  • I already upgraded them to the latest major update –  Aug 24 '21 at 06:30
  • can you provide which code might get those errors in your project? can you provide it? Also after showing through your log might be a chewie dependence errors and some syntax errors. – Tushar Patel Aug 24 '21 at 06:33
  • That's the main problem which I didn't specify in my question and I should have specified it. I neither have a code with these properties (resizeToAvoidBottomPadding, ...) nor the chewy dependency. It might be one of my dependency that requires chewie, but I can't find which one. –  Aug 24 '21 at 06:52
  • I think your app using video_player: dependency and chewie is required for that – Tushar Patel Aug 24 '21 at 07:00
  • 2
    It seem like `chewie` is hitting null safety issues. You can use `dart pub outdated --mode=null-safety` to check state of your package – Sam Chan Aug 24 '21 at 08:22
  • 1
    @SamChan got it working using this command, thank you very much ! –  Aug 24 '21 at 12:26

4 Answers4

0

Check your available devices by command "adb devices", if it shows adb not recognized then add User Variable PATH: %USERPROFILE%\AppData\Local\Android\sdk\platform-tools and restart cmd

Bijoya_Banik
  • 387
  • 4
  • 12
0

removing the gradle cache helped for me, you can find the steps here How to clear gradle cache?

then run 'flutter clean' and 'flutter pub get'

Deekshith Xetty
  • 224
  • 3
  • 11
0
  1. Restore the android setting to the defaults
  2. If the app is installed on the emulator, delete it first
  3. After that run flutter clean + flutter get

restore android settings

zeev grim
  • 137
  • 1
  • 5
-2

did you have google chrome ? it seems that you have encountered a problem of google chrome. For more information..here is a link check it out... https://stackoverflow.com/a/66665750/16558933[Cannot find chrome]1