when trying to get data from firestore in release mode "null" is always returned but not in debug or profile
Steps to reproduce
Steps to reproduce the behavior:
flutter run --release
no data comes at all from firebase
Expected behavior
as debug and profile it should get all data from firebase
Sample project
repository :
import 'package:cloud_firestore/cloud_firestore.dart';
import '../../../domain/models/yearmodel.dart';
import '../../../domain/years/contracts/i.years.repository.dart';
class YearsRepository implements IYearsRepository {
final _firestore = FirebaseFirestore.instance;
static const String yearscollection = "years";
#override
Stream<YearsModel> get yearsStream {
final docRef = _firestore.collection(yearscollection).doc("classes");
final snapshots = docRef.snapshots();
return snapshots.map((current) {
print(current.data());
return YearsModel.fromJson(current.data()!);
});
}
}
ui with flutter hooks and riverpod :
years.when(
data: (years) {
print(years);
return Column(children: [
SizedBox(
height: 250,
child: CupertinoPicker(
looping: true,
children: years.classes!
.map((e) => Center(
child: Text(e.name!),
))
.toList(),
itemExtent: 46,
onSelectedItemChanged: (index) async {
isclinical.value =
years.classes![index].isclinical!;
yearId.value = years.classes![index].id!;
yearName.value = years.classes![index].name!;
},
),
),
const SizedBox(
height: 10,
),
Container(
height: 50,
width: 210,
decoration: BoxDecoration(
border: Border.all(color: Colors.blue),
borderRadius: BorderRadius.circular(15),
color: Colors.white.withOpacity(0.1)),
child: Center(
child: Text(
yearName.value,
style: const TextStyle(fontSize: 24),
)),
)
]);
},
loading: () => const ShimmerAffect(height: 100, width: 100),
error: (error, stack) {
print("$error.toString");
Center(
child: Text("$error"),
);
Additional context
when the provider is triggered , it always hits the error: (error, stack) block
Flutter doctor
kivocsa99#kivocsa99:~$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.5.2, on Ubuntu 20.04.3 LTS 5.11.0-37-generic,
locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] Android Studio
[✓] VS Code
[✓] Connected device (2 available)
• No issues found!
Flutter dependencies
~/AndroidStudioProjectsssd/mscmu$ flutter pub deps -- --style=compactDart SDK 2.14.3Flutter SDK 2.5.2mscmu 1.0.0+1
dependencies:
- android_path_provider 0.3.0 [flutter]
- audio_session 0.1.6+1 [flutter flutter_web_plugins rxdart meta]
- cached_network_image 3.1.0 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web]
- carousel_slider 4.0.0 [flutter]
- cloud_firestore 2.5.3 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- cupertino_icons 1.0.3
- dartz 0.10.0
- expandable 5.0.1 [flutter]
- expandable_text 2.2.0 [flutter]
- file_picker 4.1.3 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path]
- firebase_auth 3.1.3 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 1.7.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_messaging 10.0.8 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- firebase_storage 10.0.5 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- flutter_downloader 1.7.0 [flutter]
- flutter_hooks 0.18.0 [flutter]
- flutter_slidable 0.6.0 [flutter]
- font_awesome_flutter 9.1.0 [flutter]
- form_field_validator 1.1.0 [flutter intl]
- freezed_annotation 0.14.3 [collection json_annotation meta]
- hooks_riverpod 0.14.0+5 [collection flutter flutter_hooks flutter_riverpod riverpod state_notifier]
- http 0.13.4 [async http_parser meta path]
- introduction_screen 2.1.0 [flutter dots_indicator]
- json_serializable 5.0.2 [analyzer build build_config collection json_annotation meta path source_gen source_helper]
- just_audio 0.9.12 [just_audio_platform_interface just_audio_web audio_session rxdart path path_provider async uuid crypto meta flutter]
- just_audio_libwinmedia 0.0.4 [flutter just_audio_platform_interface libwinmedia]
- logger 1.1.0
- motion_toast 1.5.0 [flutter]
- path_provider 2.0.5 [flutter path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows]
- permission_handler 8.2.2 [flutter meta permission_handler_platform_interface]
- photo_view 0.13.0 [flutter]
- rxdart 0.27.2
- share 2.0.4 [meta mime flutter]
- shared_preferences 2.0.8 [flutter meta shared_preferences_linux shared_preferences_macos shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- shimmer 2.0.0 [flutter]
- url_launcher 6.0.12 [flutter meta url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
dev dependencies:
- build_runner 2.1.4 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- flutter_lints 1.0.4 [lints]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]
- freezed 0.14.5 [analyzer build build_config collection meta source_gen freezed_annotation]
transitive dependencies:
- _fe_analyzer_shared 28.0.0 [meta]
- analyzer 2.5.0 [_fe_analyzer_shared cli_util collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- args 2.3.0
- async 2.8.1 [collection meta]
- boolean_selector 2.1.0 [source_span string_scanner]
- build 2.1.1 [analyzer async convert crypto glob logging meta path]
- build_config 1.0.0 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.0.1 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.0.4 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.2 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.1.2 [built_collection collection fixnum meta]
- cached_network_image_platform_interface 1.0.0 [flutter flutter_cache_manager]
- cached_network_image_web 1.0.1 [flutter flutter_cache_manager cached_network_image_platform_interface]
- characters 1.1.0
- charcode 1.3.1
- checked_yaml 2.0.1 [json_annotation source_span yaml]
- cli_util 0.3.4 [meta path]
- clock 1.1.0
- cloud_firestore_platform_interface 5.4.2 [collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 2.4.3 [cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js]
- code_builder 4.1.0 [built_collection built_value collection matcher meta]
- collection 1.15.0
- convert 3.0.1 [typed_data]
- crypto 3.0.1 [collection typed_data]
- dart_style 2.2.0 [analyzer args path pub_semver source_span]
- dots_indicator 2.0.0 [flutter]
- fake_async 1.2.0 [clock collection]
- ffi 1.1.2
- file 6.1.2 [meta path]
- firebase_auth_platform_interface 6.1.1 [firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 3.1.2 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta]
- firebase_core_platform_interface 4.0.1 [collection flutter meta plugin_platform_interface]
- firebase_core_web 1.1.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_messaging_platform_interface 3.0.6 [firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 2.0.6 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- firebase_storage_platform_interface 4.0.3 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_storage_web 3.0.3 [async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta]
- fixnum 1.0.0
- flutter_blurhash 0.6.0 [flutter meta pedantic]
- flutter_cache_manager 3.1.2 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid]
- flutter_plugin_android_lifecycle 2.0.3 [flutter]
- flutter_riverpod 0.14.0+3 [collection flutter meta riverpod state_notifier]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- frontend_server_client 2.1.2 [async path]
- glob 2.0.2 [async collection file path string_scanner]
- graphs 2.1.0 [collection]
- http_multi_server 3.0.1 [async]
- http_parser 4.0.0 [charcode collection source_span string_scanner typed_data]
- intl 0.17.0 [clock path]
- io 1.0.3 [meta path string_scanner]
- js 0.6.3
- json_annotation 4.1.0 [meta]
- just_audio_platform_interface 4.0.0 [flutter plugin_platform_interface]
- just_audio_web 0.4.2 [just_audio_platform_interface flutter flutter_web_plugins]
- libwinmedia 0.0.7 [ffi path]
- lints 1.0.1
- logging 1.0.2
- matcher 0.12.10 [stack_trace]
- meta 1.7.0
- mime 1.0.0
- octo_image 1.0.0+1 [flutter flutter_blurhash]
- package_config 2.0.2 [path]
- path 1.8.0
- path_provider_linux 2.1.0 [flutter path path_provider_platform_interface xdg_directories]
- path_provider_macos 2.0.2 [flutter]
- path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface]
- path_provider_windows 2.0.3 [ffi flutter meta path path_provider_platform_interface win32]
- pedantic 1.11.1
- permission_handler_platform_interface 3.7.0 [flutter meta plugin_platform_interface]
- platform 3.0.2
- plugin_platform_interface 2.0.2 [meta]
- pool 1.5.0 [async stack_trace]
- process 4.2.3 [file path platform]
- pub_semver 2.1.0 [collection meta]
- pubspec_parse 1.1.0 [checked_yaml collection json_annotation pub_semver yaml]
- riverpod 0.14.0+3 [collection freezed_annotation meta state_notifier]
- shared_preferences_linux 2.0.2 [file meta flutter path path_provider_linux shared_preferences_platform_interface]
- shared_preferences_macos 2.0.2 [flutter shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.0.0 [flutter]
- shared_preferences_web 2.0.2 [flutter flutter_web_plugins meta shared_preferences_platform_interface]
- shared_preferences_windows 2.0.2 [flutter file meta path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface]
- shelf 1.2.0 [async collection http_parser path stack_trace stream_channel]
- shelf_web_socket 1.0.1 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- source_gen 1.1.1 [analyzer async build dart_style glob meta path source_span yaml]
- source_helper 1.3.0 [analyzer collection source_gen]
- source_span 1.8.1 [collection path term_glyph]
- sqflite 2.0.0+4 [flutter sqflite_common path]
- sqflite_common 2.0.1+1 [synchronized path meta]
- stack_trace 1.10.0 [path]
- state_notifier 0.7.1 [meta]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.0 [charcode source_span]
- synchronized 3.0.0
- term_glyph 1.2.0
- test_api 0.4.2 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- timing 1.0.0 [json_annotation]
- typed_data 1.3.0 [collection]
- url_launcher_linux 2.0.2 [flutter]
- url_launcher_macos 2.0.2 [flutter]
- url_launcher_platform_interface 2.0.4 [flutter plugin_platform_interface]
- url_launcher_web 2.0.4 [flutter flutter_web_plugins meta url_launcher_platform_interface]
- url_launcher_windows 2.0.2 [flutter]
- uuid 3.0.5 [crypto]
- vector_math 2.1.0
- watcher 1.0.1 [async path]
- web_socket_channel 2.1.0 [async crypto stream_channel]
- win32 2.2.9 [ffi]
- xdg_directories 0.2.0 [meta path process]
- yaml 3.1.0 [collection source_span string_scanner]```
</details>
---
You may not give permission to access the internet.
Go to android/app/src/main/AndroidManifest.xml and insert this line in the manifest:
<uses-permission android:name="android.permission.INTERNET"/>
UPDATE:
Another reason may be that you did not give permission from Firestore.
For this, go to the project > Firestore > Rules
Then, modify the line which contains "allow"(mostly line 5) to:
allow read, write;
I hope that my answer will help you! :)
Related
This is the what I am getting in Android Studio
FAILURE: Build failed with an exception.
Where:
Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159
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
I tried using flutter pub upgrade --major-versions but the issue has not been resolved.
This is what it showed after using flutter pub upgrade --major-versions
Resolving dependencies...
async 2.9.0 (2.10.0 available)
boolean_selector 2.1.0 (2.1.1 available)
characters 1.2.1
clock 1.1.1
collection 1.16.0 (1.17.0 available)
cupertino_icons 1.0.5
fake_async 1.3.1
flutter 0.0.0 from sdk flutter
flutter_test 0.0.0 from sdk flutter
matcher 0.12.12 (0.12.14 available)
material_color_utilities 0.1.5 (0.2.0 available)
meta 1.8.0
path 1.8.2 (1.8.3 available)
sky_engine 0.0.99 from sdk flutter
source_span 1.9.0 (1.9.1 available)
stack_trace 1.10.0 (1.11.0 available)
stream_channel 2.1.0 (2.1.1 available)
string_scanner 1.1.1 (1.2.0 available)
term_glyph 1.2.1
test_api 0.4.12 (0.4.17 available)
vector_math 2.1.2 (2.1.4 available)
No dependencies changed.
12 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Upon using flutter pub outdated this is what I got
[*] indicates versions that are not the latest available.
Package Name Current Upgradable Resolvable Latest
direct dependencies: all up-to-date.
transitive dependencies:
collection *1.16.0 *1.16.0 *1.16.0 1.17.0
material_color_utilities *0.1.5 *0.1.5 *0.1.5 0.2.0
vector_math *2.1.2 *2.1.2 *2.1.2 2.1.4
transitive dev_dependencies:
async *2.9.0 *2.9.0 *2.9.0 2.10.0
boolean_selector *2.1.0 *2.1.0 *2.1.0 2.1.1
matcher *0.12.12 *0.12.12 *0.12.12 0.12.14
path *1.8.2 *1.8.2 *1.8.2 1.8.3
source_span *1.9.0 *1.9.0 *1.9.0 1.9.1
stack_trace *1.10.0 *1.10.0 *1.10.0 1.11.0
stream_channel *2.1.0 *2.1.0 *2.1.0 2.1.1
string_scanner *1.1.1 *1.1.1 *1.1.1 1.2.0
test_api *0.4.12 *0.4.12 *0.4.12 0.4.17
all dependencies are up-to-date.
Can someone please tell me how to solve this issue? I cannot figure out what needs to be done here.
I keep getting the same error code.
How to update these dependencies to the newer version? I don't know how to do it.
I have this libraries in my project:
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
after_layout: ^1.1.0
alt_sms_autofill: ^1.0.0
another_flushbar: ^1.10.24
avatar_glow: ^2.0.2
barcode_scan2: ^4.1.4
camera: ^0.9.2+2
carousel_slider: ^4.0.0
catcher: ^0.6.8
charts_flutter: ^0.11.0
contacts_service: ^0.6.3
crypto: ^3.0.1
cryptography: ^2.0.2
cupertino_icons: ^1.0.3
device_info: ^2.0.3
dio: ^4.0.1
dotted_border: ^2.0.0+1
encrypt: ^5.0.1
file_picker: ^4.2.0
firebase_messaging: ^10.0.9
flutter:
sdk: flutter
flutter_inappwebview: ^5.3.2
flutter_keyboard_visibility: ^5.1.0
flutter_rating_bar: ^4.0.0
flutter_slidable: ^0.6.0
flutter_svg: ^0.23.0+1
fluttertoast: ^8.0.8
font_awesome_flutter: ^9.2.0
geolocator: ^7.7.1
get_it: ^7.1.3
hive: ^2.0.4
hive_flutter: ^1.1.0
http: ^0.13.3
image_cropper: ^1.4.1
image_gallery_saver: ^1.7.1
image_picker: ^0.8.4+1
installed_apps: ^1.2.0
intl: ^0.17.0
introduction_screen: ^2.1.0
json_annotation: ^4.0.1
local_auth: ^1.1.7
logger: ^1.1.0
mask_text_input_formatter: ^2.0.0
otp: ^3.0.1
overlay_support: ^1.2.1
package_info_plus: ^1.3.0
page_view_indicators: ^2.0.0
path_provider: ^2.0.4
permission_handler: ^8.1.6
persian: ^1.1.1
persian_datetime_picker:
path: packages/persian_datetime_picker
persian_number_utility: ^1.1.0
provider: ^6.0.1
quick_actions: ^0.6.0+6
retrofit: ^2.1.0
rxdart: ^0.27.2
screenshot: ^1.2.3
shared_preferences: ^2.0.7
sqflite: ^2.0.0+4
timezone: ^0.8.0
universal_html: ^2.0.8
url_launcher: ^6.0.10
url_strategy: ^0.2.0
uuid: ^3.0.5
video_player: ^2.2.3
visibility_detector: ^0.2.2
wc_flutter_share: ^0.4.0
webview_flutter: ^2.0.13
dev_dependencies:
build_runner: ^2.1.2
flutter_localizations:
sdk: flutter
flutter_test:
sdk: flutter
hive_generator: ^1.1.1
http_mock_adapter: ^0.3.2
json_serializable: ^4.1.4
mockito: ^5.0.15
retrofit_generator: ^2.0.1
I run this command and It's result:
$ flutter pub upgrade --null-safety
Resolving dependencies...
_fe_analyzer_shared 22.0.0 (30.0.0 available)
after_layout 1.1.0
alt_sms_autofill 1.0.0
analyzer 1.7.1 (2.7.0 available)
another_flushbar 1.10.24
args 2.3.0
asn1lib 1.0.2
async 2.5.0 (2.8.2 available)
avatar_glow 2.0.2
barcode_scan2 4.1.4
base32 2.1.1
boolean_selector 2.1.0
build 2.1.0 (2.1.1 available)
build_config 1.0.0
build_daemon 3.0.0 (3.0.1 available)
build_resolvers 2.0.4
build_runner 2.1.2 (2.1.4 available)
build_runner_core 7.1.0 (7.2.2 available)
built_collection 5.1.1
built_value 8.1.3
camera 0.9.2+2 (0.9.4+3 available)
camera_platform_interface 2.1.1
carousel_slider 4.0.0
catcher 0.6.8
characters 1.1.0 (1.2.0 available)
charcode 1.2.0 (1.3.1 available)
charts_common 0.11.0 (0.12.0 available)
charts_flutter 0.11.0
checked_yaml 2.0.1
cli_util 0.3.5
clock 1.1.0
code_builder 4.1.0
collection 1.15.0
contacts_service 0.6.3
convert 3.0.1
cross_file 0.3.2
crypto 3.0.1
cryptography 2.0.2
csslib 0.17.1
cupertino_icons 1.0.3
dart_style 2.1.1 (2.2.0 available)
device_info 2.0.3
device_info_platform_interface 2.0.1
device_info_plus 2.2.0 (3.1.0 available)
device_info_plus_linux 2.1.0
device_info_plus_macos 2.2.0
device_info_plus_platform_interface 2.2.0
device_info_plus_web 2.1.0
device_info_plus_windows 2.1.0
dio 4.0.1
dio_http 5.0.4
dots_indicator 2.0.0
dotted_border 2.0.0+1
encrypt 5.0.1
fake_async 1.2.0
ffi 1.1.2
file 6.1.2
file_picker 4.2.0
firebase_core 1.8.0
firebase_core_platform_interface 4.0.1
firebase_core_web 1.1.0
firebase_messaging 10.0.9
firebase_messaging_platform_interface 3.0.7
firebase_messaging_web 2.0.7
fixnum 1.0.0
flutter 0.0.0 from sdk flutter
flutter_inappwebview 5.3.2
flutter_keyboard_visibility 5.1.0
flutter_keyboard_visibility_platform_interface 2.0.0
flutter_keyboard_visibility_web 2.0.0
flutter_localizations 0.0.0 from sdk flutter
flutter_mailer 2.0.0
flutter_plugin_android_lifecycle 2.0.4
flutter_rating_bar 4.0.0
flutter_slidable 0.6.0
flutter_svg 0.23.0+1
flutter_test 0.0.0 from sdk flutter
flutter_web_plugins 0.0.0 from sdk flutter
fluttertoast 8.0.8
font_awesome_flutter 9.2.0
frontend_server_client 2.1.2
geolocator 7.7.1
geolocator_android 2.1.0
geolocator_apple 1.2.2
geolocator_platform_interface 2.3.6
geolocator_web 2.0.6
get_it 7.1.3 (7.2.0 available)
glob 2.0.1 (2.0.2 available)
graphs 2.1.0
hive 2.0.4
hive_flutter 1.1.0
hive_generator 1.1.1
html 0.15.0
http 0.13.3 (0.13.4 available)
http_mock_adapter 0.3.2
http_multi_server 3.0.1
http_parser 4.0.0
image_cropper 1.4.1
image_gallery_saver 1.7.1
image_picker 0.8.4+1 (0.8.4+4 available)
image_picker_for_web 2.1.4
image_picker_platform_interface 2.4.1
installed_apps 1.2.0
intl 0.17.0
introduction_screen 2.1.0
io 1.0.3
js 0.6.3
json_annotation 4.0.1 (4.3.0 available)
json_serializable 4.1.4 (6.0.1 available)
local_auth 1.1.7 (1.1.8 available)
logger 1.1.0
logging 1.0.2
mailer 5.0.2
mask_text_input_formatter 2.0.0
matcher 0.12.10 (0.12.11 available)
meta 1.3.0 (1.7.0 available)
mime 1.0.1
mockito 5.0.15 (5.0.16 available)
nested 1.0.0
otp 3.0.1
overlay_support 1.2.1
package_config 2.0.2
package_info_plus 1.3.0
package_info_plus_linux 1.0.3
package_info_plus_macos 1.3.0
package_info_plus_platform_interface 1.0.2
package_info_plus_web 1.0.4
package_info_plus_windows 1.0.4
page_view_indicators 2.0.0
path 1.8.0
path_drawing 0.5.1+1
path_parsing 0.2.1
path_provider 2.0.4 (2.0.6 available)
path_provider_linux 2.1.0
path_provider_macos 2.0.2
path_provider_platform_interface 2.0.1
path_provider_windows 2.0.3
pedantic 1.11.1 (discontinued replaced by lints)
permission_handler 8.1.6 (8.2.5 available)
permission_handler_platform_interface 3.6.1 (3.7.0 available)
persian 1.1.1
persian_datetime_picker 2.0.0 from path packages/persian_datetime_picker
persian_number_utility 1.1.0
petitparser 4.1.0 (4.4.0 available)
platform 3.0.2
plugin_platform_interface 2.0.2
pointycastle 3.3.5
pool 1.5.0
process 4.2.3 (4.2.4 available)
protobuf 2.0.0
provider 6.0.1
pub_semver 2.1.0
pubspec_parse 1.0.0 (1.1.0 available)
quick_actions 0.6.0+6 (0.6.0+7 available)
quick_actions_platform_interface 1.0.0
quiver 3.0.1+1
retrofit 2.1.0
retrofit_generator 2.0.1 (2.1.0+1 available)
rxdart 0.27.2
screenshot 1.2.3
sentry 5.1.0 (6.0.1 available)
shamsi_date 0.16.0
shared_preferences 2.0.7 (2.0.8 available)
shared_preferences_linux 2.0.2
shared_preferences_macos 2.0.2
shared_preferences_platform_interface 2.0.0
shared_preferences_web 2.0.2
shared_preferences_windows 2.0.2
shelf 1.2.0
shelf_web_socket 1.0.1
sky_engine 0.0.99 from sdk flutter
source_gen 1.0.3 (1.1.1 available)
source_helper 1.3.0
source_span 1.8.0 (1.8.1 available)
sqflite 2.0.0+4
sqflite_common 2.0.1+1
stack_trace 1.10.0
stream_channel 2.1.0
stream_transform 2.0.0
string_scanner 1.1.0
synchronized 3.0.0
term_glyph 1.2.0
test_api 0.2.19 (0.4.7 available)
timezone 0.8.0
timing 1.0.0
tuple 2.0.0
typed_data 1.3.0
universal_html 2.0.8
universal_io 2.0.4
url_launcher 6.0.10 (6.0.12 available)
url_launcher_linux 2.0.2
url_launcher_macos 2.0.2
url_launcher_platform_interface 2.0.4
url_launcher_web 2.0.4
url_launcher_windows 2.0.2
url_strategy 0.2.0
uuid 3.0.5
vector_math 2.1.0 (2.1.1 available)
video_player 2.2.3 (2.2.6 available)
video_player_platform_interface 4.2.0
video_player_web 2.0.4
visibility_detector 0.2.2
watcher 1.0.0 (1.0.1 available)
wc_flutter_share 0.4.0
web_socket_channel 2.1.0
webview_flutter 2.0.13 (2.1.2 available)
win32 2.0.5 (2.2.10 available)
xdg_directories 0.2.0
xml 5.1.2 (5.3.1 available)
yaml 3.1.0
No dependencies changed.
43 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
No changes to pubspec.yaml!
Why I cant update my libs, I want to migrate my old project to null safety?
First backup your project for safety.
Try this,
flutter clean
Now delete pubspec.lock file.
Now delete all the versions from pubspec.yaml.
Leaving version number empty, let flutter decide which to use.
Upgrade SDK version,
environment:
sdk: ">=2.14.0 <3.0.0"
Now run,
flutter pub get
I have cloned this project https://github.com/2d-inc/developer_quest
and when I try to run the project on android then get the following error
The current Dart SDK version is 2.15.0-42.0.dev.
Because test >=1.16.0-nullsafety <1.16.0-nullsafety.8 requires SDK version >=2.10.0-0 <2.12.0 and test >=1.16.0-nullsafety.8 <1.16.0-nullsafety.18 depends on typed_data >=1.3.0-nullsafety <1.3.0, test >=1.16.0-nullsafety <1.16.0-nullsafety.18 requires typed_data >=1.3.0-nullsafety <1.3.0.
And because test >=1.16.0-nullsafety.18 <1.16.0-nullsafety.19 depends on test_api 0.2.19-nullsafety.7 and test >=1.3.0 <1.12.0 depends on boolean_selector ^1.0.0, test >=1.3.0 <1.12.0-∞ or >=1.16.0-nullsafety <1.16.0-nullsafety.19 requires typed_data >=1.3.0-nullsafety <1.3.0 or test_api 0.2.19-nullsafety.7 or boolean_selector ^1.0.0.
And because test >=1.12.0 <1.13.0 depends on test_api 0.2.14 and test >=1.13.0 <1.14.5 depends on test_api 0.2.15, test >=1.3.0 <1.14.5-∞ or >=1.16.0-nullsafety <1.16.0-nullsafety.19 requires typed_data >=1.3.0-nullsafety <1.3.0 or test_api 0.2.14 or 0.2.15 or 0.2.19-nullsafety.7 or boolean_selector ^1.0.0.
And because test >=1.14.5 <1.15.0 depends on test_api 0.2.16 and test >=1.15.0 <1.15.3 depends on test_api 0.2.17, test >=1.3.0 <1.15.3-∞ or >=1.16.0-nullsafety <1.16.0-nullsafety.19 requires typed_data >=1.3.0-nullsafety <1.3.0 or test_api 0.2.14 or 0.2.15 or 0.2.16 or 0.2.17 or 0.2.19-nullsafety.7 or boolean_selector ^1.0.0.
And because test >=1.15.3 <1.15.5 depends on test_api 0.2.18 and test >=1.15.5 <1.16.0-nullsafety depends on test_api 0.2.18+1, test >=1.3.0 <1.16.0-nullsafety.19 requires typed_data >=1.3.0-nullsafety <1.3.0 or test_api 0.2.14 or 0.2.15 or 0.2.16 or 0.2.17 or 0.2.18 or 0.2.18+1 or 0.2.19-nullsafety.7 or boolean_selector ^1.0.0.
And because test >=1.16.0-nullsafety.19 <1.16.6 depends on test_api 0.2.19 and every version of flutter_driver from sdk depends on boolean_selector 2.1.0, if test >=1.3.0 <1.16.6 and flutter_driver any from sdk then test_api 0.2.14 or 0.2.15 or 0.2.16 or 0.2.17 or 0.2.18 or 0.2.18+1 or 0.2.19-nullsafety.7 or 0.2.19 or typed_data >=1.3.0-nullsafety <1.3.0.
And because every version of flutter_driver from sdk depends on test_api 0.4.3 and every version of flutter_test from sdk depends on typed_data 1.3.0, one of flutter_test any from sdk or test >=1.3.0 <1.16.6 or flutter_driver any from sdk must be false.
And because test >=1.16.6 depends on webkit_inspection_protocol ^1.0.0 which depends on logging ^1.0.0, if flutter_test any from sdk and flutter_driver any from sdk and test >=1.3.0 then logging ^1.0.0.
And because dev_rpg depends on both flutter_test any from sdk and flutter_driver any from sdk, test >=1.3.0 requires logging ^1.0.0.
So, because dev_rpg depends on both logging ^0.11.3+2 and test ^1.6.1, version solving failed.
Running "flutter pub get" in developer_quest...
pub get failed (1; So, because dev_rpg depends on both logging ^0.11.3+2 and test ^1.6.1, version solving failed.)
and here is my pubspec.yaml file code
name: dev_rpg
description: Become a tech lead, slay bugs, and don't get fired.
# 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.
# Read more about versioning at semver.org.
version: 1.0.0+1
environment:
# For Google I/O we are being very specific about pinning to specific branch revision.
# This is flutter commit hash b593f5167bce84fb3cad5c258477bf3abc1b14eb, tagged
# as Flutter version 1.5.4.
sdk: ">=2.3.0-dev.0.1 <3.0.0"
dependencies:
flutter:
sdk: flutter
intl: any
provider: ^2.0.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
flare_flutter: ^1.8.3
auto_size_text: ^1.1.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
logging: ^0.11.3+2
git: ^0.5.1+1
t_stats: ^2.0.0
test: ^1.6.1
# 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:
# 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:
- assets/style_sphinx/
- assets/images/
- assets/images/2.0x/
- assets/images/3.0x/
- assets/flare/
- assets/docs/code_chomper_alpha.dart
- assets/docs/code_chomper_beta.dart
fonts:
- family: SpaceMonoRegular
fonts:
- asset: assets/fonts/SpaceMono-Regular.ttf
- family: SpaceMonoBold
fonts:
- asset: assets/fonts/SpaceMono-Bold.ttf
- family: RobotoCondensedBold
fonts:
- asset: assets/fonts/RobotoCondensed-Bold.ttf
- family: RobotoRegular
fonts:
- asset: assets/fonts/Roboto-Regular.ttf
- family: MontserratMedium
fonts:
- asset: assets/fonts/Montserrat-Medium.otf
- family: MontserratRegular
fonts:
- asset: assets/fonts/Montserrat-Regular.otf
- family: MontserratBold
fonts:
- asset: assets/fonts/Montserrat-Bold.otf
I have tried upgrading
flutter channel dev
flutter create . ```
Well as the errors say, the project has some dependencies that are not met by the version of flutter you have (because of the libraries that are shipped with flutter itself).
The pubspec.yaml of the project says it is supposed to work with flutter version 1.5.4. so, If you want to run that project you would need to download that compatible flutter sdk
How can i resolve this error, please I need help to get this resolved.
I am using the flutter dev channel
How can I resolve this error, please I need help to get this resolved.
Tried flutter channel dev also tried to flutter upgrade but nothing worked.
Please help me with it thanks
Because every version of flutter_test from sdk depends on async 2.6.1 and fstore depends on async 2.5.0, flutter_test from sdk is forbidden.
So, because fstore depends on flutter_test any from sdk, version solving failed.
pub finished with exit code 1
My pubspec.yaml
name: fstore
publish_to: "none"
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
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.1.0+3018
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# Base
pedantic: ^1.11.0
intl: 0.17.0
# COMMON
inspireui:
path: ./modules/common_library
rubber:
git:
url: git://github.com/inspireui/rubber
country_pickers:
git:
url: git://github.com/inspireui/country_pickers.git
# FIREBASE PACKAGES
firebase_core: 1.1.0
firebase_analytics: 8.0.2
firebase_auth: 1.1.2
cloud_firestore: 1.0.7
firebase_remote_config: 0.9.0-dev.0
firebase_dynamic_links: 2.0.2
firestore_ui:
git:
url: git://github.com/inspireui/firestore_ui.git
# STATE MANAGEMENT
provider: 5.0.0
get_it: 6.1.1
event_bus: 2.0.0
# SPLASH SCREEN, ONBOARDING
animated_splash: 1.0.0
custom_splash: 0.0.2
flare_splash_screen: 4.0.0
rive: 0.7.3
liquid_swipe: 2.1.0
# UI
animated_text_kit: 4.2.1
animations: 2.0.0
awesome_card: 1.1.5
carousel_pro: 1.0.0
configurable_expansion_tile: 1.0.0
country_code_picker: 2.0.1
flash: 1.5.2
flutter_spinkit: 5.0.0
flutter_staggered_grid_view: 0.4.0
flutter_statusbarcolor: 0.2.3
flutter_swiper: 1.1.6
visibility_detector: 0.2.0
font_awesome_flutter: 9.0.0
file_picker: 3.0.1
page_indicator: 0.4.1
percent_indicator: 3.0.1
pull_to_refresh: 1.6.5
rate_my_app: ^1.1.0+1
cupertino_icons: any
implicitly_animated_reorderable_list: 0.4.0
pin_code_fields: 7.0.0
# WEB TOOLS
html_unescape: 2.0.0
webview_flutter: 2.0.4
flutter_widget_from_html: 0.6.0
flutter_webview_plugin: 0.3.11
responsive_builder: 0.4.1
# MAP
google_maps_flutter: 2.0.3
location: 2.3.5
# STORAGE
localstorage: ^4.0.0+1
# CONNECTIVITY
http: 0.13.2
http_auth: 1.0.0
uni_links: 0.4.0
share: 2.0.1
# AUTHENTICATION
apple_sign_in: 0.1.0
flutter_facebook_login: 3.0.0
google_sign_in: 5.0.2
sms_autofill: 2.0.0
# PUSH NOTIFICATION
firebase_messaging: 9.1.3
notification_permissions: 0.5.0
onesignal_flutter: 2.6.3
# PAYMENTS
stripe_sdk:
git:
url: git://github.com/inspireui/stripe-sdk.git
razorpay_flutter: 1.2.5
# IMAGES
transparent_image: 2.0.0
extended_image: 4.0.1
fwfh_cached_network_image: 0.6.0
image_picker: 0.7.4
multi_image_picker: 4.8.0
flutter_image_compress: 1.0.0
# VIDEOS
video_player: 2.1.1
youtube_player_iframe:
git:
url: git://github.com/inspireui/youtube_player_flutter.git
path: packages/youtube_player_iframe
# ADS
facebook_audience_network: 0.7.1
google_mobile_ads: 0.12.1+1
# TOOLS
auto_size_text: 2.1.0
google_fonts: 2.0.0
random_string: 2.1.0
json_annotation: 4.0.1
timeago: 3.0.2
universal_platform: ^1.0.0-nullsafety
uuid: 3.0.4
validate: 1.7.0
vector_math: any
async: 2.5.0
easy_debounce: 2.0.0
charts_flutter: 0.10.0
devicelocale: ^0.4.1
dev_dependencies:
flutter_driver:
sdk: flutter
flutter_test:
sdk: flutter
version: any
flutter_localizations:
sdk: flutter
test: any
flutter_launcher_icons: 0.8.1
mockito: ^4.1.1 # Testing
# vm_service: 5.5.0
## Enable To run json serializer, run:
## flutter pub run build_runner build --build-filter="lib/models/serializers/*.dart" --delete-conflicting-outputs
## flutter pub run build_runner serve --build-filter="lib/models/serializers/*.dart"
# build_runner: 1.12.2
# json_serializable: 4.1.0
### Override the library to support Flutter 2.0
### Note: This will show the warning but will not impact to the app features 👍
dependency_overrides:
intl: 0.17.0
http: 0.13.2
crypto: 3.0.1
path_provider: 2.0.1
uuid: 3.0.4
http_parser: 4.0.0
pedantic: 1.11.0
flutter_svg: 0.19.3
url_launcher: 6.0.1
cached_network_image: 2.5.1
modal_bottom_sheet: 2.0.0
args: 2.1.0
# Run this script to generate the app icon: flutter 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/config/
- lib/config/mocks/
- lib/config/states/
- lib/config/stories/
- assets/icons/categories/
- assets/icons/credit_cards/
- assets/icons/tabs/
- assets/icons/payment/
- assets/images/
- assets/images/country/
- assets/images/favicon/
- assets/html/
- assets/google_fonts/
fonts:
- family: Feather
fonts:
- asset: assets/fonts/Feather.ttf
- family: SF Pro Display
fonts:
- asset: assets/fonts/SF-Pro-Display-Semibold.otf
weight: 700
# 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:
#
# For details regarding fonts from package dependencies,
# see https://flutter.io/custom-fonts/#from-packages
flutter_intl:
enabled: true
Flutter Doctor Results
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, 2.3.0-12.1.pre, on Microsoft Windows [Version 10.0.18363.1440], locale en-PK)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 3.6)
[√] Connected device (1 available)
• No issues found!
I want to upgrade my dependencies to the latest possible, but I can't because they are being blocked by one of the packages.
How can I tell which one is causing the issue where others can't be updated? They pretty much all seem to be outdated. Running flutter pub outdated gives me the list of my packages where the resolvable and updatable are always the same as my current package.
> flutter pub outdated
Showing outdated packages.
[*] indicates versions that are not the latest available.
Package Name Current Upgradable Resolvable Latest
direct dependencies:
bip39 *1.0.3 *1.0.3 *1.0.3 1.0.6
cloud_firestore *0.16.0+1 *0.16.0+1 *0.16.0+1 1.0.5
firebase_auth *0.20.1 *0.20.1 *0.20.1 1.1.0
firebase_core *0.7.0 *0.7.0 *0.7.0 1.0.3
firebase_storage *7.0.0 *7.0.0 *7.0.0 8.0.3
flutter_blue *0.7.3 *0.7.3 *0.7.3 0.8.0
google_maps_flutter *1.2.0 *1.2.0 *1.2.0 2.0.3
http *0.12.2 *0.12.2 *0.12.2 0.13.1
image *2.1.19 *2.1.19 *2.1.19 3.0.2
image_picker *0.6.7+22 *0.6.7+22 *0.6.7+22 0.7.4
local_auth *0.6.3+4 *0.6.3+4 *0.6.3+4 1.1.4
permission_handler *5.1.0+2 *5.1.0+2 *5.1.0+2 6.1.3
transitive dependencies:
archive *2.0.13 *2.0.13 *2.0.13 3.1.2
args *1.6.0 *1.6.0 *1.6.0 2.0.0
bech32 *0.1.2 *0.1.2 *0.1.2 0.2.0
bip32 *1.0.7 *1.0.7 *1.0.7 1.0.10
bs58check *1.0.1 *1.0.1 *1.0.1 1.0.2
cloud_firestore_platform_interface *3.0.2 *3.0.2 *3.0.2 4.0.1
cloud_firestore_web *0.3.0+2 *0.3.0+2 *0.3.0+2 1.0.5
convert *2.1.1 *2.1.1 *2.1.1 3.0.0
crypto *2.1.5 *2.1.5 *2.1.5 3.0.1
firebase_auth_platform_interface *3.1.0 *3.1.0 *3.1.0 4.1.0
firebase_auth_web *0.3.3 *0.3.3 *0.3.3 1.0.6
firebase_core_platform_interface *3.0.1 *3.0.1 *3.0.1 4.0.0
firebase_core_web *0.2.1+3 *0.2.1+3 *0.2.1+3 1.0.2
firebase_storage_platform_interface *1.0.4 *1.0.4 *1.0.4 2.0.1
firebase_storage_web *0.1.1+3 *0.1.1+3 *0.1.1+3 1.0.3
fixnum *0.10.11 *0.10.11 *0.10.11 1.0.0
flutter_plugin_android_lifecycle *1.0.11 *1.0.11 *1.0.11 2.0.1
google_maps_flutter_platform_interface *1.2.0 *1.2.0 *1.2.0 2.0.4
hex *0.1.2 *0.1.2 *0.1.2 0.2.0
http_parser *3.1.4 *3.1.4 *3.1.4 4.0.0
image_picker_platform_interface *1.1.6 *1.1.6 *1.1.6 2.1.0
intl *0.16.1 *0.16.1 *0.16.1 0.17.0
permission_handler_platform_interface *2.0.2 *2.0.2 *2.0.2 3.1.3
petitparser *3.1.0 *3.1.0 *3.1.0 4.1.0
plugin_platform_interface *1.0.3 *1.0.3 *1.0.3 2.0.0
pointycastle *1.0.2 *1.0.2 *1.0.2 3.0.1
protobuf *1.1.3 *1.1.3 *1.1.3 2.0.0
quiver *2.1.5 *2.1.5 *2.1.5 3.0.1
rxdart *0.24.1 *0.24.1 *0.24.1 0.26.0
source_span *1.8.0 *1.8.0 *1.8.0 1.8.1
stream_transform *1.2.0 *1.2.0 *1.2.0 2.0.0
uuid *2.2.2 *2.2.2 *2.2.2 3.0.4
xml *4.5.1 *4.5.1 *4.5.1 5.1.0