Flutter version solving failed with new flutter upgrade - flutter

I have upgraded my flutter recently, previously it was working fine with every package, but now there is one thing which is bothering me right now due to which my project is not running. This is the error happening cos of this package named PURE_MIXPANEL.
ERROR:
The current Dart SDK version is 2.3.1-dev.0.0.flutter-a0290f823c.
Because pure_mixpanel 1.0.7 requires SDK version >=1.19.0 <=2.2.1 and no versions of pure_mi
xpanel match >1.0.7 <2.0.0, pure_mixpanel ^1.0.7 is forbidden.
So, because flutter_app depends on pure_mixpanel ^1.0.7, version solving failed.
Running "flutter packages get" in flutter_app...
pub get failed (1)
From the internet, I have followed so many things like :
flutter upgrade
flutter channel master followed by flutter upgrade
flutter channel dev followed by flutter upgrade
So it upgraded my flutter successfully but it raised one problem that is the package is not at all supported but previously it was working.
Here is my flutter doctor -v result :
[✓] Flutter (Channel master, v1.5.9-pre.193, on Mac OS X 10.14.4 18E226, locale en-US)
• Flutter version 1.5.9-pre.193 at /Users/alok/flutter
• Framework revision 3a6acb8c25 (9 minutes ago), 2019-05-09 09:23:30 -0700
• Engine revision 644db5a49c
• Dart version 2.3.1 (build 2.3.1-dev.0.0 a0290f823c)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/alok/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.0, Build version 10A255
• ios-deploy 1.9.4
• CocoaPods version 1.6.0
[!] Android Studio (version 3.3)
PUBSPEC.YAML:
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
pure_mixpanel: ^1.0.7
There is no upgraded version of pure_mixpanel present on the web, and it is important in my project.
Any help would be appreciated. Thanks

Your SDK version is 2.3.1 and SDK for pure_mixpanel is sdk: ">=1.19.0 <=2.2.1"
Check: https://github.com/seenickcode/pure_mixpanel/blob/master/pubspec.yaml

I fix my by adding dart sdk location to env
for Windows
C:\src\flutter\bin\cache\dart-sdk

Related

Flutter auto_route_generator not building, FormatException: Not an instance of List

I'm trying to run Flutter pub run build_runner build,
to generate a router.g.dart file for navigation.
I've run a build_runner clean, a whole project clean then build but no luck.
Im following a tutorial, he just seems to run it exactly with the code I have and its fine. No one else in the comments seem to have this issue and I can't find anything about it online.
It fails saying:
[SEVERE] auto_route_generator:autoRouteGenerator on lib/app/router.dart:
FormatException: Not an instance of List.
[INFO] Running build completed, took 16.2s
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 48ms
[SEVERE] Failed after 16.3s
pub finished with exit code 1
My router.dart code:
import 'package:auto_route/auto_route_annotations.dart';
import 'package:stacktest/ui/views/covers/cover_view.dart';
import 'package:stacktest/ui/views/home/home_view.dart';
import 'package:stacktest/ui/views/startup/startup_view.dart';
#MaterialAutoRouter()
class $Router {
#initial
StartupView startupViewRoute;
HomeView homeViewRoute;
CoverView coverViewRoute;
}
Pubspec.yaml:
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
stacked: ^1.7.1+1
auto_route: 0.6.1
stacked_services: 0.4.4+3
dev_dependencies:
build_runner: 1.10.0
auto_route_generator: 0.6.0
flutter_test:
sdk: flutter
Flutter doctor -v
✓] Flutter (Channel master, 1.20.0-8.0.pre.41, on Mac OS X 10.15.5 19F101, locale en-AU)
• Flutter version 1.20.0-8.0.pre.41 at /Users/mikaelwills/Documents/Flutter
• Framework revision fd80503fd3 (34 hours ago), 2020-07-10 14:41:02 +0530
• Engine revision 9b3e3410f0
• Dart version 2.9.0 (build 2.9.0-20.0.dev 06cb010247)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/mikaelwills/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.8.4
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.47.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.12.2
[✓] Connected device (2 available)
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 83.0.4103.116
• No issues found!
Since the version 0.6.0 there were some breaking changes in the auto_route package, the most important was that It was changed the way routes are declared from class fields to a static list. You can check more details about it here.
So, in order to fix it just update it using a static list as follows:
#MaterialAutoRouter(
routes: <AutoRoute>[
MaterialRoute(page: StartupView, initial: true),
MaterialRoute(page: HomeView),
MaterialRoute(page: CoverView),
],
)
class $Router {}
and then run the build runner command: flutter pub run build_runner watch --delete-conflicting-outputs
Another option could be use an earlier version like the 0.5.0, but it's recommended to keep updated, for more info please check the documentation in theauto route package.

