Flutter SDK 0.0.0-unknown [xcrun: error: invalid active developer path] after MacOS Ventura update - flutter

I upgraded my software yesterday to MacOS Ventura. Today when I opened my project so I can work on it, I cannot get to build the app because I get this error: The current Flutter SDK version is 0.0.0-unknown.
Running "flutter pub get" in elfi_menu...
The current Flutter SDK version is 0.0.0-unknown.
Because country_icons 2.0.2 requires Flutter SDK version >=0.1.4 and no versions of country_icons match >2.0.2 <3.0.0, country_icons ^2.0.2 is forbidden.
So, because elfi_menu depends on country_icons ^2.0.2, version solving failed.
pub get failed (1; So, because elfi_menu depends on country_icons ^2.0.2, version solving failed.)
Exited (1)
I have tried to reinstall flutter, I get the same error, I also tried opening a new project, same error. I also looked it up on the internet but I saw pretty old similar issues, they are fixing it on Windows and it is not the same here on mac from what I've seen.
Does anyone have any ideas why this happened and how to fix it?
Thank you very much in advance
EDIT
Above the output I have written in the code, this is a line that appeared:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
I searched for the solve on the internet and this like solves the problem, written in the terminal:
xcode-select --install

This fixed it for me:
Open Xcode
Go to Preferences
Go to Locations
Use the "Command Line Tools" dropdown to select the available Command Line Tools
Mine was empty and I chose the single available option: "Xcode 14.0.1 (...)"
Restart console, everything should be working

To solve the problem, I have written this in the terminal:
xcode-select --install
source: https://apple.stackexchange.com/questions/254380/why-am-i-getting-an-invalid-active-developer-path-when-attempting-to-use-git-a

Related

Flutter simply showing 'sysctl -n hw.optional.arm64' returned unexpected output: ''

Not sure which details are relevant so I'll include as many as possible.
Had to upgrade flutter today and instead of working when I typed in 'flutter upgrade' into android studios terminal/Iterm2/terminal zsh I was met with the following response.
'sysctl -n hw.optional.arm64' returned unexpected output: ''
When I search for this issue the only thing i can find is this post which states that sysctl can't be found. The path does appear to be in my .zshrc but still not working. I can't use which or where sysctl as it just says 'sysctl not found'
When I try to upgrade flutter through brew (brew install --cask flutter) it downloads fine but on installing it throws the following error:
==> Purging files for version 3.3.5 of Cask flutter
Error: It seems there is already a Binary at '/opt/homebrew/bin/dart'.
I can't continue working as I need the new flutter version and it seems the web doesn't have much to show for this particular error.
I can't flutter --version, flutter doctor or anything of the sort as I just get the same message.
I'm using:
MacOS monterey 12.6 macbook air.
Android studios
Iterm2
Ohmyzsh
When I open android studios it shows me the following:
"Flutter device daemon #1 exited (exit code 1), stderr: 'sysctl -n hw.optional.arm64' returned unexpected output: '' in a pop up window.
Pubspec has been edited > get dependencies > Upgrade depenedencies: Both of which have the same error as in the title.
The current configured flutter SDK is not known to be fully supported. Please update your SDK and restart intelliJ which I think is what I've been trying to do.
This is an answer I hope will be helpful for others who have the same issue.
Other answers suggested a fix by just updating the path document (.zshrc) but this is what helped me as that did not and my paths were up to date.
Sadly, it's as simple as manually deleting all my flutter SDK files locally. Downloading them again (this time the latest one) and unzipping it into the same place. Didn't even have to update the path).
Worked a charm, issues appear to be all gone except that the dialogue in android studios is still saying that there are dependencies that need getting and upgrading (but doesn't go away even when I've run it).
I solved it by removing the old flutter SDK, downloading the latest version, and setting it up again.
it works perfectly for me!

i am getting an error in Android toolchain when i ran flutter doctor

I have started with the setup of flutter updated version and am a total beginner in this platform. This is the error I have been getting. Could you please help me?
You have to install Android SDK Command-line Tools (in SDK Manager).
After Installing, accept the android licensces (in CMD)
flutter doctor --android-licenses
Either install Android Studio to get the required dependecies or download an android sdkmanager and check its path (path/to/sdkmanager should be the path to that).
To avoid any problems for beginners, I would just install Android Studio here, set it up until it installs the android sdk, then switch to Flutter: that was the only way to fix this since some time ago if I remember correctly
Please first run this command
flutter doctor --android-licenses
then follow this link : Android/Sdk is missing a Tools folder, meaing no sdkmanager, meaning "Android license status unknown" error

