Flutter: How to solve this Cocoapods version problem? - flutter

The App is working perfectly on Android but on iOS it shows me this Error when I try to launch:
Warning: CocoaPods minimum required version 1.9.0 or greater 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 upgrade 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 13.
And I'm actually shocked by this Flutter command of Cocoapods version 1.9.0! because I have just installed the latest Cocoapods version which is 1.5.2 on GitHub through brew install cocoapods.
Did someone face this problem before?
Please help :'(!

Solved it by:
Uninstall Hebrew completely from Mac.
Install rvm.
Install latest ruby version through rvm.
Install cocoapods---> sudo gem install cocoapods.

Related

flutter Project is not working in simulator mac os

I installed the flutter and using android studio to run the flutter project on simulator. I clone the project from git and run it shows this error
Error: To set up CocoaPods for ARM macOS, run:
arch -x86_64 sudo gem install ffi
Error running pod install
Error launching application on iPhone 14 Pro Max.
but when I make the new basic project it runs fine but not the cloned project. I tried some stuff.
open ~/.profile and add these
exports export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Also uninstall cocoapods and reinstall again. but nothing works for me.
what i am missing here?
Spending few hours on this problem finally it works for me.
Step 1: Uninstall the cocoapods by running this command in your project folder terminal
sudo gem uninstall cocoapods
Step 2: Install the cocoapods by running this command
brew install cocoapods
Note: Not forget to restart the android studio otherwise it would show another error. just close your project, close android studio, rerun the project or simulator.
Hope it will help someone.

Dart multiple installs on the system?

I'm having a bit of confusion about Dart and Pub installs on my system. I Use Android Studio and Flutter which comes with Dart, and if run Dart --version command in terminal I get Dart SDK version: 2.10.4 (stable) (Wed Nov 11 13:35:58 2020 +0100) on "macos_x64" which is the latest Flutter stable channel I installed.
Then to install Aqueduct with pub global activate aqueduct I was having the error pub command not found so I installed it and I had to also install PostgreSQL and Dart via home-brew .
Now to try and solve a bug that seems to be related to the latest version of dart Aqueduct db generate error: Bad state: NoSuchMethodError: The getter 'length' was called on null
I run brew install dart#2.8 but then if I run Dart --version again I still get Dart SDK version: 2.10.4 (stable) (Wed Nov 11 13:35:58 2020 +0100) on "macos_x64"
Here is the print from console:
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 7 formulae.
==> Installing dart#2.8 from dart-lang/dart
==> Downloading https://storage.googleapis.com/dart-archive/channels/stable/rele
Already downloaded: /Users/vinnytwice/Library/Caches/Homebrew/downloads/f3ce4b575125184d766bb56931b479589b16972fb0bcfd1e00c841a316c85e25--dartsdk-macos-x64-release.zip
Warning: Your Xcode (11.5) is outdated.
Please update to Xcode 12.3 (or delete it).
Xcode can be updated from the App Store.
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
If that doesn't show you an update run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Alternatively, manually download them from:
https://developer.apple.com/download/more/.
==> Caveats
Please note the path to the Dart SDK:
/usr/local/opt/dart#2.8/libexec
dart#2.8 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have dart#2.8 first in your PATH run:
echo 'export PATH="/usr/local/opt/dart#2.8/bin:$PATH"' >> ~/.zshrc
==> Summary
🍺 /usr/local/Cellar/dart#2.8/2.8.1: 502 files, 486MB, built in 34 seconds
How can I check what versions I have installed on the system and Flutter?
Many thanks
Update
After running brew uninstall dart when I open the aqueduct project then I get Dart SDK is not configured message from Android Studio.
If I then point to the Flutter's dart-sdk folder Android Studio accept it but I need a 2.7 version to work well with Aqueduct's Postgres db.
So I guess the system should be set with both Flutter with its own Dart version for Flutter projects and a global Dart version for non Flutter projects like this Aqueduct project.
But then how do I set my path? Should I include both in my .zshrc file?
Not to answer your whole question... addressing this part:
I was having the error pub command not found so I installed it
pub is going away. Learn to start typing "dart pub" or "flutter pub", depending on which subset of commands you want.
Finally figured it out..
To have a different Dart version for non Flutter projects use Home-brew as install instructions say with brew install dart command and it will install the latest version.. If you need a specific version as I did install with brew install dart#2.7, and then to use it install docs says to use the brew switch dart command but I got the switch command is disabled in terminal message in terminal so I used the link command instead as suggested as brew link --overwrite dart#2.7
To set it in Android Studio the correct path is /usr/local/Cellar/dart#2.7/2.7.0/libexec as when installing it the dart#2.7 is keg-only, which means it was not symlinked into /usr/local, because this is an alternate version of another formula. message suggested it doesn't get installed in normal route /usr/local/Cellar/dart there you'll find the latest SDK installed with the first brew install dart command..
Update the path for it in .zshrc file and it's all done..
Hope this will help others as getting it set up correctly got me scratching my head a bit ..
Cheers.

