Flutter, Downloaded executables cannot execute on host. MacOS Ventura - flutter

On macOS Ventura Flutter doctor prints the following:
[!] Flutter (Channel master, 3.6.0-7.0.pre.51, on macOS 13.0.1 22A400
darwin-arm64, locale pl-PL)
✗ Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information
The link that Flutter refers to doesn't give anything as it refers to Linux.
I have already tried many solutions such as flutter clean and installing libstdc++.
Also, this problem has been raised in the following ticket:
Flutter Issues with MacOS 10.15 Catalina
however, 3 years ago Flutter had not been supported by MacOS 10.15. Is it now the same with macOS Ventura?
Update:
I ran sudo softwareupdate --install-rosetta --agree-to-license and it helped.

Related

can't run flutter project on chrome

I created a sample flutter project and I want to see the result in chrome.
when I run main.dart on chrome I get a white blank page as result!
here is my flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
Flutter (Channel stable, 3.3.0, on Ubuntu 22.04.1 LTS 5.15.0-56-
generic,locale en_US.UTF-8)
Android toolchain - develop for Android devices
cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more
details.
Chrome - develop for the web
Linux toolchain - develop for Linux desktop
clang++ is required for Linux development.
It is likely available from your distribution (e.g.: apt
install clang), or can be downloaded from
https://releases.llvm.org/
CMake is required for Linux development.
It is likely available from your distribution (e.g.: apt
install cmake), or can be downloaded from
https://cmake.org/download/
ninja is required for Linux development.
It is likely available from your distribution (e.g.: apt
install ninja-build), or can be downloaded from
https://github.com/ninja-build/ninja/releases
pkg-config is required for Linux development.
It is likely available from your distribution (e.g.: apt
install pkg-config), or can be downloaded from
https://www.freedesktop.org/wiki/Software/pkg-config/
Android Studio
android-studio-dir =
/home/mbunderline76/.local/share/JetBrains/Toolbox/apps/IDEA-
U/ch-0
Unable to find bundled Java version.
IntelliJ IDEA Ultimate Edition (version 2022.3)
Connected device (2 available)
HTTP Host Availability
Doctor found issues in 3 categories.
any idea what is going on?
by the way i'm using Intellij Idea Ultimate
Fix these issues first.
Flutter command Line tools
Flutter Java Bundled Link
then again run flutter doctor to make sure these errors are gone.
then run flutter -v -d chrome run Or Pick " Chrome Web " in your Vscode or AndroidStudio.
Hope this works, Enjoy.

Intellij and cocoa pods error Installing flutter on my macOS

I am trying to install flutter on my macOS Catalina for overs 3 days this 2 error refuse to allow me.
[✓] Android Studio (version 2021.2)
[✗] Cannot determine if IntelliJ is installed
✗ Directory listing failed
!] Xcode - develop for iOS and macOS
! CocoaPods 1.5.2 out of date (1.10.0 is recommended).
please help me with the solution of this issue
reinstall IntelliJ if you have it.
you have to update cocoapods below is command
brew upgrade cocoapods

