Flutter build iOS error CocoaPods not installed. Skipping pod install - xcode

Iam using Mac and upgraded to Android studio "Bumblebee", only in Mac when I try to do: Build -> Flutter -> Build iOS it shows this warning:
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. Process finished with exit code 1
But I did already this
gem install cocoapods Successfully installed cocoapods-1.11.2 Parsing documentation for cocoapods-1.11.2 Done installing documentation for cocoapods after 1 seconds 1 gem installed
When I do sudo gem install cocoapods I got:
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory.
I did Invalidate Caches and pod install also, but it still shows same warning.
Flutter doctor
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.0.1 20B29 darwin-x64, locale en-GB)
• Flutter version 2.8.1 at /Users/test/Downloads/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/test/Library/Android/sdk
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[!] Xcode - develop for iOS and macOS (Xcode 12.5.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
! Flutter recommends a minimum Xcode version of 13.0.0.
Download the latest version or update via the Mac App Store.
✗ 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 see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2021.1)
• Android Studio at /Users/test/Desktop/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
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
How to fix it?
Regards

close android studio
open terminal -> run open /Applications/Android\ Studio.app
try again ...
problem comes with new android studio version bumblebee
android studio started from macs dock is not able to reach the environment variables when its started from mac os dock
UPDATE:
run chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv
now it works from dock

Just run this at terminal: run chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv

The issue appears to be Cocopods not being installed with Big Sur or above. I found upgrading Ruby to a newer version and then installing Cocopods helped my coworker. Please follow the steps in the solution for installing Cocopods: Unable to install cocoa pods

It's now fixed with the latest patch on BumbleBee. Check this blog post.

Related

Flutter not able to run, get_navigation & theme error

i'm actually trying to run my app but i'm stucked with that error :
Running "flutter pub get" in riverpod_stacked_app...
Launching lib/main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
../../.pub-cache/hosted/pub.dartlang.org/get-3.15.0/lib/get_navigation/src/extension_navigation.dart:235:37: Error: No named parameter with the name 'shadowThemeOnly'.
final theme = Theme.of(context, shadowThemeOnly: true);
^^^^^^^^^^^^^^^
../../development/flutter/packages/flutter/lib/src/material/theme.dart:119:20: Context: Found this candidate, but the arguments don't match.
static ThemeData of(BuildContext context) {
^^
../../.pub-cache/hosted/pub.dartlang.org/get-3.15.0/lib/get_navigation/src/extension_navigation.dart:431:43: Error: No named parameter with the name 'shadowThemeOnly'.
theme: Theme.of(key.currentContext, shadowThemeOnly: true),
^^^^^^^^^^^^^^^
../../development/flutter/packages/flutter/lib/src/material/theme.dart:119:20: Context: Found this candidate, but the arguments don't match.
static ThemeData of(BuildContext context) {
^^
FAILURE: Build failed with an exception.
* Where:
Script '/Users/Alex/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 900
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/Alex/development/flutter/bin/flutter'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 19s
Exception: Gradle task assembleDebug failed with exit code 1
I don't understand why it can't build. I don't see the link between those 2 errors :
get_navigation
something with the theme from material.dart
And my actual motivation to use riverpod, stacked_services and firebase.
Here is the result of flutter doctor -v :
[✓] Flutter (Channel master, 1.24.0-8.0.pre.98, on Mac OS X 10.15.7 19H2 darwin-x64, locale fr-FR)
• Flutter version 1.24.0-8.0.pre.98 at /Users/Alex/development/flutter
• Framework revision ef4ec09a06 (6 hours ago), 2020-11-05 08:02:13 -0800
• Engine revision bf259226b2
• Dart version 2.12.0 (build 2.12.0-21.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/Alex/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✗] 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 see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Android Studio (version 4.1)
• 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
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (1 available)
• sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
! Doctor found issues in 1 category.
And here is my dependencies in pubspeck.yaml
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
stacked_services:
auto_route: 0.6.9
hooks_riverpod: 0.12.1
flutter_hooks:
firebase_core: 0.5.1
firebase_auth: 0.18.2
dev_dependencies:
flutter_test:
sdk: flutter
build_runner:
auto_route_generator:
Any ideas ? I've trie to clean up my dependencies and reinstall. Also i start a blank project with flutter counter app and it runs properly.
I also had this problem today after upgrading Flutter.
I was only able to solve it after I deleted that method parameter from the file that triggered the error. You'll have to delete it in two places.
Search in .pub-cache/hosted/pub.dartlang.org/get-3.15.0/lib/get_navigation/src/extension_navigation.dart for
Theme.of(key.currentContext, shadowThemeOnly: true)
As replace it with
Theme.of(key.currentContext)
This is probably cause by the stacked_services dependency that uses the get: ^3.15.0 dependency
Later edit: this is actually not the best solution, because somebody cloning your repo will not be able to compile the project unless they also to this change
So it's better to upgrade the dependency that causes this error, or replace it with another one; but only after you ran flutter upgrade, or try changing the channel
this is already fixed by getx in 16.1. Pub upgrade will do it
https://github.com/jonataslaw/getx/issues/762
you need to remove only
ThemeData theme = Theme.of(key.currentContext, shadowThemeOnly: false);
if (theme != null) {
bottomSheet = new Theme(data: theme, child: bottomSheet);
}
return bottomSheet;
form your .pubcach folder.

Android studio keeps showing "Loading..." on device selector

I got stuck in this problem for several days, my android studio suddenly keep showing 'Loading...' on its device selector when there are active android emulator or connected to android device.
i use mac os catalina 10.15.5 and here is some clue that might help :
siekoo-mac:~ siekoo$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.15.5 19F101, locale en-ID)
[✓] 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 4.0)
[✓] VS Code (version 1.47.0)
[✓] Connected device (1 available)
siekoo-mac:~ siekoo$ adb devices
List of devices attached
16fb14c20205 device
Ive tried several solutions, like run invalidate & cache restart on android studio, reinstalling adb platform tools, reinstalling android SDKs or even downgrade/upgrade the android studio, all doesnt end with good result. For now, i run my project on android device via terminal
In my case it was due to different compile and target SDK versions inside app level gradle and library gradle. It was resolved by changing sdk versions from 26 to 29 in both.
Open another android project in new window (not a flutter project). Now you have two windows of android studio.
then device will detect on Android project. You will be able to connect your device for native android project. Then try again to detect device on flutter project.
Your device will show here.
This worked for me.
maybe
Open in Android Studio - Preferences | Languages & Frameworks | Flutter
Set path SDK .../SDK/flutter