Can't install Flutter on Mac

This is the only install that fails, I have already installed Flutter on 2 other Macs without any issue.
It's a MBP 15-inch, 2018 running Mojave.
What might interfere with the installation is SentinelOne, that's installed on this machine and that I can't remove, so I need to somehow work around it.
Here's flutter doctor:
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F203, locale en-BE)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
✗ Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.
[!] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
✗ libimobiledevice and ideviceinstaller are not installed. To install with Brew, run:
brew update
brew install --HEAD usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
✗ ios-deploy not installed. To install:
brew install ios-deploy
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
For more info, see https://flutter.dev/platform-plugins
To install:
brew install cocoapods
pod setup
[!] Android Studio (version 3.4)
✗ Unable to find bundled Java version.
[✓] IntelliJ IDEA Ultimate Edition (version 2019.1.2)
[!] Connected device
! No devices available
! Doctor found issues in 4 categories.
I run brew update and then:
$ brew install --HEAD usbmuxd
==> Cloning https://git.sukimashita.com/libusbmuxd.git
Updating /Users/me/Library/Caches/Homebrew/usbmuxd--git
From https://git.sukimashita.com/libusbmuxd
60109fd..6539b02 master -> origin/master
==> Checking out branch master
Already on 'master'
Your branch is behind 'origin/master' by 4 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
HEAD is now at 6539b02 iproxy: Fix (newly introduced) timeout errors not being handled
==> ./autogen.sh
Last 15 lines from /Users/me/Library/Logs/Homebrew/usbmuxd/01.autogen.sh:
2019-07-04 13:22:50 +0200
./autogen.sh
./autogen.sh: line 6: libtoolize: command not found
./autogen.sh: line 8: aclocal: command not found
./autogen.sh: line 9: autoheader: command not found
./autogen.sh: line 10: automake: command not found
./autogen.sh: line 11: autoconf: command not found
./autogen.sh: line 14: ./configure: No such file or directory
Any help would be greatly appreciated.
I ran into the same issue few days ago.
First you have not completely installed all the requirements of Android studio and Xcode.These errors stamps from improper installation and configurations.
Follow these steps.
Install or reinstall Android Studio -for the latest version
Install or reinstall Flutter macOS
https://flutter.dev/docs/get-started/install/macos
Install or update Xcode - this takes nearly a couple of hours depending on your connections.
Once all is installed - you need to run the command Lines to accept the agreements for Xcode and Xcode toolbox.
Install cocoa pod also using the command Line as mentioned in the flutter guide.
Finally, make sure that your flutter path in located somewhere you can find it and create a .zshrc file and expose the path into this file. I recommend /Users/johndoe/Development
`nano ~/.zshrc'
export PATH="$PATH:[PATH_OF_FLUTTER_GIT_DIRECTORY]/bin"
per my recommendation it would look like this
export PATH="$PATH:/Users/johndoe/Development/flutter/bin"
you have to install brew for that, first of all you have to run this command and after that run all other command as suggested in flutter doctor result.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
download java from following link and install it.
https://support.apple.com/kb/dl1572?locale=en_US
Android studio 3.4 is not now supported with flutter, so as of now you can not solve this error.
for More details you can refer this video.
https://www.youtube.com/watch?v=Xy-qHlaHr6c

"Could not connect to lockdownd" while attempting to run flutter app

I am following the Get Started tutorial.
I can install everything, flutter doctor returns all checkmarks but in the end there is a message:
idevice_id returned an error:
ERROR: Could not connect to lockdownd, error code -2
Same message appears if I try to run the app using flutter run or if I try to list the devices using flutter devices.
The tutorial also states that:
Note: If the Run & Debug buttons are disabled, and no targets are listed, Flutter has not been able to discover any connected iOS or Android devices or simulators. You need to connect a device, or start a simulator, to proceed
I have two devices listed my Android phone and an iPhone simulator. Run and Debug buttons are ENABLED!
How can I run my app using flutter? It can be either using the command line or IntelliJ IDE.
Disconnect all iOS devices, then:
brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew link --overwrite libimobiledevice
brew install --HEAD ideviceinstaller
brew link --overwrite ideviceinstaller
sudo rm -rf /var/db/lockdown/*
Connect an iOS device, and choose "Trust" when prompted, after that:
sudo chmod -R 777 /var/db/lockdown/
This workaround worked for me when loosing the connection:
close everything (Visual Studio Code, Xcode, Simulator)
disconnect any physical device
Start Visual Studio Code
connect a physical IOS phone
Start XCode
build from XCode (it will work)
Disconnect your physical device
Start without debug
You will be prompted to connect to a device
and from there it worked again!
This just to help to debug the loos of connection bug. I have also observed that it begins just after the "stop debugging" command from Visual Studio Code.
I was having similar issues, and resolved them using the below. Hopefully this will help you. flutter doctor was telling me the answers, but they were a bit buried. Look for something like this:
[-] iOS toolchain - develop for iOS devices (Xcode 8.3.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 8.3.3, Build version 8E3004b
✗ libimobiledevice and ideviceinstaller are not installed or require updating. To update, run:
brew uninstall --ignore-dependencies libimobiledevice
brew install --HEAD libimobiledevice
brew install ideviceinstaller
• ios-deploy 1.9.1
✗ ios-deploy out of date (1.9.2 is required). To upgrade:
brew upgrade ios-deploy
• CocoaPods version 1.2.0
There are four brew commands in there to run. When I did them, this problem disappeared for me. Good luck!

ionic 2 installation requirements

Am just getting started with ionic 2 and am having problems with the installation . I want to know the requirements for installing ionic 2 apart from node and npm.
Do i need to have android sdk installed? What other stuff should I have.
You would need java sdk 1.7 or higher.
You do need to download the Android Studio and install the required android sdk version for which you would want to build.
You would also need the node version of minimum of v6.9.0 or higher.
try running node --version
And do read up on ionic appscripts in github. There are changes perhaps you would need to apply - https://github.com/driftyco/ionic-app-scripts
You could also Try installing nvm -
https://github.com/creationix/nvm
its called the node version manager. will allow you to have multiple versions of node installed and certainly recommended.
Preferably try and build on the linux platform, to avoid silly issues in windows.
Things you need for installing ionic with windows
nodejs
android sdk
java sdk.
setting path is most important
apache ant
You could check out this link for installing and running to android device
http://www.tiagoporto.com/blog/environment-setting-tutorial-ionic-android-on-windows/
to setup ionic you need to do the following
run
sudo apt-get install nodejs
sudo npm install -g cordova
then
sudo npm install -g ionic
Done run ionic serve inside app folder created using
ionic start todo super --type v2 !!
this will help you to run app on browser
now to install on device,
you need android SDK,
and then you will be able to install apk on phone.
to do that you need to setup android SDK
use the following lines to do that
Install openjdk
sudo apt-get install openjdk-7-jdk lib32stdc++6 lib32z1
Download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
install all sdk packages
cd android-sdk-linux/tools
./android update sdk --no-ui
Set android-sdk path
pico ~/.bashrc
Add these lines on top, save, and exit
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
Reload bashrc
source ~/.bashrc