Execution failed for task ':app:compileFlutterBuildDebug' Flutter 2.2.0 - android

I have been facing this issue after I reset the Android Emulator as it got hanged while development so I just wiped the data. And since then I am facing this issue only for this specific project while for other projects they are working fine.
🔴 Error Logs
Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling
software rendering with "--enable-software-rendering".
Launching lib\main.dart on sdk gphone x86 in debug mode...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
FAILURE: Build failed with an exception.
* Where:
Script 'D:\flutter2\packages\flutter_tools\gradle\flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\flutter2\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 8s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 9.9s
Exception: Gradle task assembleDebug failed with exit code 1
🩺 Flutter doctor
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.1165], locale en-US)
• Flutter version 2.2.0 at D:\flutter2
• Framework revision b22742018b (4 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\Hamza\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• 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.10+0-b96-7249189)
[√] VS Code (version 1.59.1)
• VS Code at C:\Users\Hamza\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.25.0
[√] Connected device (3 available)
• sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.159
• Edge (web) • edge • web-javascript • Microsoft Edge 92.0.902.78
• No issues found!
🗃 pubspec.yaml
name: donation_app
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.11.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.2
# other packages
font_awesome_flutter: ^9.1.0
syncfusion_flutter_sliders: ^19.2.55
charts_flutter: ^0.11.0
carousel_slider: ^3.0.0
bottom_navy_bar: ^6.0.0
share: ^2.0.4
screenshot: ^1.2.1
path_provider: ^2.0.2
permission_handler: ^8.1.4+1
image_picker: ^0.7.5+3
flutter_svg: ^0.22.0
datetime_picker_formfield: ^2.0.0
# analytics
amplitude_flutter: ^3.2.1
# firebase
firebase_auth: ^3.0.1
firebase_core: ^1.4.0
firebase_storage: ^10.0.1
cloud_firestore: ^2.4.0
# local storage
shared_preferences: ^2.0.6
# encryption
flutter_dotenv: ^5.0.0
# stripe
webview_flutter: ^2.0.8
dio: ^4.0.0
js: ^0.6.3
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:
- assets/
- assets/events/
- assets/logo/
- assets/orgs/
- .env
# - 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: Comfortaa
fonts:
- asset: fonts/Comfortaa-Regular.ttf
- asset: fonts/Comfortaa-Medium.ttf
- asset: fonts/Comfortaa-Light.ttf
- asset: fonts/Comfortaa-Bold.ttf
weight: 900
# - 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
💻 Solution Tried
Reinstalling flutter
Tried clearing the packages & getting them again
flutter clean
flutter pub get
Tried deleting pubspec.lock and running flutter pub get
Removing rm android/settings.gradle and running flutter create .
Tried removing C:/USERNAME/.gradle and C:/USERNAME/.gradle/caches both
Tried upgrading Android Studio
Tried upgrading flutter to flutter 2.2.3 the latest version!
Tried replacing settings.gradle code with the below one:
include ':app'
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}
Any help would be appreciated, Thanks!
And please let me know if you need anything else for better understanding :)

If you're using outdated plugins and recently ran flutter upgrade, it's possible that cache of outdated packages is still kept and causing the issue. What you can try doing here is run flutter pub get and flutter pub upgrade if outdated versions were displayed on the logs. Running flutter pub outdated to upgrade the package versions should also work.

Related

Dependency resolves to version 2.9.0 in pubspec.lock but we want to use version 2.7.1

