Flutter NetworkImage errors - flutter

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.

Related

Unable to find any JVMs matching version "1.8"

Im new to flutter. Im running on macos catalina(10.15.7 (19H15)). I installed Flutter(2.2.3)
I download java 16 and installed it. And also i set the path.
java version "16.0.2" 2021-07-20
Java(TM) SE Runtime Environment (build 16.0.2+7-67)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)
thilinaabhisheka#Thilinas-MacBook-Air ~ % /usr/libexec/java_home -V
Matching Java Virtual Machines (1):
16.0.2, x86_64: "Java SE 16.0.2" /Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home
Im using Android studio 2020.3.1. when im run flutter doctor I got this error
Unable to find any JVMs matching version "1.8".
Unable to find any JVMs matching version "1.8".
[✓] Flutter (Channel stable, 2.2.3, on Mac OS X 10.15.7 19H15 darwin-x64, locale en-GB)
• Flutter version 2.2.3 at /Users/thilinaabhisheka/Developer/Flutter
• Framework revision f4abaa0735 (8 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
⣟Unable to find any JVMs matching version "1.8". [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/thilinaabhisheka/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /usr/bin/java
• Java version Java(TM) SE Runtime Environment (build 16.0.2+7-67)
• All Android licenses accepted.
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (version 2020.3)
• 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
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[✓] Connected device (2 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.159
! Doctor found issues in 2 categories.
Install homebrew
now try it brew install --cask homebrew/cask-versions/adoptopenjdk8
if you have used an android studio then set from the project structure.

(M1 Mac) Android Studio Doesn't Detect Android Emulator

I just downloaded android emulator through android studio. Didn't use the GitHub repo to download dmg file. Then I started the S level API android emulator from and manager. Android emulator boots but android studio doesn't detect and doesn't run app on it.
What could be the problem?
Reproduced:
Remove *.lock files in avd folder (Didn't work)
flutter doctor -v
[✓] Flutter (Channel stable, 2.2.1, on macOS 11.4 20F71 darwin-arm, locale tr-TR)
• Flutter version 2.2.1 at /Users/alperenbaskaya/Desktop/flutter
• Framework revision 02c026b03c (2 weeks ago), 2021-05-27 12:24:44 -0700
• Engine revision 0fdb562ac8
• Dart version 2.13.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/alperenbaskaya/Library/Android/sdk
• Platform android-30, build-tools 30.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_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5, Build version 12E262
• CocoaPods version 1.10.1
[✓] Android Studio (version 4.1)
• 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 1.8.0_242-release-1644-b3-6915495)
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
1)Try enabling USB Debugging in the Android emulator itself, as you would do on a real device. Settings-> Developer options-> enable USB Debugging.
2)Probably the project you are running is not compatible (API version/Hardware requirements) with the emulator settings. Check-in your build.gradle file if the target SDK and minimum SDK version are lower or equal to the SDK version of your Emulator.
You should also uncheck Tools > Android > Enable ADB Integration
If your case is different then restart your Android Studio and run the emulator again.
For more info:
Android studio: emulator is running but not showing up in Run App "choose a running device"
Android Studio does not detect the emulator
I went to the AVD Manager and in the options for the particular emulator I selected "Cold Boot Now" and it resolved my issue.

Flutter Doctor - Cannot determine if IntelliJ is installed

Flutter Doctor - Cannot determine if IntelliJ is installed
I have tried installing flutter 2.2 on my Mac OSX but flutter doctor was throwing a error for IntelliJ. I have already installed IntelliJ IDEA CE on my MAC OSX.
I have followed the below documentation but there was no log which confirms the folder in which it is searching for IntelliJ.
Reference Manual
(base) Thomass-MacBook-Pro:JLPT thomasvimaleasok$ flutter doctor -v
[✓] Flutter (Channel stable, 2.2.0, on macOS 11.1 20C69 darwin-x64, locale
en-IN)
• Flutter version 2.2.0 at
/Users/thomasvimaleasok/Projects/flutterapps/flutter
• Framework revision b22742018b (4 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 /Users/thomasvimaleasok/Library/Android/sdk
• Platform android-30, build-tools 30.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_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• 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
1.8.0_242-release-1644-b3-6222593)
[✗] Cannot determine if IntelliJ is installed
✗ Directory listing failed
[✓] VS Code (version 1.54.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
! Doctor found issues in 1 category.
I fought with this error for a while, but finally found a solution for my case.
There was a folder in my Applications folder (unrelated to IntelliJ) that wasn't readable. A sudo chmod a+rx on that location resolved the problem.
flutter doctor -vv turned up the error, but the problem appeared at the beginning of the execution log, and not anywhere near the Cannot determine if IntelliJ is installed error.

is it possible to fix Unexpected child "generate" found under "flutter" in flutter stable channel

I am add international to my flutter app, when I follow the docs and add config:
generate: true
shows this error:
Unexpected child "generate" found under "flutter".
Exception: Please correct the pubspec.yaml file at ./pubspec.yaml
Error detected in pubspec.yaml:
I search from internet and tell me to switch to the master channel could fix this problem. but I want to stay stable channel, any other way to fix this? Is is possible to stay stable channel and avoid this problem? This is the flutter env info:
$ ~/apps/flutter/bin/flutter doctor -v
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.7 19H114, locale en-CN)
• Flutter version 1.20.4 at /Users/dolphin/apps/flutter
• Framework revision fba99f6cf9 (4 months ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
• 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/dolphin/Library/Android/sdk
• Platform android-30, build-tools 30.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_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.10.0
[!] 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)
[!] IntelliJ IDEA Community Edition (version 2020.3.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
✗ 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.dev/intellij-setup/#installing-the-plugins
[!] IntelliJ IDEA Ultimate Edition (version 2019.2.2)
• IntelliJ at /Users/dolphin/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
✗ 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.dev/intellij-setup/#installing-the-plugins
[✓] 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)
• iPhone 11 Pro (mobile) • 4FEAF225-103D-4237-96D7-026059D2BDB4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-7
(simulator)
! Doctor found issues in 3 categories.
(base)
You are using Flutter version 1.20.4 but generate key was added in version 1.22. Update to the latest stable version.
[flutter_tools] generate a synthetic flutter_gen package on pub get #61261

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)