Can't run flutter project due to error VERBOSE.dart error, isolate error

When I try to run my flutter-project code on the iOS simulator in VS code, I get the following error on the console:
Launching lib/main.dart on iPhone 11 Pro in debug mode...
lib/main.dart:1
Xcode build done. 24.4s
[VERBOSE-2:shell.cc(103)] Dart Error: Can't load Kernel binary: Invalid SDK hash.
[VERBOSE-2:dart_isolate.cc(171)] Could not prepare isolate.
[VERBOSE-2:runtime_controller.cc(415)] Could not create root isolate.
[VERBOSE-2:shell.cc(588)] Could not launch engine with configuration.
Thanks in advance.
Hi!
In my case, the error was caused by the forced shutdown of the IDE.
After manually selecting the libraries, I identified the one that was causing the problem, updated the project without it, and updated the project again with it.
With that the problem was solved.
Hope I have helped, if yes, please flag.
Could you delete the bin/cache folder, then run app
Open terminal and run: $ flutter channel beta
"it will install beta version, once installation is done, try it!"
"In case you willing to change the beta version to stable version you can use the following:"
$ flutter channel stable

ERROR with flutter: CocoaPods not installed even if it is installed

I am trying to run my code on AndroidStudio by using Flutter but when I run it shows an error:
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 11.
flutter doctor shows that all is fine, I looked around a lot and tried lots of things like uninstall it and install it again, and tried adding:
dev_dependencies:
build_runner: ^1.10.0
dependency_overrides:
analyzer: 0.39.14
and tried
flutter channel stable
flutter upgrade
and tried
flutter channel master
flutter upgrade
But nothing worked, note that when I write "which pod" it shows the path, that means it exists right? then what is the problem? please help :(
have you tried to run pod install from the ios folder?
The only thing that worked with me is using android emulator, ios simulator still show the same error
I had the same issue and I found a solution, but with still an answered question. See my question (and one partial solution) here
The partial solution is: in Android Studio, click on the tab "Terminal" at the bottom of the IDE and in this pane, type flutter run. It does the same as the button Run, and Android Studio stopped complaining about CocaPods.
To stop the app, type q in the same terminal.

"The current configured Flutter SDK is not known to be fully supported. Please update your SDK and restart IntelliJ"

I have a problem that I'm trying to solve since last week, I've been searching about this issue and nothing works. I tried to reinstall the flutter and didn't work aswell. The image below is the first issue I have.
Then I went to "Tools -> Flutter -> Flutter Upgrade" and it shows me this message:
C:\src\flutter\bin\flutter.bat --no-color upgrade
fatal: unterminated line in .git/packed-refs: ...
Building flutter tool...
Running pub upgrade...
ProcessException: Process exited abnormally:
fatal: unterminated line in .git/packed-refs: ...
Command: git fetch --tags
Process finished with exit code 1
And when I tap to "Run 'main.dart'", it shows me this message:
fatal: unterminated line in .git/packed-refs: ...
Building flutter tool...
Running pub upgrade...
Running "flutter pub get" in olx...
The current Flutter SDK version is 0.0.0-unknown.
Because carousel_pro 1.0.0 requires Flutter SDK version >=1.2.0 <2.0.0 and no versions of carousel_pro match >1.0.0 <2.0.0, carousel_pro ^1.0.0 is forbidden.
So, because olx depends on carousel_pro ^1.0.0, version solving failed.
pub get failed (1; So, because olx depends on carousel_pro ^1.0.0, version solving failed.)
What could I do to fix these issues?
(Thanks for listening :)
Here the issue is raised due to Flutter SDK version because it is unknown.
These are some steps that I have followed to solve this problem
Run the following git command into your terminal
=> git clone -b master https://github.com/flutter/flutter.git
(this command will clone a flutter folder which contains latest version of Flutter SDK. get more info about SDK - here)
after cloning, we just need to move cloned folder to our default location of flutter SDK.
In my case path of flutter SDK is as follows(ubuntu) -
=> file:///home/bulbul/snap/flutter/common/flutter
I replaced the last flutter folder with the folder which I have cloned before.
then I ran the "flutter --version" command for getting the version of flutter SDK and it gave me the latest version of flutter SDK and the problem was solved.
It worked for me hopefully It will work for you as well.
Happy learning :)
Use the latest flutter SDK then check if the git is available from the command line using git --version. If it's not available from the command line android studio terminal then add git to system path variable and restart android studio.