Flutter stable 1.17.1 and Xcode 11.5 issues

After upgrading to Flutter 1.17.1 and Xcode 11.5, I cannot build for iOS anymore.
Despite following all the direction in https://flutter.dev/docs/development/ios-project-migration
Anyone faces the same issue? Any solution?
flutter doctor
Waiting for another flutter command to release the startup lock...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.4 19E287, locale en-SG)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Android Studio (version 3.6)
[!] Android Studio (version 2.3)
✗ Flutter plugin version 12.1 - the recommended minimum version is 16.0.0
[✓] VS Code (version 1.45.1)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
Here is the output when I do
flutter run
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Your Xcode project requires migration. See https://flutter.dev/docs/development/ios-project-migration for details.
Error launching application on iPhone 11 Pro Max.
Yes, in addition, I have to remove the above.
thanks
Came from 1.13=>1.17. It did not upgrade my project automatically so I had to work a bit in Xcode. I solved the issue by executing all steps listed on the migration page. Then executing:
rm -rf ios/Flutter/App.framework
rm -rf ios/Pod*
flutter clean
Build and run => success

Your Xcode project requires migration

My project ios build fails after Xcode updating to 11.4.
steps from the manual (https://flutter.dev/docs/development/ios-project-migration) have already been made by flutter automatically(?) - everything written there has been done.
MacBook-Pro-ddd:my_awesome_project dm$ flutter clean
Cleaning Xcode workspace... 2,9s
Deleting build... 1ms
Deleting .dart_tool... 2ms
Deleting Generated.xcconfig... 0ms
Deleting flutter_export_environment.sh... 0ms
Deleting App.framework... 3ms
MacBook-Pro-ddd:my_awesome_project dm$ flutter build ios
Building ru.ddd.awesomeProject for device (ios-release)...
Your Xcode project requires migration. See https://flutter.dev/docs/development/ios-project-migration for details.
MacBook-Pro-ddd:my_awesome_project dm$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.0, on Mac OS X 10.15.4 19E287, locale ru-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[✓] Android Studio (version 3.6)
[!] IntelliJ IDEA Ultimate Edition (version 2020.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.44.2)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
MacBook-Pro-ddd:my_awesome_project dm$
After following the official guides, Like #iluvatar_GR suggests delete App.Framework in addition also delete Flutter.framework from the Frameworks directory.
Run flutter clean and try running.
If there are any other errors other than project requires migration you might want to run rm -rf ios/Pods and try again.

flutter does't see ios-deploy

I installed flutter by official docs. When I did flutter doctor -v I don't get information with :
IOS toolchain as my other(old) mac book.
[✓] iOS toolchain - develop for iOS devices (Xcode 11.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.2.1, Build version 11B500
• ios-deploy 1.9.4
• CocoaPods version 1.8.3
Instead this I get:
> [✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
> • Xcode at /Applications/Xcode.app/Contents/Developer
> • Xcode 11.2.1, Build version 11B500
> • CocoaPods version 1.8.4
and flutter doesn't see ios-deploy. Which I installed as well.
ios-deploy --version
1.10.0-beta.3
And as result on my new mac book my project doen't work. I cloned the same git branch on my new macbook and get error after run "flutter build ios --release --no-codesign":
8 warnings generated.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
ld: targeted OS version does not support use of thread local variables in __ZZN9GMSx_absl18container_internal10RandomSeedEvE7counter for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
#Pro You was right, this is not flutter issue.
Answear:
The issue fixed by changing the Deployment Target from 8.0 to 9.0 in Xcode

Resources