Flutter Issues with MacOS 10.15 Catalina - flutter

After updating to MacOS 10.15 Catalina, there are problems with Flutter.
Specifically, Flutter doctor complaints about the following:
Downloaded executables cannot execute on host.
CocoaPods not installed.
It is important to explain that before updating, when my computer was running Mojave 10.14, these issues with Flutter did not exist, thus flutter doctor -v reported no issues whatsoever.
Regarding the first issue: Downloaded executables cannot execute on host.
Flutter doctor offers this link: https://github.com/flutter/flutter/issues/6207
Nevertheless, the linked article refers to Linux, not MacOS...
Regarding the second issue: CocoaPods not installed.
Flutter doctor suggests the following solution:
brew install cocoapods
pod setup
Nevertheless, although "install cocoapods" works fine, "pod setup" fails, indicating the following error:
/usr/local/bin/pod: /usr/local/Cellar/cocoapods/1.7.4/libexec/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/pod: line 2: /usr/local/Cellar/cocoapods/1.7.4/libexec/bin/pod: Undefined error: 0
Running flutter doctor -v offers the following result:
[!] Flutter (Channel dev, v1.8.1, on Mac OS X 10.15 19A501i, locale es-PA)
• Flutter version 1.8.1 at /Users/podriasereltuyo/flutter
• Framework revision d3eee57c0b (7 days ago), 2019-07-08 11:04:24 -0700
• Engine revision 3c51a7bfff
• Dart version 2.5.0 (build 2.5.0-dev.0.0 b5aeaa6796)
✗ Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
MacBook-Air-de-Podria:ptyce podriasereltuyo$ flutter doctor -v
[!] Flutter (Channel dev, v1.8.1, on Mac OS X 10.15 19A501i, locale es-PA)
• Flutter version 1.8.1 at /Users/podriasereltuyo/flutter
• Framework revision d3eee57c0b (7 days ago), 2019-07-08 11:04:24 -0700
• Engine revision 3c51a7bfff
• Dart version 2.5.0 (build 2.5.0-dev.0.0 b5aeaa6796)
✗ Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at /Users/podriasereltuyo/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 10.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2.1, Build version 10E1001
✗ 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:
brew install cocoapods
pod setup
[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.0.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.0.0 (API 26) (emulator)
! Doctor found issues in 2 categories.
I humbly wish to ask for your help, please, to clarify what does it mean when it says Downloaded executables cannot execute on host?
and, what may be done to resolve it? Please?
also,
if cocoapods was running beautifully when using Mojave 10.14, what may be the issue now, being seemingly unable to successfully run pod setup?
is anyone else here having any issues with Flutter after upgrading to MacOs 10.15 Catalina Beta, which you were not having before with Mojave?
THANK YOU !!!
Update...
Researching about this issue, I've encountered a very sad comment, which suggests that basically there is no support for Flutter in Catalina...
Please find it here:
https://github.com/flutter/flutter/issues/34000
The comment says:
Flutter is not yet supported on macOS 10.15, although we're obviously looking at it. This is a duplicate of #22598, which relates to the removal of 32-bit support from Catalina.
So, I am beginning to think that it might be a good idea to go back to Mojave's safety, at least Flutter was working fine...
Please share your thoughts, suggestions, advise?

Its possible to install cocoapods, run flutter build ios and run on the iOS simulator.
brew uninstall cocoapods
sudo gem install -n /usr/local/bin cocoapods
pod install
Detailed instructions are here: This terminal won't let me run or install cocoa pods because I am on MacOS Catalina Beta?

For this issue:
[!] Flutter (Channel dev, v1.7.11, on Mac OS X 10.15 19A487m, locale
en-SE) ✗ Downloaded executables cannot execute on host. See
https://github.com/flutter/flutter/issues/6207 for more information
Easy fix:
Open a terminal on MAC and run the following commands:
> flutter channel master
> flutter doctor
Enjoy

Uninstall and install it again (fe if you are using homebrew).
Just run:
brew uninstall cocoapods && brew install cocoapods

Related

Unable to find bundled Java version. MacBook Air M1

I was using flutter on MacBook Pro with intel. It was working fine. Now I switch to MacBook Air with M1 chip. I get error Unable to find bundled Java version. How can I fix it pleas?
flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.2 20D64 darwin-arm, locale
en-KW)
• Flutter version 2.2.3 at /Users/mac/FlutterDev/flutter
• Framework revision f4abaa0735 (5 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/mac/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Library/Internet
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.10.2
[✓] 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)
• macOS (desktop) • macos • darwin-arm64 • macOS 11.2 20D64 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.131
! Doctor found issues in 1 category.
I fix it by changing Contents folder location.
from
/Applications/Android Studio Preview.app/Contents/jre/Contents
to
/Applications/Android Studio Preview.app/Contents/jre/jdk/Contents
after close the android studio preview I face a problem with start it again.
but in general flutter doctor works with no Issues.
I had the same problem and solved it this way
cd /Applications/Android\ Studio.app/Contents/jre
ln -s /Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk jdk
flutter doctor -v
enter image description here
I had the same problem a few days ago when I installed Android Studio for ARM64, I noticed that JDK from Oracle right now was running in x64. Looking in the web I found that you can install a native JDK for M1.
So basically the way that I found to solve your problem of the best way was installing JDK 15 arm64 from Azul
It improves a lot the compiler time for Android app's.
about ✗ Unable to find bundled Java version. • Try updating or re-installing Android Studio.
I have another environments. But you can think by use my answer.
In my opinion, you need to install JDK(Java development Kit).
If you can use Visual studio extensions or android studio plugin(i don't know mac environment), find Java extension pack for installation JDK(this is on visual studio)and install. You have to select JAVA Path correctly. If you select it on install process, you don't need to choose Path process individually. You can see this path on System variable Path as JAVA_HOME named automatically. not user path.
I hope your flutter is well
First of all, check what's going on with your JAVA_HOME:
echo $JAVA_HOME
I assume in your case you would already have it set correctly, so it should appear in a path like this (the jdk version may vary):
/Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home
If it the path looks the same (or same with different java version), and you have also checked "where java", "java -version" etc, to make sure that the terminal recognises your java well and there is no other obvious java issue, that means that the only thing you need to do is to run these commands:
cd /Applications/Android\ Studio.app/Contents/jre
ln -s ../jre jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
Now if you run flutter doctor -v, you should see no java errors and something like this instead of the previous error:
• Java binary at: /Applications/AndroidStudio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
And no more errors :)
Hope this helps! It definitely solved the issue for me after switching to an M1 MacBook Air and upgrading the AndroidStudio to ArcticFox 2020.3.1 Patch 1).

