I have a flutter app that I want to build the iOS. I Just bought a MacBook Air, OS Catalina v. 10.15.6 just for that. I have been struggling since this week just to install the Xcode from website or App Store, I am still getting an error when I open the Xcode saying: required content for platform android is missing. Please reinstall Xcode
I reinstalled Xcode 3 times already, so this is not the issue.
When I run flutter doctor, I first have a dialog saying: git command requires the command line develop tools.... and this is the output in Terminal:
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
✗ Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
[!] Xcode - develop for iOS and macOS (Xcode 11.6)
✗ Xcode requires additional components to be installed in order to run.
Launch Xcode and install additional required components when prompted or
run:
sudo xcodebuild -runFirstLaunch
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with
is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods. For more info, see
https://github.com/flutter/flutter/issues/14293.
To re-install CocoaPods, run:
sudo gem install cocoapods
[✓] Android Studio (version 4.0)
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
Does someone know what is wrong here, please?
Try to setup xcode according to this: https://flutter.dev/docs/get-started/install/macos#ios-setup
Related
System Settings:
MacOS Ventura
Android Studio Electric Eel
I am installing Flutter on my Intel Mac.
After Running flutter doctor
The outcome is this:
[✓] Flutter (Channel stable, 3.7.0, on macOS 13.2 22D49 darwin-x64, locale
en-MX)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for
more details.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.74.3)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
and after running flutter doctor --android-licenses the outcome is this:
Exception in thread "main" java.lang.UnsupportedClassVersionError:
com/android/prefs/AndroidLocationsProvider
has been compiled by a more recent version of the Java Runtime (class file version 55.0),
this version of the Java Runtime only recognizes class file versions up to 52.0
I installed Java for Mac from this link on January 2023 from Here
Has someone encountered the same error? How did you fix it?
I will try to give a more detailed solution:
Install the latest version of the Java SDK from this link
Pick Java 19 and the x64 DMG Installer (this worked for me)
Follow the installation instructions.
[optional] If necessary, set your JAVA_HOME path following these instructions (mac)
Test the installation by running flutter doctor --android-licenses
Additionally from what Tomas Ward said about installing the lastest SDK, for windows I found this for adding the JAVA_HOME to the path. Hope it helps.
For Windows
Download and Install latest JDK from [Java SE Development Kit 19.0.2][1]
Set a system variable as
Variable Name: JAVA_HOME
Variable Value: C:\Program Files\Java\jdk-19
Add a path variable name as %JAVA_HOME%\bin
Now run flutter doctor
Hope, it will solve.
[1]: https://www.oracle.com/java/technologies/downloads/#jdk19-windows
While installing the JDK by Oracle download works, best way to make sure that you have the correct version on MacOS is to install JDK using Homebrew (If you don't have Homebrew, Installation instructions: https://docs.brew.sh/Installation). Also, keeping it up-to-date is a lot easier this way.
brew install openjdk
If you have other OpenJDK versions installed, you may need to link this correct one:
brew link --force openjdk#19
To make it the default for your shell, add the following lines to ~/.zshrc:
export JAVA_HOME="/opt/homebrew/opt/openjdk"
export PATH="$JAVA_HOME/bin:$PATH"
And then:
source ~/.zshrc
You only need to do this once.
Then rerun: flutter doctor --android-licenses
Found the solution.
I needed to update the JDK from here.
I have uninstalled. JRE Java runtime environment and it works.
Yeah #Tomas Ward solution is worked For me. But Let me add some more details For the Windows users.
As #Tomas says We need to download Java SE Development Kit
19.0.2 First of all Click On This Link To Download Java SE Development Kit 19.0.2.
Then Download x64 Installer OR x64 MSI Installer Then
Install Java SE Development Kit In Your System.
Now You need to Set OR Update This New Java SE Development Kit Path into Your
JAVA_HOME Path.
And As You Set/Update JAVA_HOME Path Your Error will resolved.
I'm trying to run a flutter app on the android emulator via Android Studio on a Mac, but the virtual device option is greyed out, even though I created the virtual device. I don't have Xcode installed. See attached link:
Screenshot of android virtual device emulator greyed out.
I tried installing various SDK tools, restarted my Mac, and nothing has worked so far.
Screenshot of SDK tools installed.
When I run flutter emulators, it shows that there's one available, and that's the virtual device I created, so flutter does recognise it.
Pixel_4_XL_API_30 • Pixel 4 XL API 30 • Google • android
Here's the output for flutter doctor.
[✓] Flutter (Channel stable, 3.0.5, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✗] 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
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.70.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
Is the missing CocoaPods the issue?
I'm new to VScode and Flutter development. I'm attempting to install and run an android emulator in VScode without installing Android studio. The following is the step my step process which I have followed.
Installed VSCode in "C:\Program Files\Microsoft VS Code\Code.exe".
Extracted Flutter SDK 3.0.0 in E:\ as E:\flutter.
Downloaded tools_r26.1.1-windows and extracted it to E:\Android SDK.
In VScode, Installed Dart and flutter plugins respectively.
Set SDK path using the following command in VScode terminal
"flutter config --android-sdk E:\Android SDK".
I get response as Setting "android-sdk" value to "E:\Android". I restart IDE and goto next step.
Updated the paths in Environment variables by adding E:\flutter\bin to Path in both System and User Variables. Did the same for the Android SDK folder.
Ran Flutter Doctor and I get the following response
[√] Flutter (Channel stable, 3.0.0, on Microsoft Windows [Version 10.0.22000.675], locale en-IN)
[X] Android toolchain - develop for Android devices
X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[!] Android Studio (not installed)
[√] VS Code, 64-bit edition (version 1.67.1)
[√] Connected device (2 available)
[√] HTTP Host Availability
! Doctor found issues in 4 categories.
When i attempt to start emulator using ctrl+shift+p and select Flutter:Launch Emulator i can the follwing error
avdmanager is missing from the Android SDK
I need help here. Thank you in advance.
You look at the build tab at the bottom of the screen, it will display the error message and option to install the Build tools. Install it and you should be able to see the AVD Manager. Another way is to go to the SDK Manager. Under SDK Tools you will find the Android SDK Build tools.
Reference Got from https://www.tektutorialshub.com/android-studio/avd-manager-sdk-manager-missing-or-greyed-out-in-android-studio
I followed all the steps to install flutter in the web
When finished, I tried the command in the terminal: $ flutter doctor -v
the result was all good except one:
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /home/agung/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /home/agung/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
✗ Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.
I tried some tips, the last tips I used was: installing java with this:
sudo apt-get install openjdk-11-jdk
and change the java with this:
sudo update-alternatives --config java
and I tried any combinations, but nothing works. (I have followed any tips in stakeoverflow but nothing works)
How to fix this? To make result of 'flutter doctor -v' good?
Try following the install instructions in the official flutter site. The specific part on android licenses is here: https://flutter.dev/docs/get-started/install/linux#android-setup
In short: install Android Studio, install the sdks through Android Studio and accept the licenses there. The link goes into details as to why. Afterwards flutter doctor should return just peachy
Do notice that these are the instructions for Linux. Follow this link to pick your own OS and read the appropriate guide: https://flutter.dev/docs/get-started/install
In console run:
flutter doctor --android-licenses and answer y to all
I am facing issues with installation. I get the following when I run
flutter doctor
[✓] Flutter (Channel beta, v0.4.4, on Mac OS X 10.11.6 15G19009, locale en)
• Flutter version 0.4.4 at /Users/divyakrishnan/Development/flutter
• Framework revision f9bb4289e9 (11 days ago), 2018-05-11 21:44:54 -0700
• Engine revision 06afdfe54e
• Dart version 2.0.0-dev.54.0.flutter-46ab040e58
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/divyakrishnan/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: /Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
• All Android licenses accepted.
[!] iOS toolchain - develop for iOS devices
✗ 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
✗ 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
✗ 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_152-release-915-b01)
[!] IntelliJ IDEA Community Edition (version 2018.1.4)
• 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.io/intellij-setup/#installing-the-plugins
[!] Connected devices
! No devices available
I do not see the flutter or dart plugin in Android Studio 3.0 and IntelliJ.
The plugins are not installed by default with Android Studio or IntelliJ. You need to install them yourself using the instructions from this page:
Install the Flutter and Dart plugins
Flutter is supported by two plugins:
The Flutter plugin powers Flutter developer workflows (running, debugging, hot reload, etc.).
The Dart plugin offers code analysis (code validation as you type, code completions, etc.).
To install these:
Start the Android Studio.
Open plugin preferences (Preferences>Plugins on macOS, File>Settings>Plugins on Windows & Linux).
Select Browse repositories…, select the Flutter plugin and click install.
Click Yes when prompted to install the Dart plugin.
Click Restart when prompted.
Just follow these steps:
Go to Plugins.
Browse Repositories.
Search for flutter.
Tap on Install (a dialog will pop regarding dart dependency. click Yes).
Once the installation is finished restart android studio.
Hope it helps.
I had the same problem and these are the steps to solve my problem (Install the Flutter and Dart plugins):
Start Android Studio.
Open plugin preferences (Configure > Plugins as of v3.6.3.0 or later).
Note: Prior to v3.6.3.0, should follow: Open plugin preferences
(Preferences > Plugins on macOS, File >
Settings > Plugins on Windows & Linux)
Select the Flutter plugin and click Install.
Click Yes when prompted to install the Dart plugin.
Click Restart when prompted.
Run flutter doctor. You should get this output:
Installing Flutter and Dart Plugins into Android Studio is very easy--
Follow the steps to install-
Click on Configure --> Plugins
Browse Flutter repository from Search box
Click on install button
Click on Yes to install Dart plugin from Alter prompt
After completing all process Restart Android Studio to activate plugins
For more information Click here to find detail steps with graphical inteface
One of the most import thing always " RUN AS ADMINISTRATOR " you IDE i.e Android .. etc.
for flutter to avoid several errors.
This is the step for flutter install the Android Studio:
1.Go to Settings->Plugin->Install Flutter and Dart->Restart Android Studio
2.Download the flutter sdk
3.In the environment Variable->User Variable->
ANDROID_HOME F:\AndroidSDK(Paste your Android SDK Path)
Path:F:\AndroidSDk;(Paste your Android SDK Path)
c:\ProgramFiles\Java\jdk\1.8.0_20\bin;(Paste your jdk Path)
c:\Users\Desktop\flutter\bin;(Paste your Flutter SDK Path)
4.Git install at c:\ProgramFiles\Git
5.Open Gitbash
$flutter doctor
$flutter doctor --android-licenses
Accept the licences Y Y Y Y
Make sure your Device should be connected your PC
I found this solution myself, so there is no link for proof or details.
I tried installing Dart and Flutter plugin via Android Studio (File - Settings - Plugins - Market Place). Every time after install it showed Restart IDE. After restart every time Android Studio use to show Disable Flutter plugin or install Dart.
After many attempts (installing Dart via above option), what I did I went into
*\.AndroidStudio4.0\system\plugins
copied flutter-intellij.zip and Dart-*.*.zip files into
*\.AndroidStudio4.0\config\plugins
and just unzipped these 2 files ( used extract here option) and launched android studio, the error was gone and Android Studio showed some data collection message.
Now I can see File -> New -> New Flutter Project ...