I have an error in vscode when trying to install flame under pubspec.yaml

I'm trying to install flame but whenever I run the pub get it gives me a really long error "Because every version of flutter_test from sdk depends on xml 3.6.1 and tiled >=0.4.0 depends on xml ^4.2.0, flutter_test from sdk is incompatible with tiled >=0.4.0." And then under it is a version solving failed error message.
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18363.900], locale en-US)
• Flutter version 1.17.5 at C:\Users\marci\Downloads\flutter
• Framework revision 8af6b2f038 (7 days ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
• Android SDK at C:\Users\marci\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.0
• 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 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.46.1)
• VS Code at C:\Users\marci\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.12.1
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
name: ggg
description: A new Flutter project.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.3
flame: ^0.24.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
I had the same problem today and checked on the Flame Discord channel.
They told me they have a conflict with their lib with stable flutter channel.
Recommendation is to change to Flutter Channel Beta.
I did that, then did Flutter Upgrade, then finally Flutter Pub Get and it worked.
Terminal Commands
To check which channel you are currently on
Flutter Channel
To change to the beta channel
Flutter Channel Beta
To get the beta version
Flutter Upgrade
So, when I have the same problem with you when I tried it.
Here's my solution:
In your dependencies: section inside the pubspec.yaml file, change the flame section without any version tag:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.3
flame:

Flutter version on IOS stuck at 1.0.0

When I run:
pod outdated
on IOS to determine any pods that are outdated I get the following result:
....
Analyzing dependencies
The color indicates what happens when you run `pod update`
<green> - Will be updated to the newest version
<blue> - Will be updated, but not to the newest version because of specified version in Podfile
<red> - Will not be updated because of specified version in Podfile
The following pod updates are available:
- Flutter 1.0.0 -> 1.0.0 (latest version 1.3.300)
- Protobuf 3.9.2 -> 3.9.2 (latest version 3.10.0-rc1)
While version 1.0.0 of Flutter (in red) seems to be okay at the moment on IOS can someone please suggest how I can update this Pod?
I have upgraded Flutter using:
/Users/bob/Downloads/flutter/bin/flutter upgrade
The above command seems to make no difference per the pod version noted above. I would prefer everything be at the latest version but if it is not necessary knowing that information would be helpful as well.
Using:
/Users/bob/Downloads/flutter/bin/flutter doctor -v
reveals:
[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.6 18G95, locale en-US)
• Flutter version 1.9.1+hotfix.2 at /Users/bob/Downloads/flutter
• Framework revision 2d2a1ffec9 (3 weeks ago), 2019-09-06 18:39:49 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/bob/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.0, Build version 11A420a
• CocoaPods version 1.6.0
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 39.0.3
• Dart plugin version 191.8423
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
• iPhone 11 Pro Max • 08EB7508-34DE-4797-8F33-3DEE671742E4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-0 (simulator)
• No issues found!
The problem comes from the podhelper.rb script (YOUR_PATH//flutter/packages/flutter_tools/bin/podhelper.rb). It generates a 'fake' Flutter.podspec file but it hardcodes the 1.0.0 podspec.
Resolve this by editing lines 155-190 of podspec.rb (for iOS app), replacing the json definitions for the podspec with the version you want to move to from the CocoaPods repo (e.g. here for v2.5). Run pod update and it will update to 2.5.
The next section in the script repeats the same error for macOS apps so you may need to repeat for lines 193-228.
I am testing this right now but if you navigate into app_project/ios/Flutter/Flutter.podspec you will see there is Flutter version hardcoded to 1.0.0
Now I am no expert in Flutter so I don't know if you are supposed to manually change this, to what version you should change it, if it even makes any difference and why flutter don't provide script when you perform flutter upgrade to also update this file and flutter version.
Update your podhelper.rb on this path to update Flutter version on iOS.
YOUR_PATH//flutter/packages/flutter_tools/bin/podhelper.rb
s.name = 'Flutter'
s.version = '3.0.0'
Flutter 1.0.0 -> 1.0.0 (latest version 3.0.0)

flutter: ">=0.2.4 <2.0.0" pub get failed (65) when cloud_firestore package is used in pubspec.yaml

When I tried to add the google_sign_in,flutter_auth and cloud_firestore it is throwing me the error that flutter: ">=0.2.4 <2.0.0".I tried to run flutter dector -v the output is
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Linux, locale en_US.UTF-8)
• Flutter version 1.5.4-hotfix.2 at /home/ramu/Downloads/tools/flutter
• Framework revision 7a4c33425d (4 weeks ago), 2019-04-29 11:05:24 -0700
• Engine revision 52c7a1e849
• Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /home/ramu/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /home/ramu/Android/Sdk
• Java binary at: /snap/android-studio/73/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 /snap/android-studio/73/android-studio
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] VS Code (version 1.34.0)
• VS Code at /usr/share/code
• Flutter extension version 3.0.2
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
firebase_auth: ^0.6.2+1
google_sign_in: ^3.2.2
cloud_firestore: ^0.8.2+3
Try updating your environment sdk in pubspec.yaml from >=0.2.4 <2.0.0 to >=2.1.0 <3.0.0
The upper bound for your environment sdk is below version 2.0.0 but google_sign_in ,firebase_auth, and cloud_firestore requires at least >=2.0.0-dev.28.0 (which is newer then what you have specified for your project).
Try to delete that project folder and create a new one and paste all the code in the newly created project.

