my problem is this:
I want to connect my app to Firebase. I followed all the steps and did everything according to the instructions. When I tried to debug the app, the following error came up:
When I enter - flutter run - from the terminal, the following happens:
In flutter doctor -v the following comes out:
[✓] Flutter (Channel stable, 1.20.4, on macOS 11.2 20D64, locale de)
• Flutter version 1.20.4 at /Users/danielalakin/development/flutter
• Framework revision fba99f6cf9 (5 months ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK
version 30.0.2)
• Android SDK at /Users/danielalakin/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 12.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[!] 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-6222593)
[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.19.0
[✓] Connected device (1 available)
• iPhone 12 Pro Max (mobile) • C0991E0B-425B-46BD-9DEA-674181136D99 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
And I have the following versions and paths:
$ pod --version:
1.10.1
$ which pod:
/usr/local/bin/pod
$ which gem:
/Users/danielalakin/.rvm/rubies/ruby-3.0.0/bin/gem
$ which ruby:
/Users/danielalakin/.rvm/rubies/ruby-3.0.0/bin/ruby
Do you know how I can solve this problem?
PS: I work on Visual Studio Code and XCode. I use MacOS Big Sur Version 11.2.
I had this same error a number of times in the past, and once right after I upgraded to Flutter 2.0.1 just now. The solution for me was always to run (as previously suggested):
sudo gem install cocoapods then restart my IDE. I use Android Studio, but same should apply to VSCode as well.
The only command who work for me is this one :
brew install cocoapods
For me none of these was helpful,
The workaround was opening the Android studio using Terminal rather than GUI
open /Applications/Android\ Studio.app
After that, I can use GUI and there was no problem :)!
you can find more info here:
https://github.com/flutter/flutter-intellij/issues/4981#issuecomment-751443625
Restarting VSCode usually fixes the problem, but make sure to close it completely - Cmd+Q on macOS.
Another thing worth trying is cleaning XCode workspace, this can be done via flutter clean command.
You can try:
sudo gem install cocoapods
if you use Android Studio try restoring the cache in
file -> invalidate cache/restart
In my case I had to reinstall cocoa pods but additionally I had to reinstall my Visual Studio Code IDE.
I ran into this problem on Android Studio 4.1.3. Updating to Bumblebee 2021.1.1 Patch 3 solved it for me.
run this command :
sudo gem install ffi
if on running flutter doctor, it still says cocoapods not installed then run this command
sudo gem install cocoapods
Related
this is my second day on Mac. I just bought the new M1 one and I started installing my apps.
I was building some apps with Flutter in Windows.
Now I installed Xcode and it's working with iPhone 13 emulator but it's not showing is vsCODE.
This is the output of Flutter Doctor
[flutter] flutter doctor -v
[✓] Flutter (Channel stable, 2.5.3, on macOS 11.3.1 20E241 darwin-arm, locale fr-TN)
• Flutter version 2.5.3 at /Users/macbookpro/DevTools/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (il y a 3 semaines), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4
[✗] Android toolchain - develop for Android devices
• Android SDK at /Users/macbookpro/Library/Android/sdk
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
[!] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 13.1, Build version 13A1030d
! CocoaPods 1.8.4 out of date (1.10.0 is recommended).
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 upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] 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)
[✓] VS Code (version 1.61.2)
• VS Code at /Users/macbookpro/Downloads/Visual Studio Code.app/Contents
• Flutter extension version 3.28.0
[!] Connected device
! No devices available
! Doctor found issues in 4 categories.
exit code 0
On Mac you still have to start your Emulator in XCode, then after you created your Flutter Project you can open the directory on VS, do not forget to install the Flutter Plugin in VS.
I had a rough time a new macos user. I tried
sudo gem install cocoapods
then got the response
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210308-2865-1ivyp7s.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
i had installed cocoapods earlier using homebrew.
So instead this worked, you have to get the latest version first with homebrew.
brew install cocoapods
then
brew link --overwrite cocoapods
flutter doctor -v
will output
[✓] 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)
[✓] VS Code (version 1.63.0)
• VS Code at /Users/myname/Downloads/Visual Studio Code.app/Contents
• Flutter extension version 3.29.0
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • • ios
• com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
• Chrome (web) • chrome •
web-javascript • Google Chrome 96.
Recently I've joined a project of a flutter app using firebase, and everything was fine until it comes to make the production builds. For Android it works fine. But for ios I'm facing a problem that in the simulator it runs without a problem but when I uploaded it to Testflight for my coworkers to test it immediately crashes when opened.
That's my flutter doctor -v:
[✓] Flutter (Channel unknown, 2.2.2, on macOS 11.2.3 20D91 darwin-x64, locale
pt-BR)
• Flutter version 2.2.2 at /Users/leonardofelix/flutter
• Framework revision d79295af24 (4 months ago), 2021-06-11 08:56:01 -0700
• Engine revision 91c9fc8fe0
• Dart version 2.13.3
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/leonardofelix/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)
! Some Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.10.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] 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)
[✓] VS Code (version 1.61.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.27.0
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • 94BE45CC-ED04-4892-B3A6-3F43D0A147AD • ios
• com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
• Chrome (web) • chrome •
web-javascript • Google Chrome 94.0.4606.81
And the crash report that a tester of testflight sent to me:
crashlog.crash
I've already tested some things that I found googling, like add the Google-Services.plist again using xcode and verified if the schemas to the archive were pointing to release mode. But none of them worked.
If any additional data is needed, I'll be glad to provide. So thanks in advance for any help.
Well, I found the error. I had changed the Flutter version using git (thus, the Flutter folder is a git repository). When I changed the version, it left the cache from the other Flutter version, and that cache was causing the problem.
One thing that helped me to find this out was running the release build in a physical device using Xcode; there it prompt me the following error:
Error while initializing the Dart VM: Wrong full snapshot version, expected '9cf77f4405212c45daf608e1cd646852' found 'e4a09dbf2bb120fe4674e0576617a0dc'
And for that, I found a solution on the web. What I did was to remove the folder cache inside <yourFlutterDir>/bin and run the following commands in the Flutter directory:
git reset --hard
git clean -xffd
flutter doctor
And then, I went to my Flutter project folder, ran flutter clean, and finally flutter build ios.
So the project built successfully, and the app worked in iOS.
Steps to Reproduce
Simply trying to publish my app to ios store. Already available on Play store.
I cannot archive in Xcode, constantly running into issues. Currently have these issues when attempting to archive:
When attempting to run pod install in the ios directory, I continue to get this warning (which according to my research seems to be more of an error):
I tried following everything in this very long thread thread to resolve this issue, but nothing has worked.
I was able to remove another warning by uncommenting line #2 in the Podfile, platform :ios, '9.0'.
I have tried closing Xcode while making changes, and have tried restarting my computer.
I can flutter run and the app will work correctly on my iPhone when it is connected to my macbook.
Other threads from which I've tried everything:
https://github.com/flutter/flutter/issues/42974
https://github.com/flutter/flutter/issues/20685
https://github.com/flutter/flutter/issues/48103
https://github.com/X-Wei/flutter_catalog/issues/26
https://github.com/flutter/flutter/issues/28870
Expected results:
I can successfully archive in Xcode.
Actual results:
Flutter doctor seems to indicate everything is fine, but I continue to get this errors when trying to archive.
AdministorsMBP4:mem_plus_plus matt$ flutter doctor --verbose
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.3 19D76, locale en-US)
• Flutter version 1.12.13+hotfix.5 at /Users/matt/development/flutter
• Framework revision 27321ebbad (9 weeks ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at /Users/matt/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• 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-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.1, Build version 11A1027
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.1.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[!] IntelliJ IDEA Community Edition (version 2019.2.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.dev/intellij-setup/#installing-the-plugins
[✓] Connected device (1 available)
• Takkeezi’s iPhone • {redacted} • ios • iOS 12.4.4
Try to this.
flutter clean
pod install
build project
Check a pods module
Pod file
Whenever I run this command from terminal: flutter build ios in the root of the project for my flutter app, I get back:
Cannot find "xcodebuild". Xcode 9.0 or greater is required to develop for iOS.
Encountered error while building for device.
I have the lastest Xcode (Version 10.0).
Flutter doctor:
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-GB)
• Flutter version 0.8.2 at /Users/h/flutter
• Framework revision 5ab9e70727 (2 weeks ago), 2018-09-07 12:33:05 -0700
• Engine revision 58a1894a1c
• Dart version 2.1.0-dev.3.1.flutter-760a9690c2
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/h/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.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-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
• ios-deploy 1.9.2
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 24.2.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] Connected devices (1 available)
• h iPhone • 77afb908fc6c490d3fca62cdde9a74ab4e45b4f0 • ios • iOS 11.4.1
! Doctor found issues in 1 category.
I assume the IOS issue is thrown as I am running Xcode from an external HD
The source of my problem was that Flutter could not find the latest installed version of Xcode.
To fix it, go to Xcode->preferences->locations->set value for command Line tools.
The suggestion from flutter doctor -v is quite clear
✗ 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/Develope
You could try starting Xcode and agree when it asks to install missing components.
Id suggest you try the dev or master channel where support for Xcode 10 should have landed. Otherwise check this suggestion https://github.com/flutter/flutter/issues/20685#issuecomment-413524718
Run the following commands in your terminal:
1- cd your_project_path
2- sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
3- sudo xcodebuild -license
4- open -a Simulator
5- flutter run
If you Installed Xcode 10 manually via Apple Developer Download Center or Other Sources, then At first, RENAME your Xcode to the Version name you downloaded, like I downloaded the Xcode 10.1 version, so for me the renamed name would be Xcode10.1.app the .app extension is optional as it already has .app extension...
After that, paste this Command on your Terminal,
sudo xcode-select --switch /Applications/Xcode10.1.app/Contents/Developer
Note: the Xcode Version (i.e. Xcode10.1.app ) is Mendatory, if it's there good otherwise, Rename and add it, it's COMPLETELY SAFE and doesn't have any side effects
If you already have Xcode and this error randomly appears, just run these commands, as recommended by Flutter Doctor:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
Install Xcode (get it from https://developer.apple.com/xcode/) if you don't have it yet.
Accept the Terms and Conditions.
Ensure Xcode app is in the /Applications directory (NOT /Users/{user}/Applications).
Point xcode-select to the Xcode app Developer directory using the following command:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Reference: https://github.com/flutter/flutter/issues/6308
According to #matt-hamman
If your Xcode was updated to v14.1 and your Mac is running macOS 12.6, this will happen because the macOS SDK that xcodebuild is looking for happens to be MacOSX12.3.sdk while your OS has already been updated to 12.6.
Running xcode-select -p returns /Applications/Xcode.app/Contents/Developer, which is what Xcode 14 configured automatically. (Changing this via sudo xcode-select --switch /Library/Developer/CommandLineTools fixes git, but breaks other things in subtle ways (like some CocoaPods commands).)
To fix this issue, simply run:
sudo cp -R /Library/Developer/CommandLineTools/SDKs/MacOSX12* /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
Further details can be gleaned from the original answer here
To fix it, go to Xcode->preferences->locations->set value for command Line tools.
I've just upgraded my flutter, after upgradation I am unable to run any flutter project on my Android Studio. I am getting this error message.
The current Dart SDK version is 2.1.0-dev.0.0.flutter-be6309690f.
Because buddy depends on flutter_built_redux 0.4.5 which requires SDK
version >=1.19.0 <2.0.0, version solving failed.
pub get failed (1)
How can I downgrade Dart or how can I resolve this issue, I am running android studio on mac.
I've tried by changing flutter channels dev and master but it doesn't make a difference.
flutter doctor -v result:
[✓] Flutter (Channel dev, v0.6.0, on Mac OS X 10.13.4 17E202, locale en-IN)
• Flutter version 0.6.0 at /Users/pro/Downloads/flutter
• Framework revision 9299c02cf7 (5 days ago), 2018-08-16 00:35:12 +0200
• Engine revision e3687f70c7
• Dart version 2.1.0-dev.0.0.flutter-be6309690f
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/pro/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.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-
1024-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.4.1, Build version 9F2000
• ios-deploy 1.9.2
• CocoaPods version 1.5.0
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 27.1.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[!] Connected devices
! No devices available
flutter_built_redux package doesn't met the flutter dependency.
The error is caused by package not by flutter sdk.
see here
https://github.com/davidmarne/flutter_built_redux/blob/master/pubspec.yaml#L22
AND
you can post issue on flutter_built_redux package using this link
https://github.com/davidmarne/flutter_built_redux/issues/new?title=support%20for%20flutter%20sdk%202.1.0.dev&body=please%20upgrade%20the%20package%20for%20new%20flutter%20releases
Flutter includes a bundled Dart SDK (under its bin/cache directory) pinned to the same version used in the engine that we compile into your shipping iOS/Android app. As such, the only way to use Flutter with a different version of Dart is to use an older version of Flutter.
To do this, cd to the Flutter SDK directory. You can list the available versions by running git tag. To switch to a version, use git checkout. For example, to switch to v0.8.1 you’d run git checkout v0.8.1. When you’d like to switch back to the beta channel, run git checkout beta.
That said, generally I’d advise you to stick to beta and file an issue (or send a pull request) to the maintainer of any packages that haven’t yet been updated to Dart 2. You may also want to check the dependencies listed in your pubspec.yaml to see if there are newer versions available on pub.dartlang.org. It may just be a matter of updating your dependencies to a newer version.
I guess this is an quiver package dependency problem. Once in an update i had face same issue. That time i solve this by adding this lines to pubspec.yaml
dependency_overrides:
quiver: ^2.0.0+1
Flutter has the following channels, in increasing order of stability:
master
dev
beta
stable
Generally, I’d advise you to stick to the beta it works fine with all the packages.
It's not necessary but i think you should have to install Android Studio again with latest version.then add flutter and dart plugin there then Add Flutter SDK path in settings>Plugins>Flutter>Sdk-Path so locate your flutter sdk that you have installed in your PC may be located at C so add that path.And it may work.
And must have latest Flutter and Dart SDK installed.
You can download flutter SDK from here:
https://flutter.dev/docs/development/tools/sdk/releases