flutter does't see ios-deploy - macos

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

Related

Failed to build iOS app Error (Xcode): Expected Flutter XXX, but found XXX

Just upgraded to flutter 3.7.3 on channel stable. Running on ios simulator works fine, but when I try to archive project:
Failed to build iOS app
Error (Xcode): Expected Flutter 857bd6b74c5eb56151bfafe91e7fa6a82b6fee25, but found 248290d6d50a1bf1a6a246544347c03acda867a5
Encountered error while archiving for device.
Flutter doctor is:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.3, on macOS 13.0 22A380 darwin-arm64, locale fr-FR)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
✗ 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 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.75.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
Found the fix:
This issue happens when you generated a shader compilation jank. In the generated file (i.e flutter_01.sksl.json) you have to change the Flutter version. Preferably you run the SkSL warmup again with the new flutter version

macos arm64 flutter builds

I have an problem building hello world flutter project for arm64 (apple m1 pro silicon) macos platform:
$ flutter build macos
Running "flutter pub get" in flutter_application_1... 234ms
💪 Building with sound null safety 💪
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-000C09201A06801E }
{ platform:macOS, arch:x86_64, id:00006000-000C09201A06801E }
Snapshot not compatible with the current VM configuration: the snapshot requires 'release no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers no-dedup_instructions no-asserts use_field_guards use_osr no-branch_coverage x64-sysv no-compressed-pointers no-null-safety' but the VM has 'release no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers no-dedup_instructions no-asserts use_field_guards use_osr no-branch_coverage arm64-sysv no-compressed-pointers no-null-safety'
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
Building macOS application...
Build process failed
Unfortunately I'm not an expert on flutter and flutter build tools, but it seems that flutter builds x86_64 binary and tries to run it on aarch64 platform for some reason. How can I make flutter to build aarch64 version of app?
Template project built with command:
flutter create --template app --platforms macos hello_world
Tools version info:
$ flutter --version
Flutter 3.0.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 85684f9300 (3 months ago) • 2022-06-30 13:22:47 -0700
Engine • revision 6ba2af10bb
Tools • Dart 2.17.5 • DevTools 2.12.2
$ sw_vers
ProductName: macOS
ProductVersion: 12.1
BuildVersion: 21C52
$ xcodebuild -version
Xcode 13.0
Build version 13A233
The main issue was with the way I've installed flutter: nixpkgs. It tries to find tools in wrong folder. After modifying patches https://github.com/NixOS/nixpkgs/pull/196133 for macos everything works fine.

Flutter build iOS error CocoaPods not installed. Skipping pod install

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.

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.

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

Resources