1

In my project I used GetX v4.6.1. When it Build on debug mode, I faced this bugs

/C:/Users/ALIF/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/get-4.6.1/lib/get_navigation/src/root/get_material_app.dart:275:17: Error: No named parameter with the name 'useInheritedMediaQuery'.
                useInheritedMediaQuery: useInheritedMediaQuery,         
                ^^^^^^^^^^^^^^^^^^^^^^                                  
/C:/src/flutter/packages/flutter/lib/src/material/app.dart:217:9: Context: Found this candidate, but the arguments don't match.
  const MaterialApp.router({                                            
/C:/Users/ALIF/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/get-4.6.1/lib/get_navigation/src/root/get_material_app.dart:322:17: Error: No named parameter with the name 'useInheritedMediaQuery'.                                                                                                  useInheritedMediaQuery: useInheritedMediaQuery,
                ^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/material/app.dart:166:9: Context: Found this candidate, but the arguments don't match.
  const MaterialApp({
        ^^^^^^^^^^^
/C:/Users/ALIF/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/get-4.6.1/lib/get_navigation/src/root/get_cupertino_app.dart:252:17: Error: No named parameter with the name 'useInheritedMediaQuery'.                                                                                                 useInheritedMediaQuery: useInheritedMediaQuery,
                ^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/cupertino/app.dart:189:9: Context: Found this candidate, but the arguments don't match.
  const CupertinoApp.router({                                           
        ^^^^^^^^^^^^^^^^^^^                                             
/C:/Users/ALIF/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/get-4.6.1/lib/get_navigation/src/root/get_cupertino_app.dart:292:17: Error: No named parameter with the name 'useInheritedMediaQuery'.
                useInheritedMediaQuery: useInheritedMediaQuery,         
                ^^^^^^^^^^^^^^^^^^^^^^                                  
/C:/src/flutter/packages/flutter/lib/src/cupertino/app.dart:145:9: Context: Found this candidate, but the arguments don't match.
  const CupertinoApp({                                                  
        ^^^^^^^^^^^^                                                    
                                                                        
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\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 23s                                                  
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        87.9s
Exception: Gradle task assembleDebug failed with exit code 1

I'm also already followed this references but still not resolve the issues. First time I faced this issues is when at MyApp widget (root) on my project would change from MaterialApp to be GetMaterialApp, only.

6 Answers6

2

In pubspec.yaml use get package like below :

get: 4.6.1

# Don't use ^

Pranav Kasetti
  • 8,770
  • 2
  • 50
  • 71
1

Please wrap with GetMaterialApp.

  return GetMaterialApp(
      debugShowCheckedModeBanner: false,
      theme: appTheme(),
      getPages: AppRoutes.getAppRoutes(),
      initialRoute: AppRoutes.INITIAL,
    );
Hasib Akon
  • 580
  • 6
  • 16
1

for me solved !

if using like below :

  get: ^4.6.1

replace to :

  get: 4.5.1

and finally write in terminal :

flutter clean
flutter pub get
Esmaeil Ahmadipour
  • 840
  • 1
  • 11
  • 32
0

Build task issues similar to what you've encountered could be usually solved by running flutter clean to clear the project's build cache and running flutter pub get to fetch the project's dependencies configured in the project's pubspec.yaml

If a package in your pub cache is broken, you can use flutter pub cache repair command to perform a clean reinstall of all hosted and git packages in the system cache.

Omatt
  • 8,564
  • 2
  • 42
  • 144
0

I hv same issue. I solved by reducing GetX version into :

#In pubspec.yaml use get package like below :

get: 4.5.1

This doesn't work for me:

#In pubspec.yaml use get package like below :

get: 4.6.1
calaxan
  • 21
  • 3
0

I solved by reducing GetX version into : get: 4.2.4 flutter version 2.0.6 dart version 2.12

android/app/build.gradle set like this;

android { compileSdkVersion 30 defaultConfig {
minSdkVersion 21 targetSdkVersion 30 ................ }

ismail
  • 1
  • 1