We are trying to integrated Firebase_crashlytics in our App but because our App is built on an older version of Flutter (it doesn't support Null Safety) so we can't use the latest version. Then we decided to integrate version 2.7.1 or lower but the pubspec.lock file always resolves the version to 2.9.0 which is null safe and it throws build error for our App not being null safe.
Can anybody guide me as to what should I do or not do in this regard?
This is our Pubspec.yaml,
name: ------
description: A new 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
# ios
version: 0.1.1+1
# android
#version: 0.1.1+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependency_overrides:
firebase_core_platform_interface: 4.2.0
dependencies:
flutter:
sdk: flutter
# braintree_device_data:
# path: ../braintree_device_data
flutter_braintree:
path: ./flutter-braintree-master
onesignal_flutter:
path: ./flutter-onesignal
# flutter_facebook_auth:
# git:
# url: https://github.com/darwin-morocho/flutter-facebook-auth.git
# ref: master
# path: facebook_auth/
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
get: ^4.1.2
carousel_slider: ^3.0.0
email_validator: ^2.0.1
tab_indicator_styler: ^1.0.0
flutter_rating_bar:
flutter_staggered_grid_view: ^0.3.4
dotted_border: ^2.0.0
http: ^0.13.1
shimmer: ^2.0.0
flutter_slidable: ^0.6.0
google_sign_in: ^5.0.3
# flutter_facebook_auth: ^3.5.2 #// used as old facebook auth but due to an update we cant use it anymore
# flutter_facebook_auth: ^4.4.1+1 #// use this if you're using mac with an intel chip or the team is big
flutter_facebook_auth: ^5.0.7
sign_in_with_apple: ^3.2.0
sqflite: ^2.0.0+3
google_place: ^0.4.0
shared_preferences: ^2.0.6
nuts_activity_indicator: ^0.1.1
graphql_flutter: ^5.0.0
# flutter_braintree: ^2.0.0
flutter_html: ^2.2.1
equatable: ^2.0.3
pull_to_refresh: ^2.0.0
badges: ^2.0.1
image_picker: ^0.8.4+1
# image_picker: ^0.8.6 // requires gradle to be updated to 7.2 which may break some packages and gradle 7.2 doesn't work with OneSignal
firebase_core: ^1.6.0
firebase_analytics: ^8.3.3
firebase_performance: ^0.6.0+2
# firebase_performance: ^0.8.3+3
# url_launcher: ^6.0.10
# url_launcher: ^6.1.7
url_launcher: ^6.1.5
dio: ^4.0.0
flutter_svg: ^0.22.0
syncfusion_flutter_datepicker: ^19.3.45
flutter_typeahead: ^3.2.1
lottie: ^1.2.1
google_fonts: ^2.1.0
flutter_screenutil: ^5.0.0+2
app_tracking_transparency: ^2.0.2+1
# new_version: ^0.3.1
new_version_plus: ^0.0.1+4
uni_links: ^0.5.1
# app_links: ^2.2.0
app_links: ^3.4.1
flutter_phoenix: ^1.0.0
device_info_plus: ^4.0.0
path_provider: ^2.0.11
permission_handler: ^10.0.0
pusher_channels_flutter: ^2.0.1
intl: ^0.17.0
social_share: ^2.2.1
share_plus: ^4.5.3
upgrader: ^4.7.0
photo_view: ^0.14.0
file_picker: ^4.6.1
flutter_native_splash:
multi_image_picker2: ^5.0.2
# firebase_crashlytics: ^2.5.2
# cloudflare: ^1.3.0+11
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons:
flutter_native_splash:
color: "#ffffff"
image: assets/images/logo.png
flutter_icons:
android: true
ios: true
image_path: "assets/images/launcher_icon.png"
# 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:
- assets/images/
- assets/JSON/
- assets/JSON/No_Message/
# - 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: Mulish
fonts:
- asset: assets/fonts/Mulish-Regular.ttf
weight: 400
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
This is the result of Flutter doctor -v,
MacBooks-MacBook-Pro:marketplace-mobile-app macbookpro$ flutter doctor -v
[✓] Flutter (Channel stable, 2.10.4, on macOS 12.6.3 21G419 darwin-x64, locale en-PK)
• Flutter version 2.10.4 at /Users/macbookpro/src/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c860cba910 (11 months ago), 2022-03-25 00:23:12 -0500
• Engine revision 57d3bac3dd
• Dart version 2.16.2
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/macbookpro/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• ANDROID_HOME = /Users/macbookpro/Library/Android/sdk
• 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
• CocoaPods version 1.10.2
[✓] 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)
[✓] Connected device (2 available)
• Infinix X6811 (mobile) • 07363251BU000513 • android-arm64 • Android 11 (API 30)
• Chrome (web) • chrome • web-javascript • Google Chrome 109.0.5414.119
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Okay, a little update.. The issue is resolved.
What we did:
flutter pub cache repair
flutter clean
flutter pub get
Invalidate Cache and Restart (Android
Studio)
It wasn't working yesterday but somehow today when we restarted the Mac and ran the same commands it Worked.

Execution failed for task ':app:compileFlutterBuildDebug' flutter geolocator error

