I am getting error while trying to run my flutter project - flutter

When I try to run my flutter project I get the error below. What could be the cause? ......................................................................................................................................................................................................................................................................................................................................................................................................................
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/carousel_slider-4.1.1/lib/carousel_slider.dart:268:7: Error: No named parameter with the name 'padEnds'.
padEnds: widget.options.padEnds,
^^^^^^^
/C:/src/flutter/flutter/packages/flutter/lib/src/widgets/page_view.dart:664:3: Context: Found this candidate, but the arguments don't match.
PageView.builder({
^^^^^^^^^^^^^^^^
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.0/lib/src/method_channel/utils/exception.dart:13:11: Error: Method not found: 'Error.throwWithStackTrace'.
Error.throwWithStackTrace(exception, stackTrace);
^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.0/lib/src/method_channel/utils/exception.dart:16:9: Error: Method not found: 'Error.throwWithStackTrace'.
Error.throwWithStackTrace(
^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.0/lib/src/method_channel/utils/exception.dart:11:7: Error: A non-null value must be returned since the return type 'Never' doesn't allow null.
Never convertPlatformException(Object exception, StackTrace stackTrace) {
^
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 3m 41s
Exception: Gradle task assembleDebug failed with exit code 1
These are my dependencies in my pubspec.yaml
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.3
# google_fonts: ^2.1.0
google_fonts: 2.2.0
flutter_icons_nullsafty: ^1.0.0
http: ^0.13.3
cached_network_image: ^3.1.0
encrypt: ^5.0.1
flutter_svg: ^0.22.0
qr_flutter: ^4.0.0
clipboard: ^0.1.3
share: ^2.0.4
qr_code_scanner: ^0.5.2
fluro: ^2.0.3
url_launcher: ^6.0.10
image_picker: ^0.8.4
country_code_picker: ^2.0.2
introduction_screen: ^2.1.0
pin_code_fields: ^7.3.0
provider: ^6.0.0
hive: ^2.0.4
hive_flutter: ^1.1.0
flutter_secure_storage: ^4.2.1
local_auth: ^1.1.7
permission_handler: ^8.1.4+2
fl_chart: ^0.40.0
carousel_slider: ^4.0.0
web3dart: ^2.3.1
device_info_plus: ^2.1.0
package_info_plus: ^1.3.0
intl: ^0.17.0
timeago: ^3.1.0
razorpay_flutter: ^1.2.7
flutter_paystack: ^1.0.5+1
flutter_braintree: ^2.0.0+1
loading_overlay: ^0.3.0
lazy_load_scrollview: ^1.3.0
shimmer: ^2.0.0
in_app_review: ^2.0.3
image_cropper: ^1.4.1
ntp: ^2.0.0
uuid: ^3.0.4
cron: ^0.3.2
dotted_border: ^2.0.0+1
translator: ^0.1.7
firebase_core: ^1.6.0
firebase_messaging: ^10.0.9
firebase_analytics: ^8.3.4
firebase_dynamic_links: ^3.0.1
flutter doctor -v response
C:\Users\USER>flutter doctor -v
[√] Flutter (Channel unknown, 2.2.0, on Microsoft Windows [Version 10.0.19041.264], locale en-US)
• Flutter version 2.2.0 at C:\src\flutter\flutter
• Framework revision b22742018b (1 year ago), 2021-05-14 19:12:57 -0700
• Engine revision a9d88a4d18
• Dart version 2.13.0
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\USER\Documents\Sdk
• Platform android-31, build-tools 30.0.2
• ANDROID_HOME = C:\Users\USER\Documents\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
• 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.12+7-b1504.28-7817840)
[√] VS Code (version 1.67.1)
• VS Code at C:\Users\USER\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.23.0
[√] Connected device (2 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 6.0 (API 23) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.127
• No issues found!

You are using a too old flutter version. You are using version 2.2.0
padEnds only became exposed in version 2.5.0 as you can see here:
https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-2.5.0
78558 Expose padEnds on PageView widget
You need to upgrade your flutter. You can do that by writing
flutter upgrade
though it says in your flutter doctor that you are on an unknown channel so maybe you need to do
flutter channel stable
first

My guess is that some dependencies are using deprecated methods (which are removed in the newer Flutter version).
Try the following commands (WARNING: you will most likely have to update your codebase after this, and your packages as well.)
Update Flutter - flutter upgrade
Get dependencies - flutter pub get
Update dependencies flutter pub upgrade
Re-fetch dependencies - flutter pub get
Update your code to the newest version.
Rebuild

Related

My Flutter project suddenly stopped working [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 days ago.
Improve this question
I have no idea what happened. It was working until yesterday.
When I try to run it now, An error keeps coming.
This is the complete Debug Console Log
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
../../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_pdf-20.4.49/lib/src/pdf/implementation/forms/pdf_xfdf_document.dart:38:35: Error: The argument type 'String?' can't be assigned to the parameter type 'Object' because 'String?' is nullable and 'Object' isn't.
- 'Object' is from 'dart:core'.
builder.attribute('href', _pdfFilePath);
^
Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
* Where:
Script '/Users/stunntechinnovations/Documents/Softwares/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1151
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/stunntechinnovations/Documents/Softwares/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 27s
Exception: Gradle task assembleDebug failed with exit code 1
Exited
I can't seem to find any issues with flutter, dart or any of the configurations.
Flutter doctor -v output given below
[✓] Flutter (Channel stable, 3.7.3, on macOS 13.2 22D49
darwin-arm64, locale en-IN)
• Flutter version 3.7.3 on channel stable at
/Users/stunntechinnovations/Documents/Softwares/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 9944297138 (34 hours ago), 2023-02-08
15:46:04 -0800
• Engine revision 248290d6d5
• Dart version 2.19.2
• DevTools version 2.20.1
[✓] Android toolchain - develop for Android devices (Android SDK
version 33.0.0)
• Android SDK at
/Users/stunntechinnovations/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google
Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• 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.12+0-b1504.28-7817840)
[✓] VS Code (version 1.75.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (3 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64
• Android 12 (API 31) (emulator)
• macOS (desktop) • macos • darwin-arm64
• macOS 13.2 22D49 darwin-arm64
• Chrome (web) • chrome • web-javascript
• Google Chrome 110.0.5481.77
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
can it be any package-related issues? I tried changing the package versions, but it only seemed to complicate the issue more.
pubspec.yaml
name: kaigo
description: A new Flutter project.
publish_to: 'none'
version: 1.0.0+2
environment:
sdk: ">=2.17.3 <3.0.0"
dependencies:
intl: ^0.18.0
flutter_localizations:
sdk: flutter
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
google_fonts: ^3.0.1
get: ^4.6.5
flutter_screenutil: ^5.5.3+2
bot_toast: ^4.0.2
dropdown_button2: ^1.6.3
flutter_svg: 1.1.1+1
dio: ^4.0.6
shared_preferences: ^2.0.15
dotted_border: ^2.0.0+2
flutter_datetime_picker: ^1.5.1
json_annotation: ^4.6.0
camera: ^0.10.0
path: ^1.8.1
path_provider: ^2.0.11
buttons_tabbar: ^1.3.6
persistent_bottom_nav_bar: ^4.0.2
google_maps_flutter: ^2.1.10
custom_marker: ^1.0.0
image_picker: ^0.8.5+3
firebase_auth:
flutter_spinkit: ^5.1.0
firebase_crashlytics: ^3.0.1
shimmer: ^2.0.0
firebase_core: ^2.4.0
firebase_analytics: any
email_validator: ^2.1.17
readmore: ^2.2.0
multiselect: ^0.0.7
checkbox_grouped: ^1.8.1
qr_code_scanner: ^1.0.1
carousel_slider: ^4.1.1
syncfusion_flutter_pdfviewer: ^20.2.50-beta
cloud_firestore: ^4.0.1
permission_handler: ^10.0.1
flutter_html: ^2.0.0
url_launcher: ^6.1.6
favorite_button: ^0.0.4
firebase_messaging: ^14.0.0
flutter_local_notifications: ^12.0.4
pdf: ^3.8.4
printing: ^5.9.3
open_file: ^3.2.1
expandable: ^5.0.1
bugsnag_flutter: ^2.4.0
visibility_detector: ^0.3.3
dependency_overrides:
flutter_svg: 1.1.1+1
pull_to_refresh: ^2.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
json_serializable: ^6.1.4
build_runner: ^2.1.7
flutter_launcher_icons: ^0.10.0
dart_code_metrics: ^5.5.1
flutter_icons:
android: true
ios: true
remove_alpha_ios: true
image_path: "assets/images/logo_opaque.png"
flutter:
generate: true
uses-material-design: true
assets:
- .env.development
- assets/images/
- assets/svgs/
fonts:
- family: NotoSansJP
fonts:
- asset: assets/fonts/NotoSansJP-Thin.otf
weight: 100
- asset: assets/fonts/NotoSansJP-Light.otf
weight: 200
- asset: assets/fonts/NotoSansJP-Light.otf
weight: 300
- asset: assets/fonts/NotoSansJP-Regular.otf
weight: 400
- asset: assets/fonts/NotoSansJP-Medium.otf
weight: 500
- asset: assets/fonts/NotoSansJP-Medium.otf
weight: 600
- asset: assets/fonts/NotoSansJP-Bold.otf
weight: 700
- asset: assets/fonts/NotoSansJP-Bold.otf
weight: 800
- asset: assets/fonts/NotoSansJP-Black.otf
weight: 900
does anybody know how to fix this issue? Any help is appreciated.
Thank you in Advance

flutter run error flutter.gradle' line: 1035 with other AssetBundle? bundle error

suddenly the application no longer starts,
3 days ago I made a release with the same code I have not changed anything, I go to run it yesterday and I find myself with a lot of errors, which I can not solve.
I have searched and tried to run the following options already:
- flutter clean
- flutter pub get
- flutter run --no-sound-null-safety
- flutter cache repair
they don't solve my problem, this is the result of flutter doctor -v:
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version
10.0.19042.1466], local it-IT)
• Flutter version 2.2.0 at C: \ Users \ Documents \ flutter
• Framework revision b22742018b (9 months ago), 2021-05-14 19:12:57 -0700
• Engine revision a9d88a4d18
• Dart version 2.13.0
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C: \ Users \ AppData \ Local \ Android \ sdk
• Android-31 platform, build-tools 30.0.3
• Java binary at: C: \ Program Files \ Android \ Android Studio \ jre \ bin \ java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C: \ Program Files \ Google \ Chrome \ Application \ chrome.exe
[√] Android Studio (version 4.1.0)
• Android Studio at C: \ Program Files \ Android \ Android Studio
• 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 1.8.0_242-release-1644-b01)
[√] VS Code, 64-bit edition (version 1.64.2)
• VS Code at C: \ Program Files \ Microsoft VS Code
• Flutter extension version 3.34.0
[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.102
• Edge (web) • edge • web-javascript • Microsoft Edge 96.0.1054.41
• No issues found!
but when I run flutter run, I find myself with these errors (I don't put them all, because there are so many):
/C:/Users/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/google_fonts-2.3.0/lib/google_fonts.dart:142265:7: Error: No named parameter with the name 'displayLarge'.
displayLarge:
^^^^^^^^^^^^
/C:/Users/Documents/flutter/packages/flutter/lib/src/material/text_theme.dart:113:9: Context: Found this candidate, but the arguments don't match.
const TextTheme({
^^^^^^^^^
/C:/Users/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/lottie-1.2.2/lib/src/lottie.dart:48:5: Error: 'AssetBundle' isn't a type.
AssetBundle? bundle,
^^^^^^^^^^^
/C:/Users/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/lottie-1.2.2/lib/src/lottie_builder.dart:137:5: Error: 'AssetBundle' isn't a type.
AssetBundle? bundle,
^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\Documents\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\Documents\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 54s
Running Gradle task 'assembleDebug'... 55,2s
Exception: Gradle task assembleDebug failed with exit code 1
do you know how to resolve the matter? it looks like a cache issue, but i tried to re-install flutter with the same version, but i didn't fix anything
this is my pubspec.yaml
version: 1.2.13+73
environment:
sdk: ^2.7.0
flutter: ^1.26.1
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
audioplayers: ^0.19.1
autocomplete_textfield: ^1.7.3
expansion_card: ^0.1.0
barcode_scan2: ^4.1.3
blue_print_pos: ^0.0.5
cool_alert: any
device_info: ^2.0.0
flutter_config: ^1.0.8
flutter_credit_card: ^2.0.0
flutter_html: any
flutter_phoenix: ^0.1.0
flutter_riverpod: ^0.14.0+3
flutter_search_bar: ^2.1.0
flutter_stripe: ^1.0.1+3
flutter_user_agent: ^1.2.2
google_fonts: ^2.1.0
in_app_review: any
menu_button: ^1.2.1
package_info: ^0.4.3+2
pay: ^1.0.2
permission_handler: ^4.0.0
qr_flutter: ^4.0.0
rflutter_alert: ^2.0.2
share: ">=0.6.5+4 <2.0.0"
shared_preferences: ^2.0.5
sizer: ^1.1.8
tinycolor: ^1.0.3
url_launcher: any
vibration: ^1.7.3
wakelock: ^0.4.0
chewie: any
dev_dependencies:
flutter_test:
sdk: flutter
http: ^0.13.3
flutter:
assets:
- assets/
- assets/audio/cancel.mp3
- assets/audio/invio.mp3
- assets/audio/moltiplica.mp3
- assets/audio/reparto.mp3
- assets/audio/ricevuta.mp3
- assets/audio/tastiera.mp3
- assets/audio/beep.mp3
fonts:
- family: CustomIcon
fonts:
- asset: assets/fonts/CustomIcon.ttf
Please try to remove sign ^ of version dependency.
I recently faced out issue I tried to downgrade flutter so resolved it.
You have to upgrade your flutter SDK

Flutter 2: problem in Intl null safety library

I upgrade my flutter sdk to flutter 2.0.0. After updating sdk I have changed almost all libraries to null safety version:
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cupertino_icons: ^0.1.3
encrypt: ^4.1.0
flutter_hooks: ^0.15.0
flutter_map: ^0.11.0
flutter_password_strength: ^0.1.5
flutter_svg: ^0.18.0
geolocator: ^7.0.1
get: ^3.25.6
get_it: ^6.0.0
injectable: ^1.1.2
local_auth: ^1.1.0
moor_flutter: ^3.1.0
provider: ^5.0.0
shared_preferences: ^2.0.3
supercharged: ^1.12.0
intl: ^0.17.0
after updating I run dart $ dart migrate command. But It shows these problem about intl plugin:
Analyzing project...
[---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/]
5 analysis issues found:
error • A value of type 'Null' can't be returned from the function '_findExact' because it has a return type of 'MessageLookupByLibrary' at lib/generated/intl/messages_all.dart:34:14 • (return_of_invalid_type)
error • A value of type 'Null' can't be returned from the function '_findGeneratedMessagesFor' because it has a return type of 'MessageLookupByLibrary' at lib/generated/intl/messages_all.dart:65:36 • (return_of_invalid_type)
error • Non-nullable instance field 'current' must be initialized at lib/generated/l10n.dart:16:3 • (not_initialized_non_nullable_instance_field)
error • The non-nullable variable 'current' must be initialized at lib/generated/l10n.dart:18:12 • (not_initialized_non_nullable_variable)
error • A value of type 'S?' can't be returned from the method 'of' because it has a return type of 'S' at lib/generated/l10n.dart:35:12 • (return_of_invalid_type)
The migration tool didn't start, due to analysis errors.
I am using last version of intl ? How can I fix that?
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.0, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.53.2)
[✓] Connected device (2 available)
• No issues found!
I had the same issue. Here are 3 steps to troubleshoot this:
First of all, update intl dependency in pubspec.yaml to this:
intl: 0.17.0-nullsafety.2
If still doesn't work, then add these 2 fields in the root.
dependency_overrides:
intl: 0.17.0-nullsafety.2
Generation also can happen via plugin in Android Studio. I used old one (v 0.12) and after I updated to (v 0.14) it started to generate null safety dart files for localization.
I think I stepped on every rock here.

firebase_admob error The built failed likely due to AndroidX incompatibilities in a plugin

Error appears when performing
flutter build apk --release
and
flutter build apk
There is no error when I build the APK without having the firebase_admob
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin firebase_admob...
The plugin firebase_admob could not be built due to the issue above.
I have performed
flutter doctor --android-licenses
flutter clean
The error still appears.
Below is the flutter doctor -v result
[√] Flutter (Channel stable, 1.20.4, on Microsoft Windows [Version 10.0.18362.1082], locale en-US)
• Flutter version 1.20.4 at D:\work\flutter
• Framework revision fba99f6cf9 (2 weeks ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at D:\work\AndroidSDK
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = D:\work\AndroidSDK
• ANDROID_SDK_ROOT = D:\work\AndroidSDK
• Java binary at: D:\aplikasi\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Android Studio (version 4.0)
• Android Studio at D:\aplikasi\Android Studio
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] Connected device (1 available)
• AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• No issues found!
Pubspec.yaml
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.16.0
sqflite: "^0.11.0+1"
flutter_launcher_icons: "^0.8.0"
image_picker: "0.6.1"
path_provider: ^1.6.16
path: ^1.7.0
provider: ^4.0.1
date_util: ^0.1.4
auto_size_text: ^2.1.0
flutter_masked_text: ^0.7.0
font_awesome_flutter: ^8.8.1
firebase_admob: ^0.9.0+9
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/penqu.png"
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
module:
androidX: true
I managed to fix the issue using different package version
and add firebase_core.
firebase_admob: ^0.9.0+9
Then I made change to the gradle.properties file as follow
The change was gradle-4.10.2-all.zip to gradle-5.1.1-all.zip
why?
cuz it appears in the error message.
#Thu Nov 01 21:03:34 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

Flutter After Upgrade can't run application version solving failed

Nope. This answer doesn't work this time for me.
My flutter doctor -v
[✓] Flutter (Channel master, v0.5.9-pre.68, on Linux, locale en_US.UTF-8)
• Flutter version 0.5.9-pre.68 at /home/khophi/.flutterSetup
• Framework revision 5cd97f0004 (2 hours ago), 2018-08-16 14:10:22 -0700
• Engine revision 4ee648914f
• Dart version 2.1.0-dev.0.0.flutter-be6309690f
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /home/khophi/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• ANDROID_HOME = /home/khophi/Android/sdk
• Java binary at: /usr/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.18.04.1-b11)
• All Android licenses accepted.
[✗] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
[✓] VS Code (version 1.26.0)
• VS Code at /usr/share/code
• Flutter extension version 2.17.1
[✓] Connected devices (1 available)
• klte • 956e8b90 • android-arm • Android 8.1.0 (API 27)
! Doctor found issues in 1 category.
When I run flutter run, I get:
Running "flutter packages get" in townsquare...
The current Dart SDK version is 2.1.0-dev.0.0.flutter-be6309690f.
Because flutter_circular_chart 0.0.3 requires SDK version >=1.19.0 <2.0.0 and no versions of flutter_circular_chart match >0.0.3 <0.1.0, flutter_circular_chart ^0.0.3 is forbidden.
So, because mobile depends on flutter_circular_chart ^0.0.3, version solving failed.
pub get failed (1)
This is my pubspec.yaml
name: mobile
description: A new Flutter project.
version: 1.0.0+1
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
carousel: ^0.0.1
http: "^0.11.3+16"
validate: "^1.6.0"
url_launcher: "^3.0.2"
shared_preferences: "^0.4.2"
font_awesome_flutter: "^7.0.0"
flutter_circular_chart: "^0.0.3"
flutter_local_notifications: ^0.3.6
dev_dependencies:
flutter_test:
sdk: flutter
assets:
- images/flutter.jpg
- images/logo.png
- images/bg_viewer.jpg
With the above, please enlighten me, what's wrong?
That's is because you are using : Dart version 2.1.0-dev.0.0.flutter-be6309690f and the plugin named flutter_circular_chart has a constraint
https://github.com/xqwzts/flutter_circular_chart/blob/master/pubspec.yaml
environment:
sdk: '>=1.19.0 <2.0.0'
You can fork the project and update the sdk constraint and ref to your repository:
Like this:
flutter_circular_chart:
git: https://github.com/your_repo/flutter_circular_chart.git
Note
Also would be fine if you open an issue in their repo to notify the devs about the issue that you have.
Use devendency_override with same version witch need for same for other dependency.
Like google_maps_flutter: ^0.5.28+1 needs intl to be 0.16.0
then craete dependency_overrides:
intl: ^0.16.0
below of dev_dependencies:
flutter_test:
sdk: flutter
run project until it not run on device.
Enjoy. Thanks..