Unable to find any JVMs matching version "1.8" - flutter

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.

Related

Warning: CocoaPods not installed. Skipping pod install Error in Android Studio

I tried to run my app i am getting the error as CocoaPods not installed. Skipping pod
install. When i run the app in the terminal using 'flutter run' it's working perfectly. I don't know why it's not working in Android studio.
Please find the error below.
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Warning: CocoaPods not installed. Skipping pod install.
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.
CocoaPods not installed or not in valid state.
Error launching application on iPhone 12 Pro Max.
Flutter doctor also i don't find any issue.
flutter doctor -v
[✓] Flutter (Channel stable, 3.0.4, on macOS 12.4 21F79 darwin-arm, locale en-GB)
• Flutter version 3.0.4 at /opt/homebrew/Caskroom/flutter/2.5.0/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 85684f9300 (2 weeks ago), 2022-06-30 13:22:47 -0700
• Engine revision 6ba2af10bb
• Dart version 2.17.5
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/elamparithibalakrishnan/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] 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
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[✓] Connected device (3 available)
• iPhone 12 Pro Max (mobile) • 0C7D4F63-17B1-4E66-8277-767ED0672937 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-5
(simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.4 21F79 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 103.0.5060.114
! Error: iPhone is not connected. Xcode will continue when iPhone is connected. (code -13)
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Can anyone please help me on this issue.
Thanks in advance.

Unable to run flutter for Desktop, but can build flutter for desktop (Linux)

My flutter app builds and runs just fine, but I cannot run it in debug mode.
Below is the error I get:
Unable to start executable "build/linux/x64/debug/bundle/polls": ProcessException: Failed to find "build/linux/x64/debug/bundle/polls" in the search path.
Command: build/linux/x64/debug/bundle/polls
ProcessException: Failed to find "build/linux/x64/debug/bundle/polls" in the search path.
Command: build/linux/x64/debug/bundle/polls
The app name I am working on is called polls, and when I look into the directories, the build/linux/x64/release directory has a directory called bundle with the compiled binary, but the build/linux/x64/debug doesn't have the bundle directory.
How do I make flutter run -d linux create the missing directory when compiling the debug version?
My environment configurations are as shown below:
[✓] Flutter (Channel stable, 3.0.1, on Linux Mint 20.3 5.4.0-110-generic, locale en_GB.UTF-8)
• Flutter version 3.0.1 at /usr/local/src/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision fb57da5f94 (11 days ago), 2022-05-19 15:50:29 -0700
• Engine revision caaafc5604
• Dart version 2.17.1
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /home/arthur/Android/Sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: /usr/local/src/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1
[✓] Android Studio (version 2021.1)
• Android Studio at /usr/local/src/android-studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin version 211.7817
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
[✓] VS Code (version 1.67.2)
• VS Code at /usr/share/code
• Flutter extension version 3.40.0
[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • Linux Mint 20.3 5.4.0-110-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 102.0.5005.61
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
I just ran into a similar issue, where a sample flutter app, that I created via Visual Studio Code, was unable to find bundle in the path.
As a test, in a completely different directory, from a terminal outside of
Visual Studio Code, I ran flutter create startup_namer and was able to
successfully invoke flutter run -d linux on it.
I solved by running flutter clean

(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.

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.