how to resolve this problem in flutter.bat i don't understand anything - flutter

Error: No named parameter with the name 'nullOk'.
../…/src/extended_image.dart:786
_invertColors = MediaQuery.of(context, nullOk: true)?.invertColors ??
^^^^^^
: Context: Found this candidate, but the arguments don't match.
../…/widgets/media_query.dart:818
static MediaQueryData of(BuildContext context) {
^^
2
FAILURE: Build failed with an exception.
Where:
Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\src\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 59s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
name: pubx
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.17.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
auto_size_text: ^3.0.0
pixel_perfect: ^1.1.1
get: 4.5.1
extended_image: ^2.0.0
like_button: ^2.0.5
fluttericon: ^2.0.0
google_nav_bar: ^5.0.6
flutter_switch: ^0.0.2
story_view: ^0.12.8
share: ^2.0.4
flutter_share: ^2.0.0
flutter_native_splash: ^0.3.2
google_fonts: ^1.1.2
get_storage: ^1.2.1
flutter_secure_storage: ^4.2.1
image_cropper: ^1.5.1
cached_network_image: ^2.5.1
connectivity_plus: ^0.8.1
sqflite: ^2.0.2
path_provider: ^1.6.28
path: ^1.8.0
equatable: ^2.0.5
#flutter_bloc: ^7.1.0
intl_phone_number_input: ^0.1.2
vibration: ^1.7.6
sound_mode: ^2.0.2
flutter_facebook_auth: ^2.0.2+1
#flutter_facebook_auth: ^3.0.0-nullsafety.0
google_sign_in: ^5.1.0
http: ^0.12.2
#firebase_auth: ^0.16.1
#firebase_core: ^0.4.4
dev_dependencies:
flutter_test:
sdk: flutter
dio: ^3.0.10
jwt_decode:
flutter_spinkit: any
image_picker: ^0.6.7+6
image_gallery_saver: any
# image_picker: any
provider: ^5.0.0
permission_handler: any
shared_preferences: any
shimmer: ^2.0.0
# flutter_local_notifications: any
font_awesome_flutter: ^9.1.0
#keyboard_actions: any
# flutter_3d_choice_chip: ^0.1.4
# Shared_preferences: ^0.5.7+1
# firebase_messagering: ^6.0.13
flutter_local_notifications: ^1.4.3
# cached_network_image: ^2.1.0+1
# image_cropper: ^1.2.1
# photo_view: ^0.9.2
# url_launcher: ^5.4.10
# video_thumbnail: ^0.5.0
keyboard_actions: any
# flutter_3d_choice_chip: ^0.1.4
# Shared_preferences: ^0.5.7+1
# firebase_messagering: ^6.0.13
#flutter_local_notifications: ^1.4.3
# cached_network_image: ^2.1.0+1
# image_cropper: ^1.2.1
# photo_view: ^0.9.2
# url_launcher: ^5.4.10
# video_thumbnail: ^0.5.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
flutter_native_splash:
color: "#ffffff"
color_dark: "#272727"
image: 'assets/images/logo-PubX-Mobile.png'
image_dark: 'assets/images/logo-PubX-Mobile.png'
android_12:
image: 'assets/images/logo-PubX-Mobile.png'
icon_background_color: "#ffffff"
image_dark: 'assets/images/logo-PubX-Mobile.png'
icon_background_color_dark: "#272727"
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
generate: true
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/images/
- assets/images/photos/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages

Related

Upgraded to Flutter 3.0 from 2.8.1, getting: Warning: Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes null error

Upgraded to Flutter 3.0 from 2.8.1, getting: Warning: Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes null error
It's on binding.dart - a file I don't touch at all.
() => PaintingBinding.instance?.imageCache?.evict(key),
^
Any chance you guys know how I can fix it?
Don't know if related, but also seeing this a lot:
Class 'kotlin.Unit' was compiled with an incompatible version
Used the guide here to migrate: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
This is my pubspec:
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
google_maps_flutter: ^2.0.6
rxdart:
shimmer:
cupertino_icons: ^1.0.3
dependencies:
flutter_svg: ^1.0.0
http: ^0.13.3
flutter_spinkit: ^5.0.0
url_launcher: ^6.0.9
html: ^0.15.0
cached_network_image: ^3.1.0
collection: ^1.15.0
share_plus: ^3.0.4
flutter_native_splash: ^1.3.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.9.2
flutter_icons:
android: true
ios: true
image_path: "assets/app/launch/ic_launcher.png"
adaptive_icon_padding: true
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
So, something which helped me:
remove the next folder /Users/your-user/.pub-cache/hosted/pub.dartlang.org
hit flutter pub upgrade
and then try to run your project 🎉
For the ones that have the same issue: changing my Kotlin version (manually), did the trick.
Now, in build.gradle:
buildscript {
ext.kotlin_version = '1.6.21'
repositories {
google()
jcenter()
}
I have this instead of version 1.3.40
remove "?" at () => PaintingBinding.instance?.imageCache?.evict(key),

flutter_whatsapp depends on both integration_test ^1.0.2+3 and flutter_driver any from sdk, version solving failed

Because every version of flutter_driver from sdk depends on vm_service 7.3.0 and integration_test 1.0.2+3 depends on vm_service >=4.2.0 <7.0.0, flutter_driver from sdk is incompatible with integration_test 1.0.2+3.
And because no versions of integration_test match >1.0.2+3 <2.0.0, flutter_driver from sdk is incompatible with integration_test ^1.0.2+3.
So, because flutter_whatsapp depends on both integration_test ^1.0.2+3 and flutter_driver any from sdk, version solving failed.
Running "flutter pub get" in flutter_whatsapp...
pub get failed (1; So, because flutter_whatsapp depends on both integration_test ^1.0.2+3 and flutter_driver any from sdk, version solving
failed.)
Am getting this kinda error
Thanks in advance...
name: flutter_whatsapp
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.3
ext_storage: ^1.0.3
intl: ^0.17.0
http: ^0.13.4
contacts_service: ^0.6.3
cached_network_image: ^3.1.0
camera: ^0.9.4+3
# video_player: ^0.10.0+5
path_provider: ^2.0.6
fluro: ^2.0.3
sliding_up_panel: ^2.0.0+1
flutter_app_badger: ^1.3.0
url_launcher: ^6.0.12
shared_preferences: ^2.0.8
android_intent: ^0.3.7+6
permission_handler: ^8.2.5
integration_test: ^1.0.2+3
uuid: ^3.0.5
# fast_qr_reader_view: ^0.1.5
# fast_qr_reader_view:
# git:
# url: git://github.com/facundomedica/fast_qr_reader_view.git
dev_dependencies:
flutter_driver:
sdk: flutter
flutter_test:
sdk: flutter
version: any
# test: ^1.5.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages

error: package com.flutter.stripe does not exist

I'm trying to run an implementation of flutter_stripe in my Flutter project, following this video. When I run the project, this error occurs:
C:\Users\Braiscompany\Documents\Braiscompany-Bag\bag\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:31: error: package com.flutter.stripe does not exist
flutterEngine.getPlugins().add(new com.flutter.stripe.StripeAndroidPlugin());
^
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 50s
Exception: Gradle task assembleDebug failed with exit code 1
Somebody already had and solve this error? Because I don't know what is occurring. Thanks for the attention.
Edit: As they asked me in the comments, this is the pubspec.yaml file of my project. The Android Studio don't report any error.
name: ***
description: ***
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.12
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
getwidget: ^2.0.4 #colocar o avatar retangular
cupertino_icons: ^1.0.3
firebase_core: ^1.6.0 # recursos basicos do firebase
cloud_firestore: ^2.5.1 # banco de dados
firebase_storage: ^8.0.0 # armazenamento de arquivos
firebase_auth: ^3.1.0 # autenticacao do usuario
google_fonts: ^2.1.0 # fontes do google
image_picker: ^0.6.0+10 #selecionar imagens
brasil_fields: ^1.1.4 # aplicar padrões brasileiros
intl: ^0.17.0 # aplicar padrões monetarios
carousel_pro: ^1.0.0 # carousel do detalhesBagagem
google_sign_in: ^5.0.7
shared_preferences: ^2.0.7
random_string: ^2.3.1
rounded_loading_button: ^2.0.5
load: ^1.0.0
ionicons: ^0.1.2 # icones do ionicons
flutter_spinkit: ^5.1.0 # spinners para os loadings
flutter_datetime_picker: ^1.5.1 # picker de data e hora
animations: ^2.0.1 # animações em flutter
#flutter_facebook_login: ^3.0.0 # import para login do facebook
flutter_rating_bar: ^4.0.0 # barra de avaliacao
rating_dialog: ^2.0.1 # avaliacao para o feedback do usuario
search_widget: ^1.0.2 # busca para mensagens de usuario
#onesignal_flutter: ^3.2.3 # notificações
firebase_messaging: ^10.0.6 # notificações do firebase
toggle_switch: ^1.2.0 # botao binario de switch
customtoggleswitch: ^1.1.0 # botao de toggle switch
http: ^0.13.3 # API para requisicoes em http
flutter_animated_dialog: ^2.0.1 #Permite Dialogs Animados
image_cropper: ^1.4.1 # ajuste de tamanho da imagem
date_format: ^2.0.4 # formatacao de data
autocomplete_textfield: ^1.7.3 # autocomplete para inputs
basic_utils: ^3.5.0 # utilidades basicas
password_strength: ^0.2.0 # forca da senha
intro_slider: ^3.0.2 # slides de introducao
#about: ^1.4.0 # pagina de "sobre"
flutter_svg: ^0.22.0 # permite adicionar um arquivo svg ao projeto
url_launcher: ^6.0.10 # acesso de URLs no app
qr_flutter: ^4.0.0 # plugin de QR Code
share_extend: ^2.0.0 # compartilhamento de arquivos
path_provider: ^2.0.3 # para converter arquivos
email_validator: ^2.0.1 # validar email
syncfusion_flutter_sliders: ^19.2.59 # para fazer o slider de saque
flutter_launcher_icons: ^0.9.2 # para o icone do ap
#cielo_ecommerce: any # para a API de pagamentos
credit_card_field: ^1.0.2 # para a animacao do cartao de credito
flutter_credit_card: ^2.0.0 # para animacao do cartao de credito
#stripe_payment: ^1.1.1 # pagamentos via stripe
flutter_stripe: ^1.3.0 # pagamentoa via stripe
stripe_sdk: any
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
assets:
- images/logo1.png
- images/logo2.png
- images/facebook.png
- images/usuario.png
- images/b-background-conversas.jpg
- images/briefcase1.png
- images/briefcase2.png
- images/Group1.png
- images/Logo.png
- images/google.png
- images/google2.png
- images/facebook2.png
- images/intro1.png
- images/vendaBagagemInicial.png
- images/vendaBagagemInicial2.png
- images/vendaBagagemInicial3.png
- images/vendaBagagemInicial4.png
- images/vendaBagagemInicial5.png
- images/vendaBagagemInicial6.png
- images/vendaBagagemInicial7.png
- images/iconeCompletoVertical.png
- images/logoTotal-old.svg
- images/logoSVG.svg
- images/qrcode.png
- images/beta.png
- images/google-logo.png
- images/facebook-logo.png
- texts/devs.md
- texts/termos-de-uso.md
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages

Target of URI doesn't exist: 'package:flutter_riverpod/flutter_riverpod.dart'

I am now compile my project but shows this error:
Target of URI doesn't exist: 'package:flutter_riverpod/flutter_riverpod.dart'.
this is my full code:
import 'package:Cruise/src/widgets/CruiseApp.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:Cruise/src/common/history.dart';
import 'package:Cruise/src/common/theme.dart';
import 'package:Cruise/src/common/view_manager.dart';
import 'package:timeago/timeago.dart' as timeago;
class CustomEn extends timeago.EnMessages {
#override
String suffixAgo() => '';
String minutes(int minutes) => '${minutes}m';
String hours(int hours) => '${hours}h';
String days(int days) => '${days}d';
}
void main() async{
WidgetsFlutterBinding.ensureInitialized();
timeago.setLocaleMessages('en', CustomEn());
await HistoryManager.init();
SharedPreferences pref = await SharedPreferences.getInstance();
String themeName = pref.getString('theme');
final theme = ThemeManager.fromThemeName(themeName);
String viewName = pref.getString('view');
final view = ViewManager.fromViewName(viewName);
runApp(ProviderScope(child: CruiseApp(theme: theme, view: view)));
}
and this is pubspec.yaml:
name: Cruise
description: A article read Flutter application.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_gallery: ^2.4.0+20400
rally_assets: ^2.0.0
meta: ^1.1.8
scoped_model: ^1.1.0
shrine_images: ^1.1.2
flare_dart: ^2.3.4
flare_flutter: ^2.0.2
vector_math: ^2.0.8
collection: ^1.14.0
flutter_gallery_assets: ^0.2.6
package_info: ^0.4.0
google_fonts: ^1.0.0
flutter_staggered_grid_view: ^0.3.0
provider: ^4.3.2
adaptive_breakpoints: ^0.0.2
cupertino_icons: ^0.1.3
hooks_riverpod: ^0.5.1
http: ^0.12.0+2
flutter_icons: ^1.0.0
timeago: ^2.0.26
animations: ^1.1.2
flutter_hooks: ^0.12.0
share: ^0.6.4+3
shimmer: ^1.1.1
url_launcher: ^5.5.0
uni_links: ^0.4.0
flutter_html: ^1.0.0
shared_preferences: ^0.5.8
state_notifier: ^0.5.0
flutter_secure_storage: ^3.3.3
flutter_slidable: "^0.5.5"
hive: ^1.4.1+1
pull_to_refresh: ^1.6.1
intl_phone_number_input: ^0.5.2+2
dio: 3.0.10
intl: ^0.16.0
flutter_localized_locales: ^1.1.1
hive_flutter:
git:
url: https://github.com/hivedb/hive.git
path: hive_flutter
dev_dependencies:
intl_translation: ^0.17.9
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
test:
path:
args:
grinder: ^0.8.0
pedantic: ^1.9.0
string_scanner: ^1.0.5
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
generate: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
this is what I have tried:
invalidate android studio cache and restart
run command flutter clean
run flutter packages get
run flutter packages upgrade
flutter pub cache repair
but still not work, what is the reason and what should I do to make it work? this is the env info:
~/source/third-party/Cruise/ios on  master! ⌚ 23:44:37
$ ~/apps/flutter/bin/flutter --version
Flutter 1.24.0-4.0.pre.165 • channel master • https://github.com/flutter/flutter.git
Framework • revision e444b1e3fa (11 hours ago) • 2020-10-30 00:41:52 -0400
Engine • revision 99cc50dfff
Tools • Dart 2.11.0 (build 2.11.0-266.0.dev)
(base)
the logs output:
import 'package:flutter_riverpod/flutter_riverpod.dart';
^
lib/src/widgets/CruiseApp.dart:4:8: Error: Error when reading '../../../.pub-cache/hosted/mirrors.tuna.tsinghua.edu.cnGdart-pub/flutter_riverpod-0.5.1/lib/flutter_riverpod.dart': No such file or directory
import 'package:flutter_riverpod/flutter_riverpod.dart';
I rename the ~/.pub-cache/hosted/ mirrir name, now I could successful compile in command line, but when I compile using android studio, shows like this :
what should I do to add cache path into my project?
you have
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
If you are using hooks, use hooks_riverpod, if not, use flutter_riverpod. I don't see a reason why you should be using both of them.
Also, the error makes sense, because you don't have flutter_riverpod in package.yaml

Dependence incompatible in my flutter project

[source] flutter.bat pub get
Running "flutter pub get" in source...
Because rate_my_app >=0.6.0+3 depends on shared_preferences ^0.5.7 and fstore depends on shared_preferences 0.5.3+4, rate_my_app >=0.6.0+3 is forbidden.
So, because fstore depends on rate_my_app ^0.6.1+2, version solving failed.
pub get failed (1; So, because fstore depends on rate_my_app ^0.6.1+2, version solving failed.)
exit code 1
Here is my pubspec.yaml:
name: fstore
description: Mobile commerce app by Flutter
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# `enter code here`https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.3.0+1
environment:
sdk: ">=2.2.2 <3.0.0"
dependencies:
logs:
git: https://github.com/pq/logs
flutter:
sdk: flutter
intl: 0.16.1
http: 0.12.0+2
html_unescape: 1.0.1+3
provider: ^3.0.0+1
flutter_signin_button: ^0.2.8
after_layout: 1.0.7+2
font_awesome_flutter: ^8.5.0
path: 1.7.0
flutter_facebook_login: ^2.0.1
flutter_account_kit: 0.7.0
vector_math: 2.0.8
carousel_pro: ^1.0.0
flutter_widget_from_html_core: ^0.2.2+1
configurable_expansion_tile: ^1.0.0
timeago: ^2.0.18
share: ^0.6.2+1
validate: ^1.7.0
country_pickers: ^1.1.0
shared_preferences: ^0.5.7
firebase_messaging: 5.1.2
firebase_analytics: 4.0.2
transparent_image: 1.0.0
pull_to_refresh: ^1.5.0
localstorage: ^2.0.0
notification_permissions: ^0.4.0
flare_splash_screen: 2.1.3
rate_my_app: ^0.6.0+3
flutter_range_slider: ^1.3.1
page_indicator: ^0.2.0
global_configuration: ^1.1.0
extended_image: 0.5.3
flutter_screenutil: 0.5.3
fluttertoast: ^3.1.0
intro_slider: ^2.2.5
url_launcher: ^5.1.0
firebase_core: ^0.4.0+8
firebase_auth: ^0.11.1+12
cloud_firestore: ^0.12.7+1
firestore_ui: ^1.6.0
flutter_webview_plugin: ^0.3.5
connectivity: ^0.4.3+6
random_string: ^1.1.0
google_maps_flutter: 0.5.19+2
place_picker: 0.9.8
cached_network_image: ^2.0.0-rc
firebase_storage: ^3.0.4
image_picker: ^0.6.0+17
fab_circular_menu: 0.1.1
uuid: ^2.0.2
flutter_localizations:
sdk: flutter
dev_dependencies:
flutter_launcher_icons: ^0.7.2+1
flutter_test:
sdk: flutter
# Run this script to generate the app icon: flutter pub pub run flutter_launcher_icons:main
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/app_icon.png"
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
uses-material-design: true
assets:
- lib/common/config.json
- assets/icons/categories/
- assets/icons/tabs/
- assets/icons/profile/
- assets/icons/payment/
- assets/images/
- assets/images/country/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.io/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
fonts:
- family: Raleway
fonts:
- asset: assets/fonts/Raleway-Regular.ttf
- asset: assets/fonts/Raleway-Medium.ttf
- asset: assets/fonts/Raleway-Bold.ttf
- asset: assets/fonts/Raleway-Light.ttf
- asset: assets/fonts/Raleway-Thin.ttf
- family: Roboto
fonts:
- asset: assets/fonts/Roboto-Regular.ttf
- asset: assets/fonts/Roboto-Medium.ttf
- asset: assets/fonts/Roboto-Bold.ttf
- asset: assets/fonts/Roboto-Light.ttf
- asset: assets/fonts/Roboto-Thin.ttf
#
# For details regarding fonts from package dependencies,
# see https://flutter.io/custom-fonts/#from-packages
I have this problem how can i solve it?
I'd suggest looking here:
https://dart.dev/tools/pub/dependencies#dependency-overrides
You can override the version number of all dependencies, but be careful as later versions might contain breaking changes that your dependencies might not work with.
In your pubspec.yaml file, add this:
dependency_overrides:
rate_my_app: ^0.6.0+3
I have solved this. You need to update the rate_my_app to 0.6.0+3 and shared_preferences to 0.5.7+3 and then hit packages get.