So I was building this app where I want to get the current location for this I used the package geolocator from flutter link -> https://pub.dev/packages/geolocator
Before I used this package my app worked fine but after I constantly get this error:
FAILURE: Build failed with an exception.
* Where:
Script 'D:\School\Academiejaar 3\Semester 1\Mobile Applications\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\School\Academiejaar 3\Semester 1\Mobile Applications\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 12s
Running Gradle task 'assembleDebug'... 14.7s
Exception: Gradle task assembleDebug failed with exit code 1
My pubspec.yaml looks lik this:
name: assistly
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter 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 is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1
environment:
sdk: '>=2.18.1 <3.0.0'
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
flutter:
sdk: flutter
provider: ^6.0.3
flutter_svg: ^0.18.0
vibration: ^1.7.5
highlight_text: ^0.7.2
avatar_glow: ^1.2.0
geolocator: ^9.0.2
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^2.0.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 packages.
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/icons/
- assets/images/
# 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
The error is concerning the package: geolocator: ^9.0.2
my build.gradle looks like this:
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 33
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.assistly"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 21
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
configurations.all {
resolutionStrategy {
force 'com.google.android.gms:play-services-location:20.0.0'
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
this is the output of flutter doctor -v:
[√] Flutter (Channel stable, 3.3.3, on Microsoft Windows [Version 10.0.22000.978], locale en-GB)
• Flutter version 3.3.3 on channel stable at D:\School\Academiejaar 3\Semester 1\Mobile Applications\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18a827f393 (5 days ago), 2022-09-28 10:03:14 -0700
• Engine revision 5c984c26eb
• Dart version 2.18.2
• DevTools version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\david\AppData\Local\Android\sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Users\david\AppData\Local\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.0.6)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.0.32126.317
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2021.3)
• 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.13+0-b1751.21-8125866)
[√] IntelliJ IDEA Ultimate Edition (version 2021.2)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2020.2.2
• 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
[√] VS Code (version 1.71.2)
• VS Code at C:\Users\david\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.48.0
[√] Connected device (4 available)
• sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.978]
• Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.54
• Edge (web) • edge • web-javascript • Microsoft Edge 105.0.1343.53
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
I have tried almost everything I found on stackoverflow, github, ...
such ass flutter clean
flutter pub get
I have tried rebuilding my gradle also downgrading flutter
All help is very welcome and I look forward to what you all find
If you need more information please let me know
I also had this kind of issue. Mine was with awesome_notifications after I had upgraded flutter.
I had to swap it out for local_notifications. Try replacing geolocator.

Flutter issues with Android Firebase dependencies after Dependency Upgrades

i recently decided to upgrade my Flutter dependencies and pubspec.yaml all to newest versions according to pub.dev.
As i mainly tested with iOS i just realised pretty late, that my android build did not work any longer. The Error Message unfortunately was very low on direct information.
Gradle sync failed: Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Problems reading data from Binary store in /private/var/folders/mw/s9362rr10qv43x_yh6qgm17w0000gn/T/gradle8805841490318013448.bin offset 286370 exists? true
Consult IDE log for more details (Help | Show Log) (25 s 303 ms)
I however decided to also provide my android studio an update to 4.1 and upgraded also the gradle dependencies.
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2' // 3.5.1
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.4' // 4.3.3
}
The new attempt in android studio was providing a more relatable error in reference to Firebase
Gradle sync failed: Problems reading data from Binary store in /private/var/folders/mw/s9362rr10qv43x_yh6qgm17w0000gn/T/gradle1329056569736096566.bin offset 296201 exists? true
Corrupt serialized resolution result. Cannot find selected module (224) for constraint platform-runtime -> com.google.firebase:firebase-iid:21.0.1
Consult IDE log for more details (Help | Show Log) (10 m 18 s 294 ms)
My Flutter Doctor -v gives me confidence that everything is fine. (the Plugin Errors are an existing and known issue by the Flutter team with Android Studio 4.1 and not related)
[✓] Flutter (Channel stable, 1.22.6, on macOS 11.1 20C69 darwin-x64, locale de-DE)
• Flutter version 1.22.6 at /Users/kaibaier/development/flutter
• Framework revision 9b2d32b605 (5 days ago), 2021-01-22 14:36:39 -0800
• Engine revision 2f0af37152
• Dart version 2.10.5
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/kaibaier/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/kaibaier/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.9.3
[!] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.18.1
[✓] Connected device (1 available)
• Redmi Note 8 (mobile) • 18d3ce30 • android-arm64 • Android 10 (API 29)
For the sake of completion i also add the pubspec.yaml dependencieswith the previous used Version. You will notice the big Version jump in Firebase and Google Maps
dependencies:
flutter:
sdk: flutter
permission_handler: ^5.0.1+1
cupertino_icons: ^1.0.0 #^0.1.3
firebase_core: ^0.7.0 # ^0.5.0
firebase_auth: ^0.20.0+1 # ^0.18.0+1
firebase_storage: ^7.0.0 # ^4.0.0
cloud_firestore: ^0.16.0 #^0.14.0+2
provider: ^4.3.3 #^4.3.2
flutter_spinkit: ^4.1.2+1
flutter_vector_icons: ^0.2.1
intl: ^0.16.1
image_cropper: ^1.3.1
image_picker: ^0.6.7+21 #^0.6.7+11
searchable_dropdown: ^1.1.3
flutter_colorpicker: ^0.3.5 #^0.3.4
flutter_masked_text: ^0.8.0
shared_preferences: ^0.5.12+4 #^0.5.8
path_provider: ^1.6.27 #^1.6.11
location: ^3.2.4 #^3.0.2
table_calendar: ^2.3.3 #^2.2.3
url_launcher: ^5.7.10 #^5.6.0
google_maps_flutter: ^1.1.1 #^0.5.32
flutter_google_places: ^0.2.6
http: ^0.12.2 #^0.12.1
uuid: ^2.2.2 #^2.0.4
flutter_appcenter_bundle: ^3.2.0+2
preload_page_view: ^0.1.4
device_preview: ^0.5.5 #^0.4.8
wakelock: ^0.2.1+1 #^0.1.4+2
Any help / ideas or thoughts are very welcome :)
UPDATE:
After trying to run the Test again on my android phone i run into another related error.
Note: /Users/kaibaier/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.7.0/android/src/main/java/io/flutter/plugins/firebase/core/FlutterFirebaseCorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Problems reading data from Binary store in /private/var/folders/mw/s9362rr10qv43x_yh6qgm17w0000gn/T/gradle3299415366350440389.bin offset 0 exists? true
* 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.
UPDATE #2:
I also posted the issue over here in GitHub
https://github.com/FirebaseExtended/flutterfire/issues/4848
UPDATE #3:
Ok i was able to figure out that this file: /private/var/folders/mw/s9362rr10qv43x_yh6qgm17w0000gn/T/gradle3299415366350440389.bin
only exists during a build phase. After the error is thrown, it is directly gone again.
Update #4:
I rolled back to the old firebase dependencies for now. Just upgraded the firebase storage. All runs smoothly after some pod and Grasflecks clean.
My issue still exists, as I hope to get back to the new versions of firebase dependencies . But for now I can build again .
I had exactly the same issue after a firebase upgrade. Along with pubspec.yaml There is another (somewhat hidden) dependency you need to upgrade in app/build.gradle. I changed mine from 17.x to this and all builds and runs.
implementation 'com.google.firebase:firebase-analytics:18.0.2'