How to Install Android SDK commandline tool for Flutter upgrade error?

How to install Android SDK commandline tool on a Ubuntu remote server which doesn't have Display/GUI.
When I run, 'flutter upgrade' it gives me the below and I wanted to know if I can use Android SDK commandline tool for resolving the issue.
$flutter upgrade
Upgrading Flutter from /home/yvelumani/flutterDev/sdk/flutter...
Building flutter tool...`
Upgrading engine...
Downloading Android Maven dependencies...
Failed to download the Android dependencies
Downloading Android Maven dependencies... 127.7s (!)
Flutter 1.22.0-10.0.pre.133 • channel master • https://github.com/flutter/flutter.git
Framework • revision 577de1c44e (46 minutes ago) • 2020-09-10 15:55:03 -0700
Engine • revision fee6f9e533
Tools • Dart 2.10.0 (build 2.10.0-110.0.dev)
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.22.0-10.0.pre.133, on Linux, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices
✗ 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/linux#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.
✗ Android SDK file not found: adb.
[!] Android Studio (not installed)
[✓] Proxy Configuration
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
I have downloaded android SDK commandline tool from https://developer.android.com/studio#command-tools. But I am not sure how to install this tool and what path to be chosen as ANDROID_HOME?
NOTE: I am not going/able to use Android Studio for my app development.
Thanks for the help in advance.
Android Studio >> Tools >> SDK Manager >> SDK Tools >> Android SDK Command Line Tools

Flutter version on IOS stuck at 1.0.0

When I run:
pod outdated
on IOS to determine any pods that are outdated I get the following result:
....
Analyzing dependencies
The color indicates what happens when you run `pod update`
<green> - Will be updated to the newest version
<blue> - Will be updated, but not to the newest version because of specified version in Podfile
<red> - Will not be updated because of specified version in Podfile
The following pod updates are available:
- Flutter 1.0.0 -> 1.0.0 (latest version 1.3.300)
- Protobuf 3.9.2 -> 3.9.2 (latest version 3.10.0-rc1)
While version 1.0.0 of Flutter (in red) seems to be okay at the moment on IOS can someone please suggest how I can update this Pod?
I have upgraded Flutter using:
/Users/bob/Downloads/flutter/bin/flutter upgrade
The above command seems to make no difference per the pod version noted above. I would prefer everything be at the latest version but if it is not necessary knowing that information would be helpful as well.
Using:
/Users/bob/Downloads/flutter/bin/flutter doctor -v
reveals:
[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.6 18G95, locale en-US)
• Flutter version 1.9.1+hotfix.2 at /Users/bob/Downloads/flutter
• Framework revision 2d2a1ffec9 (3 weeks ago), 2019-09-06 18:39:49 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/bob/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.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_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.0, Build version 11A420a
• CocoaPods version 1.6.0
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 39.0.3
• Dart plugin version 191.8423
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
• iPhone 11 Pro Max • 08EB7508-34DE-4797-8F33-3DEE671742E4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-0 (simulator)
• No issues found!
The problem comes from the podhelper.rb script (YOUR_PATH//flutter/packages/flutter_tools/bin/podhelper.rb). It generates a 'fake' Flutter.podspec file but it hardcodes the 1.0.0 podspec.
Resolve this by editing lines 155-190 of podspec.rb (for iOS app), replacing the json definitions for the podspec with the version you want to move to from the CocoaPods repo (e.g. here for v2.5). Run pod update and it will update to 2.5.
The next section in the script repeats the same error for macOS apps so you may need to repeat for lines 193-228.
I am testing this right now but if you navigate into app_project/ios/Flutter/Flutter.podspec you will see there is Flutter version hardcoded to 1.0.0
Now I am no expert in Flutter so I don't know if you are supposed to manually change this, to what version you should change it, if it even makes any difference and why flutter don't provide script when you perform flutter upgrade to also update this file and flutter version.
Update your podhelper.rb on this path to update Flutter version on iOS.
YOUR_PATH//flutter/packages/flutter_tools/bin/podhelper.rb
s.name = 'Flutter'
s.version = '3.0.0'
Flutter 1.0.0 -> 1.0.0 (latest version 3.0.0)

Flutter fresh installation flutter run stuck

I am new to flutter i have fresh installtion.
All as in docs.
As after fresh installation i was fine worked but when i want to work on another day flutter run i stuck.... I do not know why. I only make boilerplate app. I xcode when i build app is opening in simulator but stating as flutter run not working. I even try to wait 20 min with this flutter run but still stuck
flutter doctor -v
[✓] Flutter (Channel master, v1.6.4-pre.14, on Mac OS X 10.14.5 18F132, locale
pl-PL)
• Flutter version 1.6.4-pre.14 at /Users/db/Desktop/Mobile/flutter
• Framework revision 81c38b22cb (32 hours ago), 2019-05-24 22:51:02 -0400
• Engine revision 8dc3a4cde2
• Dart version 2.3.2 (build 2.3.2-dev.0.0 e3edfd36b2)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/db/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-28, build-tools 28.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-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2.1, Build version 10E1001
• CocoaPods version 1.7.0
[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 35.3.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build
1.8.0_152-release-1343-b01)
[✓] Connected device (1 available)
• iPhone 8 • F35EFD3E-C637-427A-8405-30EDF202939A • ios •
com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)
• No issues found!
flutter run -v stuck at this stage.
+file:///Users/db/Desktop/Mobile/flutter/packages/flutter/lib/widgets.d
art
[ ] -> +file:///Users/db/Desktop/Flutter/iamsmart/lib/main.dart
[ ] -> 35191e22-84d6-4fab-abef-178ae9e4c665 build/app.dill 0
[ +319 ms] Building bundle
[ ] Writing asset files to build/flutter_assets
[ +55 ms] Wrote build/flutter_assets
[ +12 ms] Using legacy Xcode build system.
[ +27 ms] executing: [/Users/db/Desktop/Flutter/iamsmart/ios/]
/usr/bin/xcodebuild -list
Run this command
flutter clean
And then again
flutter run
Try to upgrade your flutter version to v 1.7.8 by running this
command this needs internet connection
flutter upgrade
Try this command
flutter clean
Change your flutter channel to stable
flutter channel stable
Check your internet connection because sometimes it prevents me from
running my app
Try to switch your flutter channel master to stable channel. After switching the channels you should call flutter upgrade to download the Flutter SDK and dependent packages.
Do this steps in the terminal
flutter channel stable
flutter upgrade
try to run your code after this steps.
Update to 1.9.1-hotfix4 fixed the problem
Your flutter doctor isn't showing any error as you had shared the commands.I think to share the run command terminal so that we can find out the stack of flowing of commands.
If you are getting error to build flutter project then you should update the Android Studio or VS Code Editor.
You can refer here:
Android studio-https://developer.android.com/studio
VS Code-https://code.visualstudio.com/Download
If you are able to create flutter project but doesn't getting run command then you need to update flutter and dart.
You can refer here:
Flutter-https://flutter.dev/docs/development/tools/sdk/releases
Dart-https://dart.dev/get-dart
If still you are suffering from error then you need to share some more Pics.
Probably something's gone wrong after you changed some files in of flutter ide. Also it does after updates crashed.
So the thing you should do is firstly backup your projects if it indeed. After backup remove the ide and be sure uninstalling complate succesful. Restart your computer and install all decencies again. Because sometimes upgrading does not works well to get good result.
P.S : Dont forget using flutter doctor for checking if any problem comes out.

Android SDK is missing command line tools

I've installed flutter but when I run flutter doctor to verify the installation, I get:-
Android SDK is missing command line tools
I've doubled checked that the command lines are installed.
What do I need to do remove this error?
I've included the full flutter doctor -v output below:-
$ flutter doctor -v
[✓] Flutter (Channel beta, v0.3.1, on Mac OS X 10.13.4 17E202, locale en-AU)
• Flutter version 0.3.1 at /Users/chris/flutter
• Framework revision 12bbaba9ae (2 weeks ago), 2018-04-19 23:36:15 -0700
• Engine revision 09d05a3891
• Dart version 2.0.0-dev.48.0.flutter-fe606f890b
[!] Android toolchain - develop for Android devices
• Android SDK at /usr/local/Caskroom/android-platform-tools/27.0.1
• Android NDK location not configured (optional; useful for native profiling support)
• ANDROID_HOME = /usr/local/Caskroom/android-sdk/3859397
✗ Android SDK is missing command line tools;
• Try re-installing or updating your Android SDK,
visit https://flutter.io/setup/#android-setup for detailed instructions.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.3, Build version 9E145
• 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 24.1.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 24.1.2
• Dart plugin version 181.4668.60
[!] Connected devices
! No devices available
! Doctor found issues in 2 categories.
On Android Studio open SDK Manager.
Go to SDK Tools tab.
Check if Android SDK Command-line Tools is checked. If not, check and apply the changes.
For some reason, after updating flutter and Android Studio, I got this error too. Seems like some new requirement that for some reason wasn't automatically installed.
This fixed it for me.
I think ANDROID_HOME and ANDROID SDK should be pointing to the same path and that is the SDK's root directory.
In my .bashrc (on LINUX), following are
export ANDROID_HOME=/home/myname/Android/Sdk
export PATH=/home/myname/Android/Sdk:$PATH
export PATH=/home/myname/Android/Sdk/platform-tools:$PATH
export PATH=/home/myname/Android/Sdk/tools:$PATH
export PATH=/home/myname/Android/ndk-build:$PATH
Just solved the problem. Here are my system settings:
System variable ANDROID_SDK_ROOT points to my Android SDK dir
In system Path variable, I have sdk/tools, sdk/platform-tools, and /flutter-dir/bin
Also make sure you don't have dulplicated directories. I previously downloaded another platform-tools and add it to Path, so I had to delete it and use the sdk's one.
After changing those things, I close the flutter cmd windows and run flutter doctor on PowerShell. Worked like a charm!
Please download the latest sdk build-tools to solve the problem of Android SDK is missing command line tools