Flutter and Dart plugin not installed errror when downgrade flutter even though they are installed on android studio

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel unknown, v1.4.0, on Microsoft Windows [Version 10.0.19041.804], locale en-IE)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit
https://flutter.io/setup/#android-setup for detailed
instructions.
[!] Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.52.1)
[!] Connected device
! No devices available
I was using the latest version of flutter, ran flutter doctor, everything was fine. I then downgraded flutter now it's saying I don't have the flutter and Dart pluggins installed even though I do.
I ran this command - flutter doctor --android-licenses and received the following error
A newer version of the Android SDK is required. To update, run: C:\Users\willm\AppData\Local\Android\sdk\tools\bin\sdkmanager --update
I then ran the command it told me to run and received this error
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more
I have now ran out of ideas, any advice on what to do without upgrading flutter again?
There are some solutions that maybe helpful
1). Solution 1
Run Flutter clean ann rebuild the app
2). Solution 2
Accept Licenses by running following commands
You just have to accept license by running this command
yes | sdkmanager --licenses
for Linux Use:
yes | ~/Android/Sdk/tools/bin/sdkmanager --licenses
for Windows Use:
%ANDROID_HOME%/tools/bin/sdkmanager --licenses
Note: set
%ANDROID_HOME%
as
C:\Users\username\AppData\Local\Android\Sdk
After that check licenses
Flutter:
flutter doctor --android-licenses
3).Solution 3
the current SDK version is incompatible with Java 9.
So, to solve it, you can downgrade your java version to Java 8, or with a workaround, you can export the following option on your terminal:
Linux:
export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
Windows:
set JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
And to make it stick, you can export the JAVA_OPTS in your profile file on Linux (.zshrc, .bashrc and etc.) or add as an environment permanently on Windows.
Then, you can type the flutter or sdkmanager command:
Flutter:
flutter doctor --android-licenses
sdkmanager:
sdkmanager --licenses
and type Y when needed to accept the licenses.
so i was experiencing the same issue after upgrading to flutter 2.0, but some packages aren't ready. because of that i had to downgrade. Even though flutter doctor said:
[!] Android Studio (version 4.1.0)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
I was still able to build and test app without issues. So try rebuilding and running app. hopefully when it's save to upgrade to 2.0 these little things will go.

Unable to build AAR, Task 'assembleAarDebug' not found

flutter build aar fail
error info :
Task 'assembleAarDebug' not found in root project 'android_generated'.
sudo flutter build aar fixed this problem,but wo want't do it,
fluter doctor info
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable/v1.17.5.taobao, v1.17.0-4.0.pre.32, on Mac OS X 10.15.6 19G2021, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✗] 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:
sudo gem install cocoapods
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.51.1)
[!] Connected device
! No devices available
some one can help me
I fixed this problem
org.gradle.configureondemand=false, This configuration is useful to me, this is the truth。
In the initialization script(aar_init_script.gradle),the task assembleAarDebug is be Added by the method projectsEvaluated。
if you set 'org.gradle.configureondemand=true', The execution order of the script has been modified, The task assembleAarDebug has not been added yet, gradle will execute it。
This is the cause of this error(Unable to build AAR, Task 'assembleAarDebug' not found).
Note that the priority of gradle.properties in the gradle home directory(/Users/username/.gradle/) is higher than that in the project。

Flutter Desktop Linux build failed

When I try to build my app to Flutter Desktop its fail with this message:
Launching lib/main.dart on Linux in debug mode...
Exception: Build process failed
My configuration is:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.19.0-2.0.pre.142, on Linux, locale pt_BR.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 3.6)
[✓] Connected device (1 available)
Can anyone know how to fix this?
Thanks
I had the same issue.
First I ran flutter run -v -d linux, I followed the log and I noticed it an OS Error
Unhandled exception:
FileSystemException: Setting current working directory failed
So, I firstly switch to the master channel (solution for some people), run flutter upgrade and I was getting the same error.
My working dir is /home/xylia/Flutter\ Apps/github_pages and I felt it might be the space from the folder name (I had an issue like that once), so I created a new folder without space and it worked!
I am not totally sure if changing channel to master helped but there is no harm in doing it
I don't know if you already found a solution but for everyone having this problem, I solved it by doing the following:
Inside your project root directory delete the linux folder, like rm -rf linux.
Run flutter clean to delete the build folder and other related files.
Then run flutter create . to make flutter recreate your linux folder.
I had the same problem my fix was to create/run the flutter project on primary SSD/HDD drive.
In my case, it was a dependencies problem. I was trying to use svg_flutter package in a desktop app (which is not supported).
Try running flutter run -v -d linux and check if any error message corresponds with new packages that you added recently.