After recent update, pug get is not working. any ideas?

Today (22.08.2020) after being prompted on Android Studio, i updated flutter. After that, whenever i do a pub get, i get the following error:
"Because every version of flutter from sdk depends on vector_math 2.1.0-nullsafety.2 which doesn't match any versions, flutter from sdk is forbidden.
So, because flutter_app3 depends on flutter any from sdk, version solving failed.
pub get failed (1; So, because flutter_app3 depends on flutter any from sdk, version solving failed.)"
see below flutter doctor -v result:
C:\Users\User\StudioProjects\flutter_app3>flutter doctor -v
[√] Flutter (Channel beta, 1.21.0-9.1.pre, on Microsoft Windows [Version 10.0.17134.1667], locale cs-CZ)
• Flutter version 1.21.0-9.1.pre at C:\src\flutter
• Framework revision be9bc8cb39 (4 days ago), 2020-08-18 09:46:08 -0700
• Engine revision 267070c17a
• Dart version 2.10.0 (build 2.10.0-7.2.beta)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\User\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.2
• 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.
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 48.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.47.2)
• VS Code at C:\Users\User\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.12.2
[√] Connected device (1 available)
• HD1903 (mobile) • aa3eee24 • android-arm64 • Android 10 (API 29)
• No issues found!
pubspec.yaml:
name: flutter_app3
description: A new 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
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
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
# 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
Thanks in advance.
You used the channel beta flutter.
I think you need to use the stable channel.

flutter: build fails after adding firebase_admob

I'm trying to add firebase_admob to my firebase app and getting the error below.
Could not determine the dependencies of task
':firebase_core:compileDebugAidl'.
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.0.0,17.0.0]], but
resolves to 16.5.0. Disable the plugin and check your dependencies
tree using ./gradlew :app:dependencies.
I tried adding com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true to the gradle build file. Then this error goes away but the flutter app crashes when trying to launch in emulator.
below are my dependencies
random_string: 0.0.2
firebase_auth: ^0.14.0+5
firebase_database: ^3.0.7
google_sign_in: ^4.0.7
flutter_facebook_login: 2.0.1
provider: 3.0.0
rxdart: ^0.22.2
flutter_svg: ^0.14.0
collection: ^1.14.11
audioplayers: ^0.13.2
firebase_admob: ^0.9.0+7
Flutter version
Flutter 1.9.1+hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 2d2a1ffec9 (6 days ago) • 2019-09-06 18:39:49 -0700
Engine • revision b863200c37
Tools • Dart 2.5.0
Appreciate any help to fix this issue.
My guess is that two different plugins are referencing two different versions of the underlying Firebase gradle artifacts for Android.
The error message is giving you good advice about how to check the exact problem:
./gradlew :app:dependencies
Try running that command from the android subfolder of your Flutter project and see what it says.

Categories

Resources