im having trouble building my flutter project on my mac M1. When i try launching it in android studio im getting the error code 'error running pod install' and when i try opening it in xcode im getting 'module cloud_firestore not found'.
I have tried all the solutions in this thread How to solve "error running pod install" in flutter on mac? but nothing seems to work.
Im having no troble building flutter project without any dependencies but as soon as i add one im getting the error messages mentioned above, any ideas on how i could solve this?
I came to this problem as well (Macbook Air M1). I also tried the solution on your mentioned link but failed. However, finally I could solve the problem by following the steps on 'Deploy to iOS Device'
https://docs.flutter.dev/get-started/install/macos#install-xcode
Run this code on Terminal
$ sudo gem install cocoapods
$ sudo gem install ffi -- --enable-libffi-alloc
Restart Android Studio
Related
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 know there are many threads about this but even though I searched for days, none of them could solve my problem.
I am using macOS Monterey 12.5.1 M1 Chip. I tried the 2022 and 2021 solution written in the most fav solution at this address How to run CocoaPods on Apple Silicon (M1), but it did not improve.
While applying 'sudo arch -x86_64 gem install ffi' in 2021 solution, I get the error "arch: posix_spawnp: gem: Bad CPU type in executable". The address says download rosetta as a solution, I download 'softwareupdate --install-rosetta' like this but this did not solve my problem.
I updated the Ruby version to 3.1.2 nothing changed,
and I tried;
delete ios folder
Flutter create .
pod deintegrate ios folder
pod install ios folder
Flutter clean
Flutter pub get
Flutter run
error persists.
When I change the released sections in the project 'Runner' section in the podfile to debug, I can open the application in the simulator, but this time while trying the application on the real device, when I want to run the application again, a white screen comes and throws it from the application. Thanks in advance to those who can help.
I'm following the instructions to install flutter, it's my first install and I'm being careful not to miss a step. But...
Everything is going well until I try to run flutter doctor. I have updated the path and all is well.
I've edited the .bash_profile adding this line:
export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin"
echo $PATH and which flutter are both correct.
Please see the screenshot attached.
Running on macOS Sierra, version 10.12.6 // Flutter version: flutter_macos_2.0.1-stable
Terminal: Flutter Doctor Crash
EDIT:
I've done what you suggested:
My Mac is running 64-bits OK.
I have installed brew OK
brew install dart with some errors
refresh and run flutter doctor -vwith crash
1)
2)
First, verified if the your mac is 64-bits, click here for know how.
In Mac the Flutter run only in architecture 64-bits;
If the your mac is the 64-bits try install the dart using the Brew;
After install brew, open the terminal and run the command:
brew install dart
Now run the flutter doctor;
So, I found a way around my issue.
As I cannot upgrade my Mac (for now), which I think was part of the problem, I tried to downgrade my Flutter version.
I installed 1.22.0-stable. Now flutter doctor runs OK-ish.
The only thing now is, having a mid-2010 MacOS 10.12.6 (Sierra), not being able to upgrade to (at least) Mojave, I cannot install Xcode 11, which is the minimum version allowed so I can compile on IOS.
Anyway, for now it seems to run fine: Android Studio - Flutter & Dart plugins - Android Simulator.
Although, working on a Mac and not being able to run/work on an IOS app is a bit frustrating, not gonna lie...
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.
Could you guys please help me with the problems I currently have?
I'm trying to follow the steps of how to release apk android from: https://flutter.dev/docs/deployment/android, The program which I tried to release is only the NewFlutterApplication which created from template of Flutter
The problem is: Have been followed all the steps, still I can't run the release apk which i build from flutter
The Error which I got:
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install E:\FlutterProject\flutter_app_1\build\app\outputs\apk\app.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
Install failed
The things that I have tried:
Tried from this site Flutter release apk is not installing on device, but there is no hope
Tried from this site Can't build release APK for flutter, but still no hope
Tried using the flutter run --release in the real device, it's directly crash and return stopped working
Tried using the flutter build apk && flutter install, it's not running and give the error from top error
Tried using flutter run -v it don't give any error and run smoothly and the debug it's still run smoothly, only the release APK is the problem which can't be run
UPD: This answer is outdated, Flutter now supports x86/x64
You can't run release build on emulator, because currently flutter doesn't support x86 release binaries
See this issue, and put thumb up reaction on it to increase priority:
https://github.com/flutter/flutter/issues/9253
This issue also affects devices that use Intel Atom and some Chromebooks, but don't worry, they will be excluded from supported devices by Google Play automatically
INSTALL_FAILED_NO_MATCHING_ABIS is when you are trying to install an app that has native libraries and it doesn't have a native library for your cpu architecture. For example if you compiled an app for armv7 and are trying to install it on an emulator that uses the Intel architecture instead it will not work.