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

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.

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.

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

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.

Asset Images not showing up in FLutter Web when doing flutter run -- release

When I was trying to execute my flutter project as
flutter run
The screenshot is the display
All the assets display as intended.
But when I use
flutter run --release
The screenshot is the display
No asset displays and blank stuff is displayed instead
I have tried most fixes already available but nothing worked so far. I have put changed the image's location to be outside the assets folder but still no luck.
Pubspec.yaml
name: portfolio
description: A new Flutter project.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
animated_text_kit: ^4.1.1
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- assets/
- safar.png
- Geoshare.png
- sahulat.png
- swish.png
fonts:
- family: Mont
fonts:
- asset: assets/MontserratAlternates-Light.ttf
weight: 300
- family: Agustina
fonts:
- asset: assets/Agustina.ttf
Flutter Doctor
Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19042.985], locale en-US)
• Flutter version 2.2.0 at C:\src\flutter
• Framework revision b22742018b (13 days 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\hamas\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.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.
[√] 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 (version 1.56.2)
• VS Code at C:\Users\hamas\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.22.0
[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • Google Chrome
• Edge (web) • edge • web-javascript • Microsoft Edge
maybe try
flutter run --web-renderer html --release

Flutter Unable to read manifest info from app.apk

i have upgraded the flutter four days earlier and since then i am facing issue, the workspace has no errors as other collaborator's code is running fine.
Error is:
Error running com.xxxxxxxx.signals. Default activity not found
Unable to read manifest info from F:\Projects\xxxxxxxx-mobile\xxxxxxxx-mobile\build\app\outputs\apk\app.apk.
No application found for TargetPlatform.android_x86.
Is your project missing an android\app\src\main\AndroidManifest.xml?
Consider running "flutter create ." to create one.
i ran following commands in Visual Studio Code Terminal:
flutter clean
flutter run
the solutions i applied which unfortunately didnt work are:
Then i changed branch of the repository i have working in
Switched to dev, beta branches of flutter
Re installed emulator
attached real device
My flutter doctor is as follows:
[√] Flutter (Channel dev, v1.3.13, on Microsoft Windows [Version 10.0.17134.648], locale en-US)
• Flutter version 1.3.13 at C:\src\flutter
• Framework revision 59ce7d6bff (2 days ago), 2019-03-18 11:20:10 -0700
• Engine revision e75f6de01f
• Dart version 2.2.1 (build 2.2.1-dev.1.1 None)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Users\jabir\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[√] Android Studio (version 3.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 32.0.1
• Dart plugin version 182.5124
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[√] VS Code (version 1.32.3)
• VS Code at C:\Users\jabir\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 2.24.0
[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)
• No issues found!
I encountered a similar problem and o fixed it by deleting the app.apk in the build/app/outputs/apk directory and it worked.
I resolved this by these step.
upgraded flutter
created new other project using flutter create foo
compared foo project with my project
removed kotlin setting from my project
changed androidx to android.support packages in gradle dependencies
copied and modified *.iml files for my project (although these files are ignored)
flutter clean
flutter run
I used VS editor.
My Project dependencies. pubspec
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.15.7
http: ^0.12.0+1
firebase_core: ^0.3.4
firebase_analytics: ^2.1.1
firebase_auth: ^0.8.4+2
firebase_remote_config: ^0.1.0+2
firebase_database: ^2.0.2
firebase_storage: ^2.1.0+1
video_player: ^0.10.0+4
chewie: ^0.9.7
in my case it happened cause I defined an intent filter for notification inside main application tag in manifest and declared an application service that receives it in manifest after main application tag and that is wrong
The right to change main application tage name to the new application tag not to put the both
This Error is because the flutter does not find the SDK path. You just need to set the SDK Path by following the command using the terminal.
flutter config --android-sdk $SDK_PATH

Categories

Resources