Flutter NetworkImage errors

Flutter looks promising, but now and then I am stuck. In this case the error states:
package:async/src/typed/stream.dart': error: line 56: class 'TypeSafeStream' overrides method 'firstWhere' of super class or interface 'Stream' with incompatible parameters
I am using the following code that should work:
new NetworkImage(googleSignIn.currentUser.photoUrl)
fluttor doctor outputs:
[✓] Flutter (on Mac OS X 10.13.4 17E139j, locale nl-NL, channel dev)
• Flutter version 0.1.2 at /Users/johngorter/Desktop/flutter/flutter
• Framework revision 8a65872ef9 (6 days ago), 2018-02-13 23:32:28 -0800
• Engine revision 05c5f817eb
• Tools Dart version 2.0.0-dev.22.0
• Engine Dart version 2.0.0-edge.3c4dccbd46f152be9e1b6ca95c57357e8e48057c
[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
• Android SDK at /Users/johngorter/Library/Android/sdk
• Android NDK at /Users/johngorter/Library/Android/sdk/ndk-bundle
• Platform android-27, build-tools 26.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
[!] iOS toolchain - develop for iOS devices (Xcode 9.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.2, Build version 9C40b
✗ libimobiledevice and ideviceinstaller are not installed. To install, run:
brew install --HEAD libimobiledevice
brew install ideviceinstaller
✗ ios-deploy not installed. To install:
brew install ios-deploy
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
For more info, see https://flutter.io/platform-plugins
To install:
brew install cocoapods
pod setup
[✓] Android Studio
• Android Studio at /Applications/Android Studio 3.0 Preview.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
[✓] Android Studio (version 2.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
[!] IntelliJ IDEA Community Edition (version 2017.2.3)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.io/intellij-setup/#installing-the-plugins
[✓] VS Code (version 1.20.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Dart Code extension version 2.8.2
[✓] Connected devices
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)
! Doctor found issues in 2 categories.
I am not using IOS (for now) and I am using VSCode.. so the issues are not causing the errors...
Is it something I have done to cause this or is it a bug in the packages?
Switching to the master channel or
adding
dependency_overrides:
async: ^2.0.4
to pubspec.yaml
and run `flutter package upgrade should do as workaround